Index: /branches/jch-memory/psLib/src/sys/psMemory.c
===================================================================
--- /branches/jch-memory/psLib/src/sys/psMemory.c	(revision 10894)
+++ /branches/jch-memory/psLib/src/sys/psMemory.c	(revision 10895)
@@ -8,6 +8,6 @@
 *  @author Robert Lupton, Princeton University
 *
-*  @version $Revision: 1.88.2.7 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2007-01-03 22:04:42 $
+*  @version $Revision: 1.88.2.8 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2007-01-03 22:07:23 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -69,5 +69,5 @@
 fprintf(stderr, "\n");
 
-static psS32 checkMemBlock(const psMemBlock* m, const char *funcName);
+static bool badMemBlock(const psMemBlock* m, const char *funcName);
 static psMemBlock* lastMemBlockAllocated = NULL;
 static pthread_mutex_t memBlockListMutex = PTHREAD_MUTEX_INITIALIZER;
@@ -137,6 +137,6 @@
  * N.b. If the block wasn't allocated by psAlloc, it will appear corrupted
  */
-static psS32 checkMemBlock(const psMemBlock* m,
-                           const char *funcName)
+static bool badMemBlock(const psMemBlock* m,
+                        const char *funcName)
 {
     // n.b. since this is called by psMemCheckCorruption while the memblock list is mutex locked,
@@ -146,5 +146,5 @@
         PS_MEM_ERROR(PS_ERR_MEMORY_CORRUPTION, true,
                      _("NULL memory block found."));
-        return 1;
+        return true;
     }
 
@@ -154,5 +154,5 @@
                      _("Memory block %lu was freed but still being used."),
                      (unsigned long)m->id);
-        return 1;
+        return true;
     }
 
@@ -161,5 +161,5 @@
                      _("Memory block %lu is corrupted; buffer underflow detected."),
                      (unsigned long)m->id);
-        return 1;
+        return true;
     }
     if (*(psPtr *)((int8_t *) (m + 1) + m->userMemorySize) != P_PS_MEMMAGIC) {
@@ -167,8 +167,8 @@
                      _("Memory block %lu is corrupted; buffer overflow detected."),
                      (unsigned long)m->id);
-        return 1;
-    }
-
-    return 0;
+        return true;
+    }
+
+    return false;
 }
 
@@ -303,5 +303,4 @@
 {
     psS32 nbad = 0;               // number of bad blocks
-    psBool failure = false;
 
     // get exclusive access to the memBlock list to avoid it changing on us
@@ -310,5 +309,5 @@
 
     for (psMemBlock* iter = lastMemBlockAllocated; iter != NULL; iter = iter->nextBlock) {
-        if (checkMemBlock(iter, __func__)) {
+        if (badMemBlock(iter, __func__)) {
             nbad++;
 
@@ -413,5 +412,5 @@
     psMemBlock *ptr = ((psMemBlock*)vptr) - 1;
 
-    if (checkMemBlock(ptr, __func__) != 0) {
+    if (badMemBlock(ptr, __func__) != 0) {
         memProblemCallback(ptr, file, lineno);
         PS_MEM_ABORT(file, "Realloc detected a memory corruption (id %lu @ %s:%d).",
@@ -477,5 +476,5 @@
     }
 
-    if (checkMemBlock(ptr, __func__) != 0) {
+    if (badMemBlock(ptr, __func__) != 0) {
         memProblemCallback(ptr, filename, lineno);
         PS_MEM_ABORT(__func__,"Memory Corruption Detected.");
@@ -558,5 +557,5 @@
     ptr2 = ((psMemBlock* ) ptr) - 1;
 
-    if (checkMemBlock(ptr2, __func__) != 0) {
+    if (badMemBlock(ptr2, __func__) != 0) {
         memProblemCallback(ptr2, __func__, __LINE__);
     }
@@ -582,5 +581,5 @@
     ptr = ((psMemBlock* ) vptr) - 1;
 
-    if (checkMemBlock(ptr, __func__)) {
+    if (badMemBlock(ptr, __func__)) {
         memProblemCallback(ptr, file, lineno);
     }
@@ -615,5 +614,5 @@
     ptr = ((psMemBlock* ) vptr) - 1;
 
-    if (checkMemBlock(ptr, __func__)) {
+    if (badMemBlock(ptr, __func__)) {
         memProblemCallback(ptr, file, lineno);
     }
@@ -641,5 +640,5 @@
     psMemBlock* ptr = ((psMemBlock* ) vptr) - 1;
 
-    if (checkMemBlock(ptr, __func__) != 0) {
+    if (badMemBlock(ptr, __func__) != 0) {
         memProblemCallback(ptr, file, lineno);
         return NULL;
@@ -694,5 +693,5 @@
     psMemBlock* PTR = ((psMemBlock* ) ptr) - 1;
 
-    if (checkMemBlock(PTR, __func__) != 0) {
+    if (badMemBlock(PTR, __func__) != 0) {
         memProblemCallback(PTR, __func__, __LINE__);
     }
@@ -710,5 +709,5 @@
     psMemBlock* PTR = ((psMemBlock* ) ptr) - 1;
 
-    if (checkMemBlock(PTR, __func__) != 0) {
+    if (badMemBlock(PTR, __func__) != 0) {
         memProblemCallback(PTR, __func__, __LINE__);
     }
@@ -1006,5 +1005,5 @@
     psMemBlock* ptr = ((psMemBlock* ) vptr) - 1;
 
-    if (checkMemBlock(ptr, __func__) != 0) {
+    if (badMemBlock(ptr, __func__) != 0) {
         memProblemCallback(ptr, __func__, __LINE__);
     }
@@ -1022,5 +1021,5 @@
     psMemBlock* ptr = ((psMemBlock* ) vptr) - 1;
 
-    if (checkMemBlock(ptr, __func__) != 0) {
+    if (badMemBlock(ptr, __func__) != 0) {
         memProblemCallback(ptr, __func__, __LINE__);
     }
