Index: /branches/eam_branches/ipp-20120601/Nebulous/nebclient/tests/tap/src/tap.c
===================================================================
--- /branches/eam_branches/ipp-20120601/Nebulous/nebclient/tests/tap/src/tap.c	(revision 34051)
+++ /branches/eam_branches/ipp-20120601/Nebulous/nebclient/tests/tap/src/tap.c	(revision 34052)
@@ -87,5 +87,6 @@
     if(test_name != NULL) {
         va_start(ap, test_name);
-        vasprintf(&local_test_name, test_name, ap);
+        int status = vasprintf(&local_test_name, test_name, ap);
+	if (status) {/* warning? */}
         va_end(ap);
 
@@ -303,5 +304,6 @@
 
     va_start(ap, fmt);
-    asprintf(&skip_msg, fmt, ap);
+    int status = asprintf(&skip_msg, fmt, ap);
+    if (status) {/* warning? */}
     va_end(ap);
 
@@ -328,5 +330,6 @@
 
     va_start(ap, fmt);
-    vasprintf(&todo_msg, fmt, ap);
+    int status = vasprintf(&todo_msg, fmt, ap);
+    if (status) {/* warning? */}
     va_end(ap);
 
Index: /branches/eam_branches/ipp-20120601/ippTools/src/pstamptool.c
===================================================================
--- /branches/eam_branches/ipp-20120601/ippTools/src/pstamptool.c	(revision 34051)
+++ /branches/eam_branches/ipp-20120601/ippTools/src/pstamptool.c	(revision 34052)
@@ -1046,5 +1046,5 @@
     // it's an allowed arg because add_poll_args adds it
     PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false);
-    if (limit) { /* do something?? */
+    if (limit) { /* do something?? */ }
 
     PXOPT_LOOKUP_S16(fault, config->args, "-fault",  false, false);
@@ -1055,17 +1055,17 @@
     psString faultClause = psStringCopy("");
     if (!fault) {
-        psStringAppend(&faultClause, " \nAND (pstampJob.fault < %d)", PSTAMP_FIRST_ERROR_CODE);
+	psStringAppend(&faultClause, " \nAND (pstampJob.fault < %d)", PSTAMP_FIRST_ERROR_CODE);
     }
 
     psString query = pxDataGet("pstamptool_revertjob.sql");
     if (!psListLength(where->list) && !all) {
-        psFree(where);
-        psError(PXTOOLS_ERR_CONFIG, false, "search parameters or -all are required");
-        return false;
+	psFree(where);
+	psError(PXTOOLS_ERR_CONFIG, false, "search parameters or -all are required");
+	return false;
     }
     if (psListLength(where->list)) {
-        psString whereClause = psDBGenerateWhereConditionSQL(where, NULL);
-        psStringAppend(&query, " AND %s", whereClause);
-        psFree(whereClause);
+	psString whereClause = psDBGenerateWhereConditionSQL(where, NULL);
+	psStringAppend(&query, " AND %s", whereClause);
+	psFree(whereClause);
     }
     psFree(where);
@@ -1075,15 +1075,15 @@
     psString faultCountClause = NULL;
     if (clear_fault_count) {
-        psStringAppend(&faultCountClause, "\n, pstampJob.fault_count = 0");
+	psStringAppend(&faultCountClause, "\n, pstampJob.fault_count = 0");
     } else {
-        psStringAppend(&query, " AND pstampJob.fault_count < %d", PSTAMP_MAX_JOB_FAULTS);
+	psStringAppend(&query, " AND pstampJob.fault_count < %d", PSTAMP_MAX_JOB_FAULTS);
     }
 
     if (!p_psDBRunQueryF(config->dbh, query, faultCountClause, faultClause)) {
-        psFree(faultCountClause);
-        psFree(faultClause);
-        psFree(query);
-        psError(PS_ERR_UNKNOWN, false, "database error");
-        return false;
+	psFree(faultCountClause);
+	psFree(faultClause);
+	psFree(query);
+	psError(PS_ERR_UNKNOWN, false, "database error");
+	return false;
     }
 
@@ -1094,4 +1094,5 @@
     return true;
 }
