Index: trunk/psLib/src/math/psHistogram.c
===================================================================
--- trunk/psLib/src/math/psHistogram.c	(revision 27448)
+++ trunk/psLib/src/math/psHistogram.c	(revision 27553)
@@ -58,6 +58,6 @@
     psTrace("psLib.math", 3, "---- %s() begin  ----\n", __func__);
     psTrace("psLib.math", 5, "(lower, upper, n) is (%f, %f, %d)\n", lower, upper, n);
-    PS_ASSERT_INT_POSITIVE(n, NULL);
-    PS_ASSERT_FLOAT_LARGER_THAN_OR_EQUAL(upper, lower, NULL);
+    psAssert(n > 0, "Number of bins must be positive");
+    psAssert(upper >= lower, "Bounds must be sensical");
 
     // Allocate memory for the new histogram structure.  If there are N bins, then there are N+1 bounds to
@@ -287,23 +287,23 @@
                     double binSize = (out->bounds->data.F32[out->nums->n] - out->bounds->data.F32[0]) / (float) out->nums->n; // Histogram bin size
                     binNum = (inF32->data.F32[i] - out->bounds->data.F32[0]) / binSize;
-		    binNum = PS_MAX (binNum, 0);
-		    binNum = PS_MIN (binNum, numBins - 1);
-
-		    // value is in bin 'i' if bound[i] <= value < bound[i]
-
-		    // we may slightly overshoot or undershoot.  creep up or down on the true bin
-		    if (inF32->data.F32[i] < out->bounds->data.F32[binNum]) {
-			psTrace("psLib.math", 6, "missed target bin, adjusting: %f vs %f to %f\n", inF32->data.F32[i], out->bounds->data.F32[binNum], out->bounds->data.F32[binNum+1]);
-			while ((inF32->data.F32[i] < out->bounds->data.F32[binNum]) && (binNum > 0)) {
-			    binNum --;
-			}
-			
-		    }
-		    if (inF32->data.F32[i] >= out->bounds->data.F32[binNum+1]) {
-			psTrace("psLib.math", 6, "missed target bin, adjusting: %f vs %f to %f\n", inF32->data.F32[i], out->bounds->data.F32[binNum], out->bounds->data.F32[binNum+1]);
-			while ((inF32->data.F32[i] >= out->bounds->data.F32[binNum+1]) && (binNum < numBins - 1)) {
-			    binNum ++;
-			}
-		    }
+                    binNum = PS_MAX (binNum, 0);
+                    binNum = PS_MIN (binNum, numBins - 1);
+
+                    // value is in bin 'i' if bound[i] <= value < bound[i]
+
+                    // we may slightly overshoot or undershoot.  creep up or down on the true bin
+                    if (inF32->data.F32[i] < out->bounds->data.F32[binNum]) {
+                        psTrace("psLib.math", 6, "missed target bin, adjusting: %f vs %f to %f\n", inF32->data.F32[i], out->bounds->data.F32[binNum], out->bounds->data.F32[binNum+1]);
+                        while ((inF32->data.F32[i] < out->bounds->data.F32[binNum]) && (binNum > 0)) {
+                            binNum --;
+                        }
+
+                    }
+                    if (inF32->data.F32[i] >= out->bounds->data.F32[binNum+1]) {
+                        psTrace("psLib.math", 6, "missed target bin, adjusting: %f vs %f to %f\n", inF32->data.F32[i], out->bounds->data.F32[binNum], out->bounds->data.F32[binNum+1]);
+                        while ((inF32->data.F32[i] >= out->bounds->data.F32[binNum+1]) && (binNum < numBins - 1)) {
+                            binNum ++;
+                        }
+                    }
 
                     if (errorsF32) {
@@ -326,17 +326,17 @@
                     // correct bin number requires a bit more work.
                     tmpScalar.data.F32 = inF32->data.F32[i];
-		    psVectorBinaryDisectResult result;
+                    psVectorBinaryDisectResult result;
                     binNum = psVectorBinaryDisect(&result, out->bounds, &tmpScalar);
-		    if (result != PS_BINARY_DISECT_PASS) {
-			continue;
-		    }
-		    if (errorsF32 != NULL) {
-			if (!UpdateHistogramBins(binNum, out, inF32->data.F32[i], errors->data.F32[i])) {
-			    psLogMsg(__func__, PS_LOG_WARN, "WARNING: Failed to update the histogram "
-				     "bins with the errors vector.\n");
-			}
-		    } else {
-			out->nums->data.F32[binNum] += 1.0;
-		    }
+                    if (result != PS_BINARY_DISECT_PASS) {
+                        continue;
+                    }
+                    if (errorsF32 != NULL) {
+                        if (!UpdateHistogramBins(binNum, out, inF32->data.F32[i], errors->data.F32[i])) {
+                            psLogMsg(__func__, PS_LOG_WARN, "WARNING: Failed to update the histogram "
+                                     "bins with the errors vector.\n");
+                        }
+                    } else {
+                        out->nums->data.F32[binNum] += 1.0;
+                    }
                 }
             }
