Index: trunk/psLib/src/math/psConstants.h
===================================================================
--- trunk/psLib/src/math/psConstants.h	(revision 2216)
+++ trunk/psLib/src/math/psConstants.h	(revision 2217)
@@ -6,6 +6,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.24 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-10-27 20:32:49 $
+ *  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-10-27 21:06:30 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -28,4 +28,15 @@
 
 /*****************************************************************************
+ 
+*****************************************************************************/
+#define PS_INT_CHECK_NON_NEGATIVE(NAME, RVAL) \
+if (NAME < 0) { \
+    psError(__func__,"%s is less than 0.", #NAME); \
+    return(RVAL); \
+}
+
+
+
+/*****************************************************************************
 Macros which take a generic psLib type and determine if it is NULL, or has
 the wrong type.
@@ -48,7 +59,19 @@
     PS_VECTOR macros:
  *****************************************************************************/
-#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); \
+#define PS_VECTOR_CHECK_NULL(NAME, RVAL) \
+if (NAME == NULL || NAME->data.V == NULL) { \
+    psError(__func__,"Unallowable operation: psVector %s or its data is NULL.", #NAME); \
+    return(RVAL); \
+} \
+
+#define PS_VECTOR_CHECK_EMPTY(NAME, RVAL) \
+if (NAME->n < 1) { \
+    psError(__func__,"Unallowable operation: psVector %s has no elements.", #NAME); \
+    return(RVAL); \
+} \
+
+#define PS_VECTOR_CHECK_TYPE_F32_OR_F64(NAME, RVAL) \
+if ((NAME->type.type != PS_TYPE_F32) && (NAME->type.type != PS_TYPE_F64)) { \
+    psAbort(__func__, "psVector %s: bad type(%d)", #NAME, NAME->type.type); \
     return(RVAL); \
 } \
@@ -56,23 +79,11 @@
 #define PS_VECTOR_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_NULL(NAME, RVAL) \
-if (NAME == NULL || NAME->data.V == NULL) { \
-    psError(__func__,"Unallowable operation: %s or its data is NULL.", #NAME); \
-    return(RVAL); \
-} \
-
-#define PS_VECTOR_CHECK_EMPTY(NAME, RVAL) \
-if (NAME->n < 1) { \
-    psError(__func__,"Unallowable operation: %s has zero n value.", #NAME); \
-    return(RVAL); \
-} \
+    psError(__func__,"Unallowable operation: psVector %s has incorrect type.", #NAME); \
+    return(RVAL); \
+}
 
 #define PS_VECTOR_CHECK_SIZE_EQUAL(VEC1, VEC2, RVAL) \
 if (VEC1->n != VEC2->n) { \
-    psError(__func__,"Vector %s has size %d, Vector %s has size %d.", #VEC1, VEC1->n, #VEC2, VEC2->n); \
+    psError(__func__,"psVector %s has size %d, psVector %s has size %d.", #VEC1, VEC1->n, #VEC2, VEC2->n); \
     return(RVAL); \
 }
@@ -166,8 +177,8 @@
     PS_POLY macros:
 *****************************************************************************/
-#define PS_POLY_CHECK_NULL(NAME, NULL) \
+#define PS_POLY_CHECK_NULL(NAME, RVAL) \
 if (NAME == NULL || NAME->coeff == NULL) { \
     psError(__func__,"Unallowable operation: polynomial %s or its coeffs is NULL.", #NAME); \
-    return(NULL); \
+    return(RVAL); \
 } \
 
