Index: /trunk/psLib/src/imageops/psImageStats.c
===================================================================
--- /trunk/psLib/src/imageops/psImageStats.c	(revision 11758)
+++ /trunk/psLib/src/imageops/psImageStats.c	(revision 11759)
@@ -9,6 +9,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.103 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2007-01-09 22:38:52 $
+ *  @version $Revision: 1.104 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2007-02-13 03:01:23 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -44,11 +44,11 @@
 order to do so, we create dummy psVectors and set their "data" pointer to that
 of the input psImages.
- 
+
 XXX: use static psVectors
- 
+
 XXX: optimize this.  2k vs 4k, sample mean, takes8 seconds on Gene's machine.
 Should take .2.
  *****************************************************************************/
-psStats* psImageStats(psStats* stats,
+bool psImageStats(psStats* stats,
                       const psImage* in,
                       const psImage* mask,
@@ -58,10 +58,10 @@
     psVector *junkMask = NULL;
 
-    PS_ASSERT_PTR_NON_NULL(stats, NULL);
-    PS_ASSERT_INT_NONZERO(stats->options, NULL);
-    PS_ASSERT_IMAGE_NON_NULL(in, NULL)
+    PS_ASSERT_PTR_NON_NULL(stats, false);
+    PS_ASSERT_INT_NONZERO(stats->options, false);
+    PS_ASSERT_IMAGE_NON_NULL(in, false)
     if (mask != NULL) {
-        PS_ASSERT_IMAGE_TYPE(mask, PS_TYPE_U8, NULL);
-        PS_ASSERT_IMAGES_SIZE_EQUAL(in, mask, NULL);
+        PS_ASSERT_IMAGE_TYPE(mask, PS_TYPE_U8, false);
+        PS_ASSERT_IMAGES_SIZE_EQUAL(in, mask, false);
     }
 
@@ -116,5 +116,5 @@
     psFree(junkMask);
     psFree(junkData);
-    return(stats);
+    return true;
 }
 
@@ -123,14 +123,14 @@
 and initialized.
  *****************************************************************************/
-psHistogram* psImageHistogram(psHistogram* out,
+bool psImageHistogram(psHistogram* out,
                               const psImage* in,
                               const psImage* mask,
                               psMaskType maskVal)
 {
-    PS_ASSERT_PTR_NON_NULL(out, NULL);
-    PS_ASSERT_PTR_NON_NULL(in, NULL);
+    PS_ASSERT_PTR_NON_NULL(out, false);
+    PS_ASSERT_PTR_NON_NULL(in, false);
     if (mask != NULL) {
-        PS_ASSERT_IMAGE_TYPE(mask, PS_TYPE_U8, NULL);
-        PS_ASSERT_IMAGES_SIZE_EQUAL(in, mask, NULL);
+        PS_ASSERT_IMAGE_TYPE(mask, PS_TYPE_U8, false);
+        PS_ASSERT_IMAGES_SIZE_EQUAL(in, mask, false);
     }
     psVector* junkData = NULL;
@@ -188,5 +188,5 @@
     psFree(junkData);
 
-    return (out);
+    return true;
 }
 
@@ -197,8 +197,8 @@
 0:512 to -1:1.  This routine takes as input an integer N and produces as
 output a vector of evenly spaced floating point values between -1.0:1.0.
- 
+
 XXX: Use the p_psNormalizeVector here?
  *****************************************************************************/
-double* calcScaleFactors(psS32 n)
+static double* calcScaleFactors(psS32 n)
 {
     PS_ASSERT_INT_NONNEGATIVE(n, NULL);
@@ -235,9 +235,9 @@
         over all pixels (x,y) in the image.
   *****************************************************************************/
-psPolynomial2D* psImageFitPolynomial(psPolynomial2D* coeffs,
+bool psImageFitPolynomial(psPolynomial2D* coeffs,
                                      const psImage* input)
 {
-    PS_ASSERT_IMAGE_NON_NULL(input, NULL);
-    PS_ASSERT_IMAGE_NON_EMPTY(input, NULL);
+    PS_ASSERT_IMAGE_NON_NULL(input, false);
+    PS_ASSERT_IMAGE_NON_EMPTY(input, false);
     if ((input->type.type != PS_TYPE_S8) &&
             (input->type.type != PS_TYPE_U16) &&
@@ -245,7 +245,8 @@
             (input->type.type != PS_TYPE_F64)) {
         psError(PS_ERR_BAD_PARAMETER_TYPE, true, "Unallowable image type.\n");
-    }
-    PS_ASSERT_POLY_NON_NULL(coeffs, NULL);
-    PS_ASSERT_POLY_TYPE(coeffs, PS_POLYNOMIAL_CHEB, NULL);
+        return false;
+    }
+    PS_ASSERT_POLY_NON_NULL(coeffs, false);
+    PS_ASSERT_POLY_TYPE(coeffs, PS_POLYNOMIAL_CHEB, false);
     psS32 x = 0;
     psS32 y = 0;
@@ -338,5 +339,5 @@
     psFree(rScalingFactors);
 
-    return (coeffs);
+    return true;
 }
 
Index: /trunk/psLib/src/imageops/psImageStats.h
===================================================================
--- /trunk/psLib/src/imageops/psImageStats.h	(revision 11758)
+++ /trunk/psLib/src/imageops/psImageStats.h	(revision 11759)
@@ -9,6 +9,6 @@
  * @author GLG, MHPCC
  *
- * @version $Revision: 1.30 $ $Name: not supported by cvs2svn $
- * @date $Date: 2007-01-23 22:47:23 $
+ * @version $Revision: 1.31 $ $Name: not supported by cvs2svn $
+ * @date $Date: 2007-02-13 03:01:23 $
  * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
  */
@@ -36,7 +36,7 @@
  *  psF64.
  *
- *  @return psStats*    the resulting statistics result(s)
+ *  @return bool   Successful operation?
  */
-psStats* psImageStats(
+bool psImageStats(
     psStats* stats,                    ///< defines statistics to be calculated
     const psImage* in,                 ///< image (or subimage) to calculate stats
@@ -51,7 +51,7 @@
  *  psS8, psU16, psF32, psF64.
  *
- *  @return psHistogram*     the resulting histogram
+ *  @return bool   Successful operation?
  */
-psHistogram* psImageHistogram(
+bool psImageHistogram(
     psHistogram* out,                  ///< input histogram description & target
     const psImage* in,                 ///< Image data to be histogramed.
@@ -66,8 +66,8 @@
  *  psU16, psF32, psF64.
  *
- *  @return psPolynomial2D*     fitted polynomial result
+ *  @return bool   Successful operation?
  *
  */
-psPolynomial2D* psImageFitPolynomial(
+bool psImageFitPolynomial(
     psPolynomial2D* coeffs,            ///< coefficient structure carries in desired terms & target
     const psImage* input               ///< input image
Index: /trunk/psLib/src/math/psHistogram.c
===================================================================
--- /trunk/psLib/src/math/psHistogram.c	(revision 11758)
+++ /trunk/psLib/src/math/psHistogram.c	(revision 11759)
@@ -5,6 +5,6 @@
  *  @author GLG (MHPCC), EAM (IfA)
  *
- *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2007-02-07 01:15:49 $
+ *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2007-02-13 03:01:24 $
  *
  *  Copyright 2006 IfA, University of Hawaii
@@ -46,5 +46,5 @@
 with the specifed upper and lower limits, and the specifed number of bins.
 This routine will also set the bounds for each of the bins.
- 
+
 Input:
     lower
@@ -92,5 +92,5 @@
 psHistogramAllocGeneric(bounds): allocate a non-uniform histogram structure
 with the specifed bounds.
- 
+
 Input:
     bounds
@@ -144,5 +144,5 @@
 histogram bin which contains the point.  The width of that boxcar is defined
 as 2.35 * error.
- 
+
 XXX: Must test this.
  *****************************************************************************/
@@ -218,5 +218,5 @@
 in that histogram structure in accordance with the input data "in" and the,
 possibly NULL, mask vector.
- 
+
 Inputs:
     out
@@ -227,5 +227,5 @@
     The histogram structure "out".
  *****************************************************************************/
-psHistogram* psVectorHistogram(psHistogram* out,
+bool psVectorHistogram(psHistogram* out,
                                const psVector* values,
                                const psVector* errors,
@@ -234,19 +234,19 @@
 {
     psTrace("psLib.math", 3, "---- %s() begin  ----\n", __func__);
-    PS_ASSERT_PTR_NON_NULL(out, NULL);
-    PS_ASSERT_VECTOR_NON_NULL(out->bounds, NULL);
-    PS_ASSERT_VECTOR_TYPE(out->bounds, PS_TYPE_F32, NULL);
-    PS_ASSERT_INT_NONNEGATIVE(out->bounds->n, NULL);
-    PS_ASSERT_VECTOR_NON_NULL(out->nums, NULL);
-    PS_ASSERT_VECTOR_TYPE(out->nums, PS_TYPE_F32, NULL);
-    PS_ASSERT_INT_NONNEGATIVE(out->nums->n, NULL);
+    PS_ASSERT_PTR_NON_NULL(out, false);
+    PS_ASSERT_VECTOR_NON_NULL(out->bounds, false);
+    PS_ASSERT_VECTOR_TYPE(out->bounds, PS_TYPE_F32, false);
+    PS_ASSERT_INT_NONNEGATIVE(out->bounds->n, false);
+    PS_ASSERT_VECTOR_NON_NULL(out->nums, false);
+    PS_ASSERT_VECTOR_TYPE(out->nums, PS_TYPE_F32, false);
+    PS_ASSERT_INT_NONNEGATIVE(out->nums->n, false);
     PS_ASSERT_VECTOR_NON_NULL(values, out);
     if (mask) {
-        PS_ASSERT_VECTORS_SIZE_EQUAL(values, mask, NULL);
-        PS_ASSERT_VECTOR_TYPE(mask, PS_TYPE_U8, NULL);
+        PS_ASSERT_VECTORS_SIZE_EQUAL(values, mask, false);
+        PS_ASSERT_VECTOR_TYPE(mask, PS_TYPE_U8, false);
     }
     if (errors) {
-        PS_ASSERT_VECTORS_SIZE_EQUAL(values, errors, NULL);
-        PS_ASSERT_VECTOR_TYPE(errors, values->type.type, NULL);
+        PS_ASSERT_VECTORS_SIZE_EQUAL(values, errors, false);
+        PS_ASSERT_VECTOR_TYPE(errors, values->type.type, false);
     }
 
@@ -329,5 +329,5 @@
 
     psTrace("psLib.math", 3, "---- %s() end  ----\n", __func__);
-    return (out);
-}
-
+    return true;
+}
+
Index: /trunk/psLib/src/math/psHistogram.h
===================================================================
--- /trunk/psLib/src/math/psHistogram.h	(revision 11758)
+++ /trunk/psLib/src/math/psHistogram.h	(revision 11759)
@@ -7,6 +7,6 @@
  * @author GLG, MHPCC
  *
- * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
- * @date $Date: 2007-01-23 22:47:23 $
+ * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
+ * @date $Date: 2007-02-13 03:01:24 $
  *
  * Copyright 2004-2005 IfA, University of Hawaii
@@ -81,7 +81,7 @@
  *  vector may be of types psU8, psU16, psF32, psF64.
  *
- *  @return psHistogram*   histogram result
+ *  @return bool   Successful operation?
  */
-psHistogram* psVectorHistogram(
+bool psVectorHistogram(
     psHistogram* out,                  ///< Histogram data
     const psVector* values,            ///< Vector to analyse
Index: /trunk/psLib/src/types/psBitSet.c
===================================================================
--- /trunk/psLib/src/types/psBitSet.c	(revision 11758)
+++ /trunk/psLib/src/types/psBitSet.c	(revision 11759)
@@ -11,6 +11,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.40 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2007-02-08 21:33:57 $
+ *  @version $Revision: 1.41 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2007-02-13 03:01:24 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -105,5 +105,5 @@
 
 
-psBitSet* psBitSetSet(psBitSet* bitSet,
+bool psBitSetSet(psBitSet* bitSet,
                       long bit)
 {
@@ -113,5 +113,5 @@
         psError(PS_ERR_BAD_PARAMETER_NULL, true,
                 _("Can not operate on a NULL psBitSet."));
-        return bitSet;
+        return false;
     } else if ( (bit < 0) ||
                 (bit > bitSet->n * 8 - 1) ) {
@@ -119,5 +119,5 @@
                 _("The specified bit position (%ld) is invalid.  Position must be between 0 and %ld."),
                 bit, bitSet->n * 8 - 1);
-        return bitSet;
+        return false;
     }
     // Variable byte is the byte in the array that contains the bit to be set
@@ -125,8 +125,8 @@
     *byte |= mask(bit);
 
-    return bitSet;
-}
-
-psBitSet* psBitSetClear(psBitSet* bitSet,
+    return true;
+}
+
+bool psBitSetClear(psBitSet* bitSet,
                         long bit)
 {
@@ -136,5 +136,5 @@
         psError(PS_ERR_BAD_PARAMETER_NULL, true,
                 _("Can not operate on a NULL psBitSet."));
-        return bitSet;
+        return false;
     } else if ( (bit < 0) ||
                 (bit > bitSet->n * 8 - 1) ) {
@@ -142,5 +142,5 @@
                 _("The specified bit position (%ld) is invalid.  Position must be between 0 and %ld."),
                 bit, bitSet->n * 8 - 1);
-        return bitSet;
+        return false;
     }
     // Variable byte is the byte in the array that contains the bit to be set
@@ -148,5 +148,5 @@
     *byte &= ! mask(bit);
 
-    return bitSet;
+    return true;
 }
 
Index: /trunk/psLib/src/types/psBitSet.h
===================================================================
--- /trunk/psLib/src/types/psBitSet.h	(revision 11758)
+++ /trunk/psLib/src/types/psBitSet.h	(revision 11759)
@@ -11,6 +11,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.29 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2007-02-08 21:33:57 $
+ *  @version $Revision: 1.30 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2007-02-13 03:01:24 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -91,7 +91,7 @@
  *  result in an psBitSet that looks like 00000000 00001000.
  *
- *  @return  psBitSet* : Pointer to struct containing psBitSet.
+ *  @return  bool : Successful operation?
  */
-psBitSet* psBitSetSet(
+bool psBitSetSet(
     psBitSet* bitSet,                  ///< Pointer to psBitSet to be set.
     long bit                           ///< Bit to be set.
@@ -105,7 +105,7 @@
  *  the byte array.
  *
- *  @return  psBitSet* : Pointer to struct containing psBitSet.
+ *  @return  bool : Successful operation?
  */
-psBitSet* psBitSetClear(
+bool psBitSetClear(
     psBitSet* bitSet,                  ///< Pointer to psBitSet to be cleared.
     long bit                           ///< Bit to be cleared.
