Index: trunk/psLib/src/astro/psCoord.c
===================================================================
--- trunk/psLib/src/astro/psCoord.c	(revision 2212)
+++ trunk/psLib/src/astro/psCoord.c	(revision 2221)
@@ -10,6 +10,6 @@
 *  @author George Gusciora, MHPCC
 *
-*  @version $Revision: 1.31 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-10-27 20:07:17 $
+*  @version $Revision: 1.32 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-10-27 23:31:43 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -24,5 +24,4 @@
 #include "psCoord.h"
 #include "psMemory.h"
-#include "psAbort.h"
 #include "psTime.h"
 #include "psConstants.h"
@@ -69,4 +68,7 @@
 psPlaneTransform* psPlaneTransformAlloc(psS32 n1, psS32 n2)
 {
+    PS_INT_CHECK_NON_NEGATIVE(n1, NULL);
+    PS_INT_CHECK_NON_NEGATIVE(n2, NULL);
+
     psPlaneTransform *pt = psAlloc(sizeof(psPlaneTransform));
     pt->x = psDPolynomial2DAlloc(n1, n2, PS_POLYNOMIAL_ORD);
@@ -82,5 +84,8 @@
 {
     PS_PTR_CHECK_NULL(transform, NULL);
+    PS_PTR_CHECK_NULL(transform->x, NULL);
+    PS_PTR_CHECK_NULL(transform->y, NULL);
     PS_PTR_CHECK_NULL(coords, NULL);
+
     if (out == NULL) {
         out = (psPlane* ) psAlloc(sizeof(psPlane));
@@ -99,4 +104,9 @@
 psPlaneDistort* psPlaneDistortAlloc(psS32 n1, psS32 n2, psS32 n3, psS32 n4)
 {
+    PS_INT_CHECK_NON_NEGATIVE(n1, NULL);
+    PS_INT_CHECK_NON_NEGATIVE(n2, NULL);
+    PS_INT_CHECK_NON_NEGATIVE(n3, NULL);
+    PS_INT_CHECK_NON_NEGATIVE(n4, NULL);
+
     psPlaneDistort *pt = psAlloc(sizeof(psPlaneDistort));
     pt->x = psDPolynomial4DAlloc(n1, n2, n3, n4, PS_POLYNOMIAL_ORD);
@@ -118,5 +128,8 @@
 {
     PS_PTR_CHECK_NULL(transform, NULL);
+    PS_PTR_CHECK_NULL(transform->x, NULL);
+    PS_PTR_CHECK_NULL(transform->y, NULL);
     PS_PTR_CHECK_NULL(coords, NULL);
+
     if (out == NULL) {
         out = (psPlane* ) psAlloc(sizeof(psPlane));
@@ -158,4 +171,5 @@
     PS_PTR_CHECK_NULL(transform, NULL);
     PS_PTR_CHECK_NULL(coord, NULL);
+
     double sinY = 0.0;
     double cosY = 0.0;
@@ -186,4 +200,6 @@
 psSphereTransform* psSphereTransformICRSToEcliptic(psTime time)
 {
+    PS_PTR_CHECK_NULL(&time, NULL);
+
     struct tm *tmTime = psTimeToTM(&time);
     double year = (double)(1900 + tmTime->tm_year);
@@ -199,4 +215,6 @@
 psSphereTransform* psSphereTransformEclipticToICRS(psTime time)
 {
+    PS_PTR_CHECK_NULL(&time, NULL);
+
     struct tm *tmTime = psTimeToTM(&time);
     double year = (double)(1900 + tmTime->tm_year);
@@ -223,5 +241,4 @@
 XXX: Waiting for the definition of the PS_PROJ_PAR projection.
 XXX: Waiting for the definition of the PS_PROJ_GLS projection.
-XXX: get rid of the psAborts
  *****************************************************************************/
 psPlane* psProject(const psSphere* coord,
@@ -261,10 +278,10 @@
 
     } else if (projection->type == PS_PROJ_PAR) {
-        psAbort(__func__, "The projection type PS_PROJ_PAR is undefined.\n");
+        psError(__func__, "The projection type PS_PROJ_PAR is undefined.\n");
 
     } else if (projection->type == PS_PROJ_GLS) {
-        psAbort(__func__, "The projection type PS_PROJ_GLS is undefined.\n");
+        psError(__func__, "The projection type PS_PROJ_GLS is undefined.\n");
     } else {
-        psAbort(__func__, "Unknown projection type.\n");
+        psError(__func__, "Unknown projection type.\n");
     }
 
@@ -275,5 +292,4 @@
 XXX: Waiting for the definition of the PS_PROJ_PAR projection.
 XXX: Waiting for the definition of the PS_PROJ_GLS projection.
-XXX: get rid of the psAborts
  *****************************************************************************/
 psSphere* psDeproject(const psPlane* coord,
@@ -317,10 +333,10 @@
 
     } else if (projection->type == PS_PROJ_PAR) {
-        psAbort(__func__, "The projection type PS_PROJ_PAR is undefined.\n");
+        psError(__func__, "The projection type PS_PROJ_PAR is undefined.\n");
 
     } else if (projection->type == PS_PROJ_GLS) {
-        psAbort(__func__, "The projection type PS_PROJ_GLG is undefined.\n");
+        psError(__func__, "The projection type PS_PROJ_GLG is undefined.\n");
     } else {
-        psAbort(__func__, "Unknown projection type.\n");
+        psError(__func__, "Unknown projection type.\n");
     }
 
@@ -391,10 +407,11 @@
         } else if (unit == PS_RADIAN) {}
         else {
-            psAbort(__func__, "Unknown offset unit: 0x%x\n", unit);
+            psError(__func__, "Unknown offset unit: 0x%x\n", unit);
         }
 
         return (tmp);
     }
-    psAbort(__func__, "Unrecognized offset mode\n");
+
+    psError(__func__, "Unrecognized offset mode\n");
     return (NULL);
 }
@@ -452,5 +469,5 @@
             tmpD = offset->d;
         } else {
-            psAbort(__func__, "Unknown offset unit: 0x%x\n", unit);
+            psError(__func__, "Unknown offset unit: 0x%x\n", unit);
         }
 
@@ -465,5 +482,6 @@
         return (tmp);
     }
-    psAbort(__func__, "Unrecognized offset mode\n");
+
+    psError(__func__, "Unrecognized offset mode\n");
     return (NULL);
 }
