Index: /trunk/psLib/src/astro/psCoord.c
===================================================================
--- /trunk/psLib/src/astro/psCoord.c	(revision 2211)
+++ /trunk/psLib/src/astro/psCoord.c	(revision 2212)
@@ -10,6 +10,6 @@
 *  @author George Gusciora, MHPCC
 *
-*  @version $Revision: 1.30 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-10-27 01:15:47 $
+*  @version $Revision: 1.31 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-10-27 20:07:17 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -81,6 +81,6 @@
                                const psPlane* coords)
 {
-    PS_CHECK_NULL_PTR(transform, NULL);
-    PS_CHECK_NULL_PTR(coords, NULL);
+    PS_PTR_CHECK_NULL(transform, NULL);
+    PS_PTR_CHECK_NULL(coords, NULL);
     if (out == NULL) {
         out = (psPlane* ) psAlloc(sizeof(psPlane));
@@ -117,6 +117,6 @@
                              float magnitude)
 {
-    PS_CHECK_NULL_PTR(transform, NULL);
-    PS_CHECK_NULL_PTR(coords, NULL);
+    PS_PTR_CHECK_NULL(transform, NULL);
+    PS_PTR_CHECK_NULL(coords, NULL);
     if (out == NULL) {
         out = (psPlane* ) psAlloc(sizeof(psPlane));
@@ -156,6 +156,6 @@
                                  const psSphere* coord)
 {
-    PS_CHECK_NULL_PTR(transform, NULL);
-    PS_CHECK_NULL_PTR(coord, NULL);
+    PS_PTR_CHECK_NULL(transform, NULL);
+    PS_PTR_CHECK_NULL(coord, NULL);
     double sinY = 0.0;
     double cosY = 0.0;
@@ -228,6 +228,6 @@
                    const psProjection* projection)
 {
-    PS_CHECK_NULL_PTR(coord, NULL);
-    PS_CHECK_NULL_PTR(projection, NULL);
+    PS_PTR_CHECK_NULL(coord, NULL);
+    PS_PTR_CHECK_NULL(projection, NULL);
 
     float R = 0.0;
@@ -280,6 +280,6 @@
                       const psProjection* projection)
 {
-    PS_CHECK_NULL_PTR(coord, NULL);
-    PS_CHECK_NULL_PTR(projection, NULL);
+    PS_PTR_CHECK_NULL(coord, NULL);
+    PS_PTR_CHECK_NULL(projection, NULL);
 
     float R = 0.0;
@@ -348,6 +348,6 @@
                             psSphereOffsetUnit unit)
 {
-    PS_CHECK_NULL_PTR(position1, NULL);
-    PS_CHECK_NULL_PTR(position2, NULL);
+    PS_PTR_CHECK_NULL(position1, NULL);
+    PS_PTR_CHECK_NULL(position2, NULL);
 
     psPlane* lin;
@@ -416,6 +416,6 @@
                             psSphereOffsetUnit unit)
 {
-    PS_CHECK_NULL_PTR(position, NULL);
-    PS_CHECK_NULL_PTR(offset, NULL);
+    PS_PTR_CHECK_NULL(position, NULL);
+    PS_PTR_CHECK_NULL(offset, NULL);
 
     psPlane lin;
Index: /trunk/psLib/src/astronomy/psAstrometry.c
===================================================================
--- /trunk/psLib/src/astronomy/psAstrometry.c	(revision 2211)
+++ /trunk/psLib/src/astronomy/psAstrometry.c	(revision 2212)
@@ -8,6 +8,6 @@
  *  @author George Gusciora, MHPCC
  *
- *  @version $Revision: 1.45 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-10-27 19:58:54 $
+ *  @version $Revision: 1.46 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-10-27 20:07:17 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -59,5 +59,5 @@
 {
     int i = 0;
-    PS_CHECK_NULL_PTR(transform, 0);
+    PS_PTR_CHECK_NULL(transform, 0);
 
     for (i=2;i<(transform->x->nX);i++) {
@@ -114,5 +114,5 @@
     double F = transform->y->coeff[0][1];
 
-    PS_CHECK_NULL_PTR(transform, NULL);
+    PS_PTR_CHECK_NULL(transform, NULL);
     psPlaneTransform *out = psAlloc(sizeof(psPlaneTransform));
 
@@ -286,5 +286,5 @@
                             const psObservatory* observatory)
 {
-    PS_CHECK_NULL_PTR(observatory, NULL);
+    PS_PTR_CHECK_NULL(observatory, NULL);
     psExposure* exp = psAlloc(sizeof(psExposure));
 
@@ -463,5 +463,5 @@
 psGrommit* psGrommitAlloc(const psExposure* exp)
 {
-    PS_CHECK_NULL_PTR(exp, NULL);
+    PS_PTR_CHECK_NULL(exp, NULL);
 
     double date = psTimeToMJD(exp->time);
@@ -493,6 +493,6 @@
                     const psFPA* FPA)
 {
-    PS_CHECK_NULL_PTR(fpaCoord, NULL);
-    PS_CHECK_NULL_PTR(FPA, NULL);
+    PS_PTR_CHECK_NULL(fpaCoord, NULL);
+    PS_PTR_CHECK_NULL(FPA, NULL);
     psChip* tmpChip = NULL;
     psPlane chipCoord;
@@ -517,7 +517,7 @@
                     const psFPA* FPA)
 {
-    PS_CHECK_NULL_PTR(fpaCoord, NULL);
-    PS_CHECK_NULL_PTR(FPA, NULL);
-    PS_CHECK_NULL_PTR(FPA->chips, NULL);
+    PS_PTR_CHECK_NULL(fpaCoord, NULL);
+    PS_PTR_CHECK_NULL(FPA, NULL);
+    PS_PTR_CHECK_NULL(FPA->chips, NULL);
     psArray* chips = FPA->chips;
     psS32 nChips = chips->n;
@@ -545,6 +545,6 @@
                      const psChip* chip)
 {
-    PS_CHECK_NULL_PTR(chipCoord, NULL);
-    PS_CHECK_NULL_PTR(chip, NULL);
+    PS_PTR_CHECK_NULL(chipCoord, NULL);
+    PS_PTR_CHECK_NULL(chip, NULL);
 
     psPlane cellCoord;
@@ -588,6 +588,6 @@
                            const psCell* cell)
 {
-    PS_CHECK_NULL_PTR(inCoord, NULL);
-    PS_CHECK_NULL_PTR(cell, NULL);
+    PS_PTR_CHECK_NULL(inCoord, NULL);
+    PS_PTR_CHECK_NULL(cell, NULL);
 
     return (psPlaneTransformApply(outCoord, cell->toChip, inCoord));
@@ -598,6 +598,6 @@
                           const psChip* chip)
 {
-    PS_CHECK_NULL_PTR(inCoord, NULL);
-    PS_CHECK_NULL_PTR(chip, NULL);
+    PS_PTR_CHECK_NULL(inCoord, NULL);
+    PS_PTR_CHECK_NULL(chip, NULL);
 
     return (psPlaneTransformApply(outCoord, chip->toFPA, inCoord));
@@ -610,6 +610,6 @@
                         const psFPA* fpa)
 {
-    PS_CHECK_NULL_PTR(inCoord, NULL);
-    PS_CHECK_NULL_PTR(fpa, NULL);
+    PS_PTR_CHECK_NULL(inCoord, NULL);
+    PS_PTR_CHECK_NULL(fpa, NULL);
 
     return(psPlaneDistortApply(outCoord, fpa->toTangentPlane, inCoord,
@@ -624,6 +624,6 @@
                          const psGrommit* grommit)
 {
-    PS_CHECK_NULL_PTR(tpCoord, NULL);
-    PS_CHECK_NULL_PTR(grommit, NULL);
+    PS_PTR_CHECK_NULL(tpCoord, NULL);
+    PS_PTR_CHECK_NULL(grommit, NULL);
 
     double AOB = 0.0;
@@ -644,6 +644,6 @@
                           const psCell* cell)
 {
-    PS_CHECK_NULL_PTR(cellCoord, NULL);
-    PS_CHECK_NULL_PTR(cell, NULL);
+    PS_PTR_CHECK_NULL(cellCoord, NULL);
+    PS_PTR_CHECK_NULL(cell, NULL);
 
     return (psPlaneTransformApply(fpaCoord, cell->toFPA, cellCoord));
@@ -656,6 +656,6 @@
                            const psCell* cell)
 {
-    PS_CHECK_NULL_PTR(cellCoord, NULL);
-    PS_CHECK_NULL_PTR(cell, NULL);
+    PS_PTR_CHECK_NULL(cellCoord, NULL);
+    PS_PTR_CHECK_NULL(cell, NULL);
 
     psPlane* fpaCoord = NULL;
@@ -688,6 +688,6 @@
                                 const psCell* cell)
 {
-    PS_CHECK_NULL_PTR(cellCoord, NULL);
-    PS_CHECK_NULL_PTR(cell, NULL);
+    PS_PTR_CHECK_NULL(cellCoord, NULL);
+    PS_PTR_CHECK_NULL(cell, NULL);
 
     psPlane *tpCoord = NULL;
@@ -724,6 +724,6 @@
                         const psGrommit* grommit)
 {
-    PS_CHECK_NULL_PTR(in, NULL);
-    PS_CHECK_NULL_PTR(grommit, NULL);
+    PS_PTR_CHECK_NULL(in, NULL);
+    PS_PTR_CHECK_NULL(grommit, NULL);
 
     char* type = "RA";
@@ -745,6 +745,6 @@
                         const psFPA* fpa)
 {
-    PS_CHECK_NULL_PTR(tpCoord, NULL);
-    PS_CHECK_NULL_PTR(fpa, NULL);
+    PS_PTR_CHECK_NULL(tpCoord, NULL);
+    PS_PTR_CHECK_NULL(fpa, NULL);
 
     return (psPlaneDistortApply(fpaCoord, fpa->fromTangentPlane,
@@ -756,7 +756,7 @@
                           const psChip* chip)
 {
-    PS_CHECK_NULL_PTR(fpaCoord, NULL);
-    PS_CHECK_NULL_PTR(chip, NULL);
-    PS_CHECK_NULL_PTR(chip->parent, NULL);
+    PS_PTR_CHECK_NULL(fpaCoord, NULL);
+    PS_PTR_CHECK_NULL(chip, NULL);
+    PS_PTR_CHECK_NULL(chip->parent, NULL);
 
     chipCoord = psPlaneTransformApply(chipCoord, chip->fromFPA, fpaCoord);
@@ -768,7 +768,7 @@
                            const psCell* cell)
 {
-    PS_CHECK_NULL_PTR(chipCoord, NULL);
-    PS_CHECK_NULL_PTR(cell, NULL);
-    PS_CHECK_NULL_PTR(cell->parent, NULL);
+    PS_PTR_CHECK_NULL(chipCoord, NULL);
+    PS_PTR_CHECK_NULL(cell, NULL);
+    PS_PTR_CHECK_NULL(cell->parent, NULL);
 
     cellCoord = psPlaneTransformApply(cellCoord, cell->fromChip, chipCoord);
@@ -782,6 +782,6 @@
                           const psCell* cell)
 {
-    PS_CHECK_NULL_PTR(skyCoord, NULL);
-    PS_CHECK_NULL_PTR(cell, NULL);
+    PS_PTR_CHECK_NULL(skyCoord, NULL);
+    PS_PTR_CHECK_NULL(cell, NULL);
 
     psChip *parChip = cell->parent;
@@ -813,6 +813,6 @@
                                const psCell* cell)
 {
-    PS_CHECK_NULL_PTR(skyCoord, NULL);
-    PS_CHECK_NULL_PTR(cell, NULL);
+    PS_PTR_CHECK_NULL(skyCoord, NULL);
+    PS_PTR_CHECK_NULL(cell, NULL);
 
     psPlane *tpCoord = NULL;
Index: /trunk/psLib/src/astronomy/psCoord.c
===================================================================
--- /trunk/psLib/src/astronomy/psCoord.c	(revision 2211)
+++ /trunk/psLib/src/astronomy/psCoord.c	(revision 2212)
@@ -10,6 +10,6 @@
 *  @author George Gusciora, MHPCC
 *
-*  @version $Revision: 1.30 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-10-27 01:15:47 $
+*  @version $Revision: 1.31 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-10-27 20:07:17 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -81,6 +81,6 @@
                                const psPlane* coords)
 {
-    PS_CHECK_NULL_PTR(transform, NULL);
-    PS_CHECK_NULL_PTR(coords, NULL);
+    PS_PTR_CHECK_NULL(transform, NULL);
+    PS_PTR_CHECK_NULL(coords, NULL);
     if (out == NULL) {
         out = (psPlane* ) psAlloc(sizeof(psPlane));
@@ -117,6 +117,6 @@
                              float magnitude)
 {
-    PS_CHECK_NULL_PTR(transform, NULL);
-    PS_CHECK_NULL_PTR(coords, NULL);
+    PS_PTR_CHECK_NULL(transform, NULL);
+    PS_PTR_CHECK_NULL(coords, NULL);
     if (out == NULL) {
         out = (psPlane* ) psAlloc(sizeof(psPlane));
@@ -156,6 +156,6 @@
                                  const psSphere* coord)
 {
-    PS_CHECK_NULL_PTR(transform, NULL);
-    PS_CHECK_NULL_PTR(coord, NULL);
+    PS_PTR_CHECK_NULL(transform, NULL);
+    PS_PTR_CHECK_NULL(coord, NULL);
     double sinY = 0.0;
     double cosY = 0.0;
@@ -228,6 +228,6 @@
                    const psProjection* projection)
 {
-    PS_CHECK_NULL_PTR(coord, NULL);
-    PS_CHECK_NULL_PTR(projection, NULL);
+    PS_PTR_CHECK_NULL(coord, NULL);
+    PS_PTR_CHECK_NULL(projection, NULL);
 
     float R = 0.0;
@@ -280,6 +280,6 @@
                       const psProjection* projection)
 {
-    PS_CHECK_NULL_PTR(coord, NULL);
-    PS_CHECK_NULL_PTR(projection, NULL);
+    PS_PTR_CHECK_NULL(coord, NULL);
+    PS_PTR_CHECK_NULL(projection, NULL);
 
     float R = 0.0;
@@ -348,6 +348,6 @@
                             psSphereOffsetUnit unit)
 {
-    PS_CHECK_NULL_PTR(position1, NULL);
-    PS_CHECK_NULL_PTR(position2, NULL);
+    PS_PTR_CHECK_NULL(position1, NULL);
+    PS_PTR_CHECK_NULL(position2, NULL);
 
     psPlane* lin;
@@ -416,6 +416,6 @@
                             psSphereOffsetUnit unit)
 {
-    PS_CHECK_NULL_PTR(position, NULL);
-    PS_CHECK_NULL_PTR(offset, NULL);
+    PS_PTR_CHECK_NULL(position, NULL);
+    PS_PTR_CHECK_NULL(offset, NULL);
 
     psPlane lin;
Index: /trunk/psLib/src/dataManip/psConstants.h
===================================================================
--- /trunk/psLib/src/dataManip/psConstants.h	(revision 2211)
+++ /trunk/psLib/src/dataManip/psConstants.h	(revision 2212)
@@ -6,6 +6,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-10-27 19:58:54 $
+ *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-10-27 20:07:17 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -95,7 +95,8 @@
 
 /*****************************************************************************
- 
+Macros which take a generic psLib type and determine if it is NULL, or has
+the wrong type.
 *****************************************************************************/
-#define PS_CHECK_NULL_PTR(NAME, RVAL) \
+#define PS_PTR_CHECK_NULL(NAME, RVAL) \
 if (NAME == NULL) { \
     psError(__func__,"Unallowable operation: %s is NULL.", #NAME); \
@@ -103,8 +104,13 @@
 }
 
-/*****************************************************************************
- 
- *****************************************************************************/
-#define VECTOR_CHECK_TYPE_F32_OR_F64(VEC, RVAL) \
+#define PS_PTR_CHECK_TYPE(NAME, TYPE, RVAL) \
+if (NAME->type.type != TYPE) { \
+    psError(__func__,"Unallowable operation: %s has incorrect type.", #NAME); \
+    return(RVAL); \
+}
+/*****************************************************************************
+ 
+ *****************************************************************************/
+#define PS_VECTOR_CHECK_TYPE_F32_OR_F64(VEC, RVAL) \
 if ((VEC->type.type != PS_TYPE_F32) && (VEC->type.type != PS_TYPE_F64)) { \
     psAbort(__func__, "Bad type for VEC (%d)", VEC->type.type); \
Index: /trunk/psLib/src/dataManip/psMinimize.c
===================================================================
--- /trunk/psLib/src/dataManip/psMinimize.c	(revision 2211)
+++ /trunk/psLib/src/dataManip/psMinimize.c	(revision 2212)
@@ -9,6 +9,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.65 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-10-27 19:58:54 $
+ *  @version $Revision: 1.66 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-10-27 20:07:17 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -252,7 +252,7 @@
     static psVector *yErr32Static = NULL;
 
-    PS_CHECK_NULL_PTR(mySpline, NULL);
-    PS_CHECK_NULL_PTR(y, NULL);
-    VECTOR_CHECK_TYPE_F32_OR_F64(y, NULL);
+    PS_PTR_CHECK_NULL(mySpline, NULL);
+    PS_PTR_CHECK_NULL(y, NULL);
+    PS_VECTOR_CHECK_TYPE_F32_OR_F64(y, NULL);
     CONVERT_VECTOR_F64_TO_F32(y, y32, y32Static);
 
@@ -262,5 +262,5 @@
         yErr32 = yErr32Static;
     } else {
-        VECTOR_CHECK_TYPE_F32_OR_F64(yErr, NULL);
+        PS_VECTOR_CHECK_TYPE_F32_OR_F64(yErr, NULL);
         CONVERT_VECTOR_F64_TO_F32(yErr, yErr32, yErr32Static);
     }
@@ -271,5 +271,5 @@
         x32 = x32Static;
     } else {
-        VECTOR_CHECK_TYPE_F32_OR_F64(x, NULL);
+        PS_VECTOR_CHECK_TYPE_F32_OR_F64(x, NULL);
         CONVERT_VECTOR_F64_TO_F32(x, x32, x32Static);
     }
@@ -425,8 +425,8 @@
                         psMinimizeLMChi2Func func)
 {
-    PS_CHECK_NULL_PTR(min, NULL);
+    PS_PTR_CHECK_NULL(min, NULL);
     PS_CHECK_NULL_VECTOR(params, NULL);
     PS_CHECK_EMPTY_VECTOR(params, NULL);
-    PS_CHECK_NULL_PTR(x, NULL);
+    PS_PTR_CHECK_NULL(x, NULL);
     PS_CHECK_NULL_VECTOR(y, NULL);
     PS_CHECK_EMPTY_VECTOR(y, NULL);
@@ -865,5 +865,5 @@
     static psVector *yErr64Static = NULL;
 
-    VECTOR_CHECK_TYPE_F32_OR_F64(y, NULL);
+    PS_VECTOR_CHECK_TYPE_F32_OR_F64(y, NULL);
     CONVERT_VECTOR_F32_TO_F64(y, y64, y64Static);
 
@@ -873,5 +873,5 @@
         yErr64 = yErr64Static;
     } else {
-        VECTOR_CHECK_TYPE_F32_OR_F64(yErr, NULL);
+        PS_VECTOR_CHECK_TYPE_F32_OR_F64(yErr, NULL);
         CONVERT_VECTOR_F32_TO_F64(yErr, yErr64, yErr64Static);
     }
@@ -885,5 +885,5 @@
         x64 = x64Static;
     } else {
-        VECTOR_CHECK_TYPE_F32_OR_F64(x, NULL);
+        PS_VECTOR_CHECK_TYPE_F32_OR_F64(x, NULL);
         CONVERT_VECTOR_F32_TO_F64(x, x64, x64Static);
     }
@@ -1321,7 +1321,7 @@
     PS_CHECK_NULL_VECTOR(params, NULL);
     PS_CHECK_EMPTY_VECTOR(params, NULL);
-    PS_CHECK_NULL_PTR(min, NULL);
-    PS_CHECK_NULL_PTR(coords, NULL);
-    PS_CHECK_NULL_PTR(func, NULL);
+    PS_PTR_CHECK_NULL(min, NULL);
+    PS_PTR_CHECK_NULL(coords, NULL);
+    PS_PTR_CHECK_NULL(func, NULL);
 
     psS32 numDims = params->n;
Index: /trunk/psLib/src/dataManip/psStats.c
===================================================================
--- /trunk/psLib/src/dataManip/psStats.c	(revision 2211)
+++ /trunk/psLib/src/dataManip/psStats.c	(revision 2212)
@@ -9,6 +9,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.71 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-10-27 01:21:01 $
+ *  @version $Revision: 1.72 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-10-27 20:07:17 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -1733,5 +1733,5 @@
         return(stats);
     }
-    PS_CHECK_NULL_PTR(stats, NULL);
+    PS_PTR_CHECK_NULL(stats, NULL);
 
     inF32 = p_psConvertToF32((psVector *) in);
Index: /trunk/psLib/src/image/psImageStats.c
===================================================================
--- /trunk/psLib/src/image/psImageStats.c	(revision 2211)
+++ /trunk/psLib/src/image/psImageStats.c	(revision 2212)
@@ -9,6 +9,6 @@
 *  @author GLG, MHPCC
 *
-*  @version $Revision: 1.45 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-10-27 01:15:47 $
+*  @version $Revision: 1.46 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-10-27 20:07:17 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -112,6 +112,6 @@
 
     // NOTE: Verify this action.
-    PS_CHECK_NULL_PTR(out, NULL);
-    PS_CHECK_NULL_PTR(in, NULL);
+    PS_PTR_CHECK_NULL(out, NULL);
+    PS_PTR_CHECK_NULL(in, NULL);
 
     junkData = psAlloc(sizeof(psVector));
Index: /trunk/psLib/src/imageops/psImageStats.c
===================================================================
--- /trunk/psLib/src/imageops/psImageStats.c	(revision 2211)
+++ /trunk/psLib/src/imageops/psImageStats.c	(revision 2212)
@@ -9,6 +9,6 @@
 *  @author GLG, MHPCC
 *
-*  @version $Revision: 1.45 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-10-27 01:15:47 $
+*  @version $Revision: 1.46 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-10-27 20:07:17 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -112,6 +112,6 @@
 
     // NOTE: Verify this action.
-    PS_CHECK_NULL_PTR(out, NULL);
-    PS_CHECK_NULL_PTR(in, NULL);
+    PS_PTR_CHECK_NULL(out, NULL);
+    PS_PTR_CHECK_NULL(in, NULL);
 
     junkData = psAlloc(sizeof(psVector));
Index: /trunk/psLib/src/math/psConstants.h
===================================================================
--- /trunk/psLib/src/math/psConstants.h	(revision 2211)
+++ /trunk/psLib/src/math/psConstants.h	(revision 2212)
@@ -6,6 +6,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-10-27 19:58:54 $
+ *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-10-27 20:07:17 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -95,7 +95,8 @@
 
 /*****************************************************************************
- 
+Macros which take a generic psLib type and determine if it is NULL, or has
+the wrong type.
 *****************************************************************************/
-#define PS_CHECK_NULL_PTR(NAME, RVAL) \
+#define PS_PTR_CHECK_NULL(NAME, RVAL) \
 if (NAME == NULL) { \
     psError(__func__,"Unallowable operation: %s is NULL.", #NAME); \
@@ -103,8 +104,13 @@
 }
 
-/*****************************************************************************
- 
- *****************************************************************************/
-#define VECTOR_CHECK_TYPE_F32_OR_F64(VEC, RVAL) \
+#define PS_PTR_CHECK_TYPE(NAME, TYPE, RVAL) \
+if (NAME->type.type != TYPE) { \
+    psError(__func__,"Unallowable operation: %s has incorrect type.", #NAME); \
+    return(RVAL); \
+}
+/*****************************************************************************
+ 
+ *****************************************************************************/
+#define PS_VECTOR_CHECK_TYPE_F32_OR_F64(VEC, RVAL) \
 if ((VEC->type.type != PS_TYPE_F32) && (VEC->type.type != PS_TYPE_F64)) { \
     psAbort(__func__, "Bad type for VEC (%d)", VEC->type.type); \
Index: /trunk/psLib/src/math/psMinimize.c
===================================================================
--- /trunk/psLib/src/math/psMinimize.c	(revision 2211)
+++ /trunk/psLib/src/math/psMinimize.c	(revision 2212)
@@ -9,6 +9,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.65 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-10-27 19:58:54 $
+ *  @version $Revision: 1.66 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-10-27 20:07:17 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -252,7 +252,7 @@
     static psVector *yErr32Static = NULL;
 
-    PS_CHECK_NULL_PTR(mySpline, NULL);
-    PS_CHECK_NULL_PTR(y, NULL);
-    VECTOR_CHECK_TYPE_F32_OR_F64(y, NULL);
+    PS_PTR_CHECK_NULL(mySpline, NULL);
+    PS_PTR_CHECK_NULL(y, NULL);
+    PS_VECTOR_CHECK_TYPE_F32_OR_F64(y, NULL);
     CONVERT_VECTOR_F64_TO_F32(y, y32, y32Static);
 
@@ -262,5 +262,5 @@
         yErr32 = yErr32Static;
     } else {
-        VECTOR_CHECK_TYPE_F32_OR_F64(yErr, NULL);
+        PS_VECTOR_CHECK_TYPE_F32_OR_F64(yErr, NULL);
         CONVERT_VECTOR_F64_TO_F32(yErr, yErr32, yErr32Static);
     }
@@ -271,5 +271,5 @@
         x32 = x32Static;
     } else {
-        VECTOR_CHECK_TYPE_F32_OR_F64(x, NULL);
+        PS_VECTOR_CHECK_TYPE_F32_OR_F64(x, NULL);
         CONVERT_VECTOR_F64_TO_F32(x, x32, x32Static);
     }
@@ -425,8 +425,8 @@
                         psMinimizeLMChi2Func func)
 {
-    PS_CHECK_NULL_PTR(min, NULL);
+    PS_PTR_CHECK_NULL(min, NULL);
     PS_CHECK_NULL_VECTOR(params, NULL);
     PS_CHECK_EMPTY_VECTOR(params, NULL);
-    PS_CHECK_NULL_PTR(x, NULL);
+    PS_PTR_CHECK_NULL(x, NULL);
     PS_CHECK_NULL_VECTOR(y, NULL);
     PS_CHECK_EMPTY_VECTOR(y, NULL);
@@ -865,5 +865,5 @@
     static psVector *yErr64Static = NULL;
 
-    VECTOR_CHECK_TYPE_F32_OR_F64(y, NULL);
+    PS_VECTOR_CHECK_TYPE_F32_OR_F64(y, NULL);
     CONVERT_VECTOR_F32_TO_F64(y, y64, y64Static);
 
@@ -873,5 +873,5 @@
         yErr64 = yErr64Static;
     } else {
-        VECTOR_CHECK_TYPE_F32_OR_F64(yErr, NULL);
+        PS_VECTOR_CHECK_TYPE_F32_OR_F64(yErr, NULL);
         CONVERT_VECTOR_F32_TO_F64(yErr, yErr64, yErr64Static);
     }
@@ -885,5 +885,5 @@
         x64 = x64Static;
     } else {
-        VECTOR_CHECK_TYPE_F32_OR_F64(x, NULL);
+        PS_VECTOR_CHECK_TYPE_F32_OR_F64(x, NULL);
         CONVERT_VECTOR_F32_TO_F64(x, x64, x64Static);
     }
@@ -1321,7 +1321,7 @@
     PS_CHECK_NULL_VECTOR(params, NULL);
     PS_CHECK_EMPTY_VECTOR(params, NULL);
-    PS_CHECK_NULL_PTR(min, NULL);
-    PS_CHECK_NULL_PTR(coords, NULL);
-    PS_CHECK_NULL_PTR(func, NULL);
+    PS_PTR_CHECK_NULL(min, NULL);
+    PS_PTR_CHECK_NULL(coords, NULL);
+    PS_PTR_CHECK_NULL(func, NULL);
 
     psS32 numDims = params->n;
Index: /trunk/psLib/src/math/psStats.c
===================================================================
--- /trunk/psLib/src/math/psStats.c	(revision 2211)
+++ /trunk/psLib/src/math/psStats.c	(revision 2212)
@@ -9,6 +9,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.71 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-10-27 01:21:01 $
+ *  @version $Revision: 1.72 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-10-27 20:07:17 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -1733,5 +1733,5 @@
         return(stats);
     }
-    PS_CHECK_NULL_PTR(stats, NULL);
+    PS_PTR_CHECK_NULL(stats, NULL);
 
     inF32 = p_psConvertToF32((psVector *) in);
