Index: /trunk/psLib/src/mathtypes/psImage.c
===================================================================
--- /trunk/psLib/src/mathtypes/psImage.c	(revision 15453)
+++ /trunk/psLib/src/mathtypes/psImage.c	(revision 15454)
@@ -9,6 +9,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.130 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2007-09-20 23:48:30 $
+ *  @version $Revision: 1.131 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2007-11-05 23:42:46 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -44,24 +44,24 @@
     // if I am a child, remove me from my parent's array of children
     if (parent != NULL) {
-	// sanity check : a child cannot also be a parent
-	if ((image->children != NULL) && (image->children->n > 0)) {
-	    psAbort ("psImage cannot be both child and parent!");
-	}
-
-	// break the back-pointer first so we don't loop
-        image->parent = NULL; 
-
-	// drop my entry on my parent's array of children
-	psArrayRemoveDataNoFree (parent->children, image); 
-	
-	// drop my reference to my parent
-	psFree (parent);
-    }
-    
+        // sanity check : a child cannot also be a parent
+        if ((image->children != NULL) && (image->children->n > 0)) {
+            psAbort ("psImage cannot be both child and parent!");
+        }
+
+        // break the back-pointer first so we don't loop
+        image->parent = NULL;
+
+        // drop my entry on my parent's array of children
+        psArrayRemoveDataNoFree (parent->children, image);
+
+        // drop my reference to my parent
+        psFree (parent);
+    }
+
     // sanity check: this function should never be reached if an image still has live children;
     // they should each be holding a pointer to the image, forcing the number of references to
     // be > 1.
     if (image->children && (image->children->n > 0)) {
-	psAbort ("psImage memory management programming error : imageFree called on image with live children");
+        psAbort ("psImage memory management programming error : imageFree called on image with live children");
     }
 
@@ -100,7 +100,7 @@
     psMemSetDeallocator(image, (psFreeFunc) imageFree);
 
-    image->data.V = psAlloc(sizeof(psPtr ) * numRows);
-
-    image->p_rawDataBuffer = psAlloc(numBytes);
+    image->data.V = p_psAlloc(file, lineno, func, sizeof(psPtr ) * numRows);
+
+    image->p_rawDataBuffer = p_psAlloc(file, lineno, func, numBytes);
 
     // set the row pointers.
Index: /trunk/psLib/src/types/psArray.c
===================================================================
--- /trunk/psLib/src/types/psArray.c	(revision 15453)
+++ /trunk/psLib/src/types/psArray.c	(revision 15454)
@@ -9,6 +9,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.64 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2007-09-29 22:18:09 $
+ *  @version $Revision: 1.65 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2007-11-05 23:42:46 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -139,11 +139,10 @@
 }
 
-psArray* psArrayAdd(psArray* array,
-                    long delta,
-                    psPtr data)
+psArray* p_psArrayAdd(const char *file, unsigned int lineno, const char *func,
+                      psArray* array, long delta, psPtr data)
 {
     if (array == NULL) {
         long d = (delta > 0) ? delta : DEFAULT_ARRAY_ADD;
-        array = psArrayAlloc(d);
+        array = p_psArrayAlloc(file, lineno, func, d);
         array->n = 0;
     }
@@ -154,5 +153,5 @@
         // array needs to be expanded to make room for more elements
         long d = (delta > 0) ? delta : DEFAULT_ARRAY_ADD;
-        array = psArrayRealloc(array, n+d);
+        array = p_psArrayRealloc(file, lineno, func, array, n+d);
     }
 
@@ -187,9 +186,9 @@
 }
 
-// drop an item from the array and do not free it: this 
+// drop an item from the array and do not free it: this
 // can be useful in the free function of a data type
 // with a reference on another structure
 bool psArrayRemoveDataNoFree(psArray* array,
-			     const psPtr data)
+                             const psPtr data)
 {
     PS_ASSERT_ARRAY_NON_NULL(array, false);
@@ -268,10 +267,10 @@
     while (1) {
         if (I > 0) {
-	    // I--;
+            // I--;
             temp = index[--I];
         } else {
             temp = index[J];
             index[J] = index[0];
-	    // J--;
+            // J--;
             if (--J == 0) {
                 index[0] = temp;
@@ -282,11 +281,11 @@
         long j = (I << 1) + 1;
         while (j <= J) {
-	    if (j < J) {
-		result = func (in->data[index[j]], in->data[index[j+1]]);
-		if (result < 0) {
-		    j++;
-		}
-	    }
-	    result = func (in->data[temp], in->data[index[j]]);
+            if (j < J) {
+                result = func (in->data[index[j]], in->data[index[j+1]]);
+                if (result < 0) {
+                    j++;
+                }
+            }
+            result = func (in->data[temp], in->data[index[j]]);
             if (result < 0) {
                 index[i]=index[j];
Index: /trunk/psLib/src/types/psArray.h
===================================================================
--- /trunk/psLib/src/types/psArray.h	(revision 15453)
+++ /trunk/psLib/src/types/psArray.h	(revision 15454)
@@ -10,6 +10,6 @@
  *  @author Joshua Hoblitt, University of Hawaii
  *
- *  @version $Revision: 1.51 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2007-09-28 21:03:24 $
+ *  @version $Revision: 1.52 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2007-11-05 23:42:46 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -139,11 +139,31 @@
  *  necessary.
  *
+ *  If delta < 1, then 10 is used.
+ *
  *  @return psArray*        The array with the element added
  */
 psArray* psArrayAdd(
     psArray* array,                    ///< array to operate on
-    long delta,                        ///< the amount to expand array, if necessary.  If less than one, 10 will be used.
+    long delta,                        ///< the amount to expand array, if necessary.
     psPtr data                         ///< the data pointer to add to psArray
 );
+#ifdef DOXYGEN
+psArray* psArrayAdd(
+    psArray* array,                    ///< array to operate on
+    long delta,                        ///< the amount to expand array, if necessary.
+    psPtr data                         ///< the data pointer to add to psArray
+);
+#else // ifdef DOXYGEN
+psArray* p_psArrayAdd(
+    const char *file,                   ///< File of caller
+    unsigned int lineno,                ///< Line number of caller
+    const char *func,                   ///< Function name of caller
+    psArray* array,                     ///< array to operate on
+    long delta,                         ///< the amount to expand array, if necessary.
+    psPtr data                          ///< the data pointer to add to psArray
+) PS_ATTR_MALLOC;
+#define psArrayAdd(array, delta, data) \
+      p_psArrayAdd(__FILE__, __LINE__, __func__, array, delta, data)
+#endif // ifdef DOXYGEN
 
 