+
 static bool addprojectMode(pxConfig *config)
 {
@@ -1107,13 +1108,13 @@
 
     if (!pstampProjectInsert(config->dbh,
-            0,
-            name,
-            state,
-            imagedb,
-            dvodb,
-            camera,
-            telescope,
-            need_magic
-        )) {
+			     0,
+			     name,
+			     state,
+			     imagedb,
+			     dvodb,
+			     camera,
+			     telescope,
+			     need_magic
+	    )) {
         psError(PS_ERR_UNKNOWN, false, "database error");
         return false;
Index: /branches/eam_branches/ipp-20120601/ppBackground/src/ppBackgroundExit.c
===================================================================
--- /branches/eam_branches/ipp-20120601/ppBackground/src/ppBackgroundExit.c	(revision 34051)
+++ /branches/eam_branches/ipp-20120601/ppBackground/src/ppBackgroundExit.c	(revision 34052)
@@ -10,5 +10,14 @@
     }
 
-    psErrorCode errorCode = psErrorCodeLast(); // Error code
+    // gcc -Wswitch complains here if err is declared as type psErrorCode
+    // the collection of ps*ErrorCode values are enums defined separately for 
+    // each module (psphot, pswarp, etc).  the lowest type, psErrorCode is only the base set and does
+    // not include the possible psphot values
+
+    // for now, to get around this, we just use an int for the switch
+
+    // psErrorCode errorCode = psErrorCodeLast(); // Error code
+    int errorCode = psErrorCodeLast(); // Error code
+
     if (errorCode != PS_ERR_NONE) {
         pmFPAfileFreeSetStrict(false);
Index: /branches/eam_branches/ipp-20120601/ppStack/src/ppStackConvolve.c
===================================================================
--- /branches/eam_branches/ipp-20120601/ppStack/src/ppStackConvolve.c	(revision 34051)
+++ /branches/eam_branches/ipp-20120601/ppStack/src/ppStackConvolve.c	(revision 34052)
@@ -7,5 +7,5 @@
 	psMetadataItem *item = psMetadataLookup(SOURCE->concepts, NAME); \
 	psAssert(item, "Concept should be present");			\
-	psAssert(item->type == PS_TYPE_F32, "Concept should be F32");	\
+	psAssert(item->type == PS_DATA_F32, "Concept should be F32");	\
 	item->data.F32 = VALUE;						\
     }
