Index: trunk/psLib/src/math/psStats.c
===================================================================
--- trunk/psLib/src/math/psStats.c	(revision 13418)
+++ trunk/psLib/src/math/psStats.c	(revision 13494)
@@ -13,6 +13,6 @@
  * use ->min and ->max (PS_STAT_USE_RANGE)
  *
- *  @version $Revision: 1.210 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2007-05-18 13:19:55 $
+ *  @version $Revision: 1.211 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2007-05-24 02:06:51 $
  *
  *  Copyright 2006 IfA, University of Hawaii
@@ -259,10 +259,10 @@
     for (long i = 0; i < num; i++) {
         // Check if the data is with the specified range
-	if (!isfinite(vector[i])) {
-	    stats->max = stats->min = NAN;
-	    psError(PS_ERR_IEEE, true, "Element %ld of vector is Inf/NaN", i);
-	    return 0;
-	}
-	
+        if (!isfinite(vector[i])) {
+            stats->max = stats->min = NAN;
+            psError(PS_ERR_IEEE, true, "Element %ld of vector is Inf/NaN", i);
+            return 0;
+        }
+
         if (useRange && (vector[i] < stats->min))
             continue;
@@ -688,5 +688,5 @@
         }
         psTrace(TRACE, 6, "Data min/max is (%.2f, %.2f)\n", min, max);
-	assert (iterate < 20);
+        assert (iterate < 20);
         // fprintf (stderr, "%d @ %d : %f - %f\n", iterate, numValid, min, max);
 
@@ -1661,7 +1661,8 @@
 
 // We keep statsFree so that we can identify statistics pointers from the memblock
-static void statsFree(psStats *newStruct)
+static void statsFree(psStats *stats)
 {
     // There are non dynamic allocated items
+    return;
 }
 
@@ -1669,37 +1670,36 @@
     psStatsAlloc(): This routine must create a new psStats data structure.
 *****************************************************************************/
-psStats* psStatsAlloc(psStatsOptions options)
+psStats* p_psStatsAlloc(const char *file, unsigned int lineno, const char *func, psStatsOptions options)
 {
     psTrace(TRACE, 3,"---- %s() begin  ----\n", __func__);
-    psStats* newStruct = NULL;
-
-    newStruct = (psStats* ) psAlloc(sizeof(psStats));
-    psMemSetDeallocator(newStruct, (psFreeFunc)statsFree);
-    newStruct->sampleMean = NAN;
-    newStruct->sampleMedian = NAN;
-    newStruct->sampleStdev = NAN;
-    newStruct->sampleUQ = NAN;
-    newStruct->sampleLQ = NAN;
-    newStruct->robustMedian = NAN;
-    newStruct->robustStdev = NAN;
-    newStruct->robustUQ = NAN;
-    newStruct->robustLQ = NAN;
-    newStruct->robustN50 = -1;
-    newStruct->fittedMean = NAN;
-    newStruct->fittedStdev = NAN;
-    newStruct->fittedNfit = -1;
-    newStruct->clippedMean = NAN;
-    newStruct->clippedStdev = NAN;
-    newStruct->clippedNvalues = -1;     // XXX: This is never used
-    newStruct->clipSigma = 3.0;
-    newStruct->clipIter = 3;
-    newStruct->min = NAN;
-    newStruct->max = NAN;
-    newStruct->binsize = NAN;
-    newStruct->nSubsample = 100000;
-    newStruct->options = options;
+
+    psStats *stats = p_psAlloc(file, lineno, func, sizeof(psStats));
+    psMemSetDeallocator(stats, (psFreeFunc)statsFree);
+    stats->sampleMean = NAN;
+    stats->sampleMedian = NAN;
+    stats->sampleStdev = NAN;
+    stats->sampleUQ = NAN;
+    stats->sampleLQ = NAN;
+    stats->robustMedian = NAN;
+    stats->robustStdev = NAN;
+    stats->robustUQ = NAN;
+    stats->robustLQ = NAN;
+    stats->robustN50 = -1;
+    stats->fittedMean = NAN;
+    stats->fittedStdev = NAN;
+    stats->fittedNfit = -1;
+    stats->clippedMean = NAN;
+    stats->clippedStdev = NAN;
+    stats->clippedNvalues = -1;     // XXX: This is never used
+    stats->clipSigma = 3.0;
+    stats->clipIter = 3;
+    stats->min = NAN;
+    stats->max = NAN;
+    stats->binsize = NAN;
+    stats->nSubsample = 100000;
+    stats->options = options;
 
     psTrace(TRACE, 3, "---- %s() end  ----\n", __func__);
-    return (newStruct);
+    return stats;
 }
 
