Index: /trunk/psLib/src/math/psStats.c
===================================================================
--- /trunk/psLib/src/math/psStats.c	(revision 12457)
+++ /trunk/psLib/src/math/psStats.c	(revision 12458)
@@ -13,6 +13,6 @@
  * use ->min and ->max (PS_STAT_USE_RANGE)
  *
- *  @version $Revision: 1.202 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2007-03-14 02:43:47 $
+ *  @version $Revision: 1.203 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2007-03-16 00:33:55 $
  *
  *  Copyright 2006 IfA, University of Hawaii
@@ -69,5 +69,8 @@
 // set the bin closest to the corresponding value.  if USE_END is +/- 1, 
 // out-of-range saturates on lower/upper bin REGARDLESS of actual value
-#define PS_BIN_FOR_VALUE(RESULT, VECTOR, VALUE, USE_END) \
+#define PS_BIN_FOR_VALUE(RESULT, VECTOR, VALUE, USE_END) { \
+       	psVectorBinaryDisectResult result; \
+       	psScalar tmpScalar; \
+       	tmpScalar.type.type = PS_TYPE_F32; \
 	tmpScalar.data.F32 = (VALUE); \
 	RESULT = psVectorBinaryDisect (&result, VECTOR, &tmpScalar); \
@@ -84,5 +87,5 @@
 	    psAbort ("programming error"); \
 	    break; \
-        }
+        } }
 
 # define PS_BIN_INTERPOLATE(RESULT, VECTOR, BOUNDS, BIN, VALUE) { \
@@ -626,8 +629,4 @@
     }
 
-    psVectorBinaryDisectResult result;
-    psScalar tmpScalar;                 // Temporary scalar variable, for psVectorBinaryDisect
-    tmpScalar.type.type = PS_TYPE_F32;
-
     // we need to generate an internal mask and maskVal which ensures a bit is set
     // and tested even if there is no supplied mask (and/or the maskVal is 0)
@@ -920,6 +919,4 @@
     float guessMean = stats->robustMedian;  // pass the guess mean
 
-    psVectorBinaryDisectResult result;
-
     psTrace("psLib.math", 6, "The guess mean  is %f.\n", guessMean);
     psTrace("psLib.math", 6, "The guess stdev is %f.\n", guessStdev);
@@ -928,7 +925,4 @@
     for (int iteration = 0; !done && (iteration < 2); iteration ++) {
         psStats *statsMinMax = psStatsAlloc(PS_STAT_MIN | PS_STAT_MAX); // Statistics for min and max
-
-        psScalar tmpScalar;                 // Temporary scalar variable, for psVectorBinaryDisect
-        tmpScalar.type.type = PS_TYPE_F32;
 
         psF32 binSize = 1;
@@ -1103,5 +1097,4 @@
     float guessMean = stats->robustMedian;  // pass the guess mean
 
-    psVectorBinaryDisectResult result;
     psTrace("psLib.math", 6, "The ** starting ** guess mean  is %f.\n", guessMean);
     psTrace("psLib.math", 6, "The ** starting ** guess stdev is %f.\n", guessStdev);
@@ -1110,7 +1103,4 @@
     for (int iteration = 0; !done && (iteration < 2); iteration ++) {
         psStats *statsMinMax = psStatsAlloc(PS_STAT_MIN | PS_STAT_MAX); // Statistics for min and max
-
-        psScalar tmpScalar;                 // Temporary scalar variable, for psVectorBinaryDisect
-        tmpScalar.type.type = PS_TYPE_F32;
 
         psF32 binSize = 1;
@@ -1299,5 +1289,4 @@
     float guessMean = stats->robustMedian;  // pass the guess mean
 
-    psVectorBinaryDisectResult result;
     psTrace("psLib.math", 6, "The ** starting ** guess mean  is %f.\n", guessMean);
     psTrace("psLib.math", 6, "The ** starting ** guess stdev is %f.\n", guessStdev);
@@ -1306,7 +1295,4 @@
     for (int iteration = 0; !done && (iteration < 2); iteration ++) {
         psStats *statsMinMax = psStatsAlloc(PS_STAT_MIN | PS_STAT_MAX); // Statistics for min and max
-
-        psScalar tmpScalar;                 // Temporary scalar variable, for psVectorBinaryDisect
-        tmpScalar.type.type = PS_TYPE_F32;
 
         psF32 binSize = 1;