@@ -101,5 +101,14 @@
         if (!ppStackMatch(readout, target, options, i, config)) {
             // XXX many things can cause a failure of ppStackMatch -- should some be handled differently?
-            psErrorCode error = psErrorCodeLast(); // Error code
+
+	    // gcc -Wswitch complains here if err is declared as type psErrorCode
+	    // the collection of ps*ErrorCode values are enums defined separately for 
+	    // each module (psphot, pswarp, etc).  the lowest type, psErrorCode is only the base set and does
+	    // not include the possible psphot values
+
+	    // for now, to get around this, we just use an int for the switch
+
+	    // psErrorCode error = psErrorCodeLast(); // Error code
+	    int error = psErrorCodeLast(); // Error code
             switch (error) {
                 // Fatal errors
Index: /branches/eam_branches/ipp-20120601/ppStack/src/ppStackFinish.c
===================================================================
--- /branches/eam_branches/ipp-20120601/ppStack/src/ppStackFinish.c	(revision 34051)
+++ /branches/eam_branches/ipp-20120601/ppStack/src/ppStackFinish.c	(revision 34052)
@@ -45,5 +45,13 @@
     }
 
-    psErrorCode errorCode = psErrorCodeLast(); // Error code
+    // gcc -Wswitch complains here if err is declared as type psErrorCode
+    // the collection of ps*ErrorCode values are enums defined separately for 
+    // each module (psphot, pswarp, etc).  the lowest type, psErrorCode is only the base set and does
+    // not include the possible psphot values
+
+    // for now, to get around this, we just use an int for the switch
+
+    // psErrorCode errorCode = psErrorCodeLast(); // Error code
+    int errorCode = psErrorCodeLast(); // Error code
     if (errorCode == PS_ERR_NONE) {
 	return exitValue;
Index: /branches/eam_branches/ipp-20120601/ppStack/src/ppStackTarget.c
===================================================================
--- /branches/eam_branches/ipp-20120601/ppStack/src/ppStackTarget.c	(revision 34051)
+++ /branches/eam_branches/ipp-20120601/ppStack/src/ppStackTarget.c	(revision 34052)
@@ -191,5 +191,5 @@
 
         float norm = powf(10.0, -0.4 * options->norm->data.F32[i]); // Normalisation from stars
-        float meanVariance = bg->robustMedian * PS_SQR(norm);       // Mean variance in normalised image
+        float meanVariance = mean * PS_SQR(norm);       // Mean variance in normalised image
 
         if (meanVariance < minVariance) {
Index: /branches/eam_branches/ipp-20120601/ppSub/src/ppSubExit.c
===================================================================
--- /branches/eam_branches/ipp-20120601/ppSub/src/ppSubExit.c	(revision 34051)
+++ /branches/eam_branches/ipp-20120601/ppSub/src/ppSubExit.c	(revision 34052)
@@ -11,5 +11,13 @@
     }
 
-    psErrorCode errorCode = psErrorCodeLast(); // Error code
+    // gcc -Wswitch complains here if err is declared as type psErrorCode
+    // the collection of ps*ErrorCode values are enums defined separately for 
+    // each module (psphot, pswarp, etc).  the lowest type, psErrorCode is only the base set and does
+    // not include the possible psphot values
+
+    // for now, to get around this, we just use an int for the switch
+
+    // psErrorCode errorCode = psErrorCodeLast(); // Error code
+    int errorCode = psErrorCodeLast(); // Error code
     if (errorCode != PS_ERR_NONE) {
         pmFPAfileFreeSetStrict(false);
Index: /branches/eam_branches/ipp-20120601/ppSub/src/ppSubMatchPSFs.c
===================================================================
--- /branches/eam_branches/ipp-20120601/ppSub/src/ppSubMatchPSFs.c	(revision 34051)
+++ /branches/eam_branches/ipp-20120601/ppSub/src/ppSubMatchPSFs.c	(revision 34052)
@@ -266,5 +266,5 @@
         if (!detections->allSources) {
             psFree(detections);
-            psErrorCode error = psErrorCodeLast(); // Error code
+            int error = psErrorCodeLast(); // Error code
             if (error == PM_ERR_OBJECTS) {
                 psErrorStackPrint(stderr, "Unable to match source lists");
@@ -439,5 +439,5 @@
 
     if (!success) {
-        psErrorCode error = psErrorCodeLast(); // Error code
+        int error = psErrorCodeLast(); // Error code
         if (error == PM_ERR_STAMPS) {
             psErrorStackPrint(stderr, "Unable to find stamps");
Index: /branches/eam_branches/ipp-20120601/psLib/src/imageops/psImageInterpolate.c
===================================================================
--- /branches/eam_branches/ipp-20120601/psLib/src/imageops/psImageInterpolate.c	(revision 34051)
+++ /branches/eam_branches/ipp-20120601/psLib/src/imageops/psImageInterpolate.c	(revision 34052)
@@ -997,4 +997,5 @@
     INTERPOLATE_SETUP(x, y);
     xExact = yExact = false;
+    if (xExact && yExact) { /* possible alternative */ }
 
     psF32 xKernel[size], yKernel[size]; // Interpolation kernels
@@ -1046,4 +1047,5 @@
     INTERPOLATE_SETUP(x, y);
     xExact = yExact = false;
+    if (xExact && yExact) { /* possible alternative */ }
 
     psF32 xKernel[size], yKernel[size]; // Interpolation kernels
Index: /branches/eam_branches/ipp-20120601/psLib/src/imageops/psImageStructManip.c
===================================================================
--- /branches/eam_branches/ipp-20120601/psLib/src/imageops/psImageStructManip.c	(revision 34051)
+++ /branches/eam_branches/ipp-20120601/psLib/src/imageops/psImageStructManip.c	(revision 34052)
@@ -212,4 +212,6 @@
     elementSize = PSELEMTYPE_SIZEOF(inDatatype);
 
+    if (0) { fprintf (stderr, "%d elements, %d total memory\n", elements, elements * elementsSize); }
+
     output = p_psImageRecycle(file, lineno, func, output, numCols, numRows, type);
     P_PSIMAGE_SET_COL0(output, input->col0);
Index: /branches/eam_branches/ipp-20120601/psLib/test/tap/src/tap.c
===================================================================
--- /branches/eam_branches/ipp-20120601/psLib/test/tap/src/tap.c	(revision 34051)
+++ /branches/eam_branches/ipp-20120601/psLib/test/tap/src/tap.c	(revision 34052)
@@ -87,5 +87,6 @@
     if(test_name != NULL) {
         va_start(ap, test_name);
-        vasprintf(&local_test_name, test_name, ap);
+        int status = vasprintf(&local_test_name, test_name, ap);
+	if (status) {/* warning? */}
         va_end(ap);
 
@@ -303,5 +304,6 @@
 
     va_start(ap, fmt);
-    asprintf(&skip_msg, fmt, ap);
+    int status = asprintf(&skip_msg, fmt, ap);
+    if (status) {/* warning? */}
     va_end(ap);
 
@@ -328,5 +330,6 @@
 
     va_start(ap, fmt);
-    vasprintf(&todo_msg, fmt, ap);
+    int status = vasprintf(&todo_msg, fmt, ap);
+    if (status) {/* warning? */}
     va_end(ap);
 
Index: /branches/eam_branches/ipp-20120601/psModules/src/detrend/pmFringeStats.c
===================================================================
--- /branches/eam_branches/ipp-20120601/psModules/src/detrend/pmFringeStats.c	(revision 34051)
+++ /branches/eam_branches/ipp-20120601/psModules/src/detrend/pmFringeStats.c	(revision 34052)
@@ -662,5 +662,5 @@
         if (item->type == PS_DATA_VECTOR) { \
             ARRAY->data[i] = psMemIncrRefCounter(item->data.V); \
-        } else if (item->type == PS_TYPE_##TYPE) { \
+        } else if (item->type == PS_DATA_##TYPE) { \
             psVector *vector = psVectorAlloc(1, PS_TYPE_##TYPE); \
             vector->data.TYPE[0] = item->data.TYPE; \
Index: /branches/eam_branches/ipp-20120601/psModules/src/detrend/pmNonLinear.c
===================================================================
--- /branches/eam_branches/ipp-20120601/psModules/src/detrend/pmNonLinear.c	(revision 34051)
+++ /branches/eam_branches/ipp-20120601/psModules/src/detrend/pmNonLinear.c	(revision 34052)
@@ -329,4 +329,6 @@
 
     bin = correction_fluxes->n - 1;
+    psTrace("psModules.nonlin",6,"NLMN: %f %d %f %f\n",flux,bin,correction_fluxes->data.F32[0],correction_fluxes->data.F32[bin]);
+    if (bin < 0) { /* warn? */ }
     if (flux < correction_fluxes->data.F32[0]) {
 	return(0.0);
@@ -357,4 +359,5 @@
     bin = correction_fluxes->n - 1;
     psTrace("psModules.nonlin",6,"NLMN: %f %d %f %f\n",flux,bin,correction_fluxes->data.F32[0],correction_fluxes->data.F32[bin]);
+    if (bin < 0) { /* warn? */ }
     if (flux < correction_fluxes->data.F32[0]) {
 	return(0.0);
Index: /branches/eam_branches/ipp-20120601/psModules/src/extras/psPipe.c
===================================================================
--- /branches/eam_branches/ipp-20120601/psModules/src/extras/psPipe.c	(revision 34051)
+++ /branches/eam_branches/ipp-20120601/psModules/src/extras/psPipe.c	(revision 34052)
@@ -105,5 +105,5 @@
 
         status = execvp (argv[0], argv);
-        psWarning ("error running exec for child process");
+        if (status < 0) { psWarning ("error running exec for child process"); }
         exit (1); // this statement exits the child, not the parent, process
     }
Index: /branches/eam_branches/ipp-20120601/psModules/src/objects/models/pmModel_PGAUSS.c
===================================================================
--- /branches/eam_branches/ipp-20120601/psModules/src/objects/models/pmModel_PGAUSS.c	(revision 34051)
+++ /branches/eam_branches/ipp-20120601/psModules/src/objects/models/pmModel_PGAUSS.c	(revision 34052)
@@ -261,5 +261,4 @@
 {
     psF64 z;
-    int Nstep = 0;
     psEllipseShape shape;
 
@@ -285,5 +284,4 @@
     // use the fact that f is monotonically decreasing
     z = 0;
-    Nstep = 0;
 
     // choose a z value guaranteed to be beyond our limit
Index: /branches/eam_branches/ipp-20120601/psModules/src/objects/models/pmModel_PS1_V1.c
===================================================================
--- /branches/eam_branches/ipp-20120601/psModules/src/objects/models/pmModel_PS1_V1.c	(revision 34051)
+++ /branches/eam_branches/ipp-20120601/psModules/src/objects/models/pmModel_PS1_V1.c	(revision 34052)
@@ -283,5 +283,4 @@
 {
     psF64 z;
-    int Nstep = 0;
     psEllipseShape shape;
 
@@ -308,5 +307,4 @@
     // use the fact that f is monotonically decreasing
     z = 0;
-    Nstep = 0;
 
     // choose a z value guaranteed to be beyond our limit
Index: /branches/eam_branches/ipp-20120601/psModules/src/objects/models/pmModel_QGAUSS.c
===================================================================
--- /branches/eam_branches/ipp-20120601/psModules/src/objects/models/pmModel_QGAUSS.c	(revision 34051)
+++ /branches/eam_branches/ipp-20120601/psModules/src/objects/models/pmModel_QGAUSS.c	(revision 34052)
@@ -284,5 +284,4 @@
 {
     psF64 z;
-    int Nstep = 0;
     psEllipseShape shape;
 
@@ -312,5 +311,4 @@
     // use the fact that f is monotonically decreasing
     z = 0;
-    Nstep = 0;
 
     // choose a z value guaranteed to be beyond our limit
Index: /branches/eam_branches/ipp-20120601/psModules/src/objects/models/pmModel_RGAUSS.c
===================================================================
--- /branches/eam_branches/ipp-20120601/psModules/src/objects/models/pmModel_RGAUSS.c	(revision 34051)
+++ /branches/eam_branches/ipp-20120601/psModules/src/objects/models/pmModel_RGAUSS.c	(revision 34052)
@@ -273,5 +273,4 @@
 {
     psF64 z;
-    int Nstep = 0;
     psEllipseShape shape;
 
@@ -296,5 +295,4 @@
     // use the fact that f is monotonically decreasing
     z = 0;
-    Nstep = 0;
 
     // choose a z value guaranteed to be beyond our limit
Index: /branches/eam_branches/ipp-20120601/psModules/src/objects/pmSourceIO_CMP.c
===================================================================
--- /branches/eam_branches/ipp-20120601/psModules/src/objects/pmSourceIO_CMP.c	(revision 34051)
+++ /branches/eam_branches/ipp-20120601/psModules/src/objects/pmSourceIO_CMP.c	(revision 34052)
@@ -184,8 +184,8 @@
     }
 
-    // find config information for output header
-    float ZERO_POINT = psMetadataLookupF32 (&status, header, "ZERO_PT");
-    if (!status)
-        ZERO_POINT = 25.0;
+    // XXX unused // find config information for output header
+    // XXX unused float ZERO_POINT = psMetadataLookupF32 (&status, header, "ZERO_PT");
+    // XXX unused if (!status)
+    // XXX unused     ZERO_POINT = 25.0;
 
     // how many lines in the header?
Index: /branches/eam_branches/ipp-20120601/psModules/test/tap/src/tap.c
===================================================================
--- /branches/eam_branches/ipp-20120601/psModules/test/tap/src/tap.c	(revision 34051)
+++ /branches/eam_branches/ipp-20120601/psModules/test/tap/src/tap.c	(revision 34052)
@@ -87,5 +87,6 @@
     if(test_name != NULL) {
         va_start(ap, test_name);
-        vasprintf(&local_test_name, test_name, ap);
+        int status = vasprintf(&local_test_name, test_name, ap);
+	if (status) {/* warning? */}
         va_end(ap);
 
@@ -303,5 +304,6 @@
 
     va_start(ap, fmt);
-    asprintf(&skip_msg, fmt, ap);
+    int status = asprintf(&skip_msg, fmt, ap);
+    if (status) {/* warning? */}
     va_end(ap);
 
@@ -328,5 +330,6 @@
 
     va_start(ap, fmt);
-    vasprintf(&todo_msg, fmt, ap);
+    int status = vasprintf(&todo_msg, fmt, ap);
+    if (status) {/* warning? */}
     va_end(ap);
 
Index: /branches/eam_branches/ipp-20120601/pswarp/src/pswarpExit.c
===================================================================
--- /branches/eam_branches/ipp-20120601/pswarp/src/pswarpExit.c	(revision 34051)
+++ /branches/eam_branches/ipp-20120601/pswarp/src/pswarpExit.c	(revision 34052)
@@ -19,5 +19,4 @@
         return exitValue;
     }
-
 
     // gcc -Wswitch complains here if err is declared as type psErrorCode
