Index: trunk/psLib/src/astro/psCoord.c
===================================================================
--- trunk/psLib/src/astro/psCoord.c	(revision 2083)
+++ trunk/psLib/src/astro/psCoord.c	(revision 2103)
@@ -10,6 +10,6 @@
 *  @author George Gusciora, MHPCC
 *
-*  @version $Revision: 1.23 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-10-13 21:06:07 $
+*  @version $Revision: 1.24 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-10-14 01:10:58 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -96,4 +96,6 @@
                                const psPlane* coords)
 {
+    PS_CHECK_NULL_PTR_RETURN_NULL(transform);
+    PS_CHECK_NULL_PTR_RETURN_NULL(coords);
     if (out == NULL) {
         out = (psPlane* ) psAlloc(sizeof(psPlane));
@@ -114,4 +116,6 @@
                              float magnitude)
 {
+    PS_CHECK_NULL_PTR_RETURN_NULL(transform);
+    PS_CHECK_NULL_PTR_RETURN_NULL(coords);
     if (out == NULL) {
         out = (psPlane* ) psAlloc(sizeof(psPlane));
@@ -151,4 +155,6 @@
                                  const psSphere* coord)
 {
+    PS_CHECK_NULL_PTR_RETURN_NULL(transform);
+    PS_CHECK_NULL_PTR_RETURN_NULL(coord);
     double sinY = 0.0;
     double cosY = 0.0;
@@ -216,8 +222,12 @@
 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,
                    const psProjection* projection)
 {
+    PS_CHECK_NULL_PTR_RETURN_NULL(coord);
+    PS_CHECK_NULL_PTR_RETURN_NULL(projection);
+
     float R = 0.0;
     float alpha = 0.0;
@@ -254,4 +264,6 @@
     } else if (projection->type == PS_PROJ_GLS) {
         psAbort(__func__, "The projection type PS_PROJ_GLS is undefined.\n");
+    } else {
+        psAbort(__func__, "Unknown projection type.\n");
     }
 
@@ -262,8 +274,12 @@
 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,
                       const psProjection* projection)
 {
+    PS_CHECK_NULL_PTR_RETURN_NULL(coord);
+    PS_CHECK_NULL_PTR_RETURN_NULL(projection);
+
     float R = 0.0;
     float chu = 0.0;
@@ -304,4 +320,6 @@
     } else if (projection->type == PS_PROJ_GLS) {
         psAbort(__func__, "The projection type PS_PROJ_GLG is undefined.\n");
+    } else {
+        psAbort(__func__, "Unknown projection type.\n");
     }
 
@@ -329,4 +347,7 @@
                             psSphereOffsetUnit unit)
 {
+    PS_CHECK_NULL_PTR_RETURN_NULL(position1);
+    PS_CHECK_NULL_PTR_RETURN_NULL(position2);
+
     psPlane* lin;
     psProjection proj;
@@ -351,5 +372,5 @@
         tmp->d = position2->d - position1->d;
 
-        // XXX: Wrap these to an acceptable range.  This assumes that all
+        // Wrap these to an acceptable range.  This assumes that all
         // angles are in radians.
         tmp->r = fmod(tmp->r, 2*M_PI);
@@ -394,4 +415,7 @@
                             psSphereOffsetUnit unit)
 {
+    PS_CHECK_NULL_PTR_RETURN_NULL(position);
+    PS_CHECK_NULL_PTR_RETURN_NULL(offset);
+
     psPlane lin;
     psSphere* tmp;
