Index: trunk/psLib/test/image/tst_psImage.c
===================================================================
--- trunk/psLib/test/image/tst_psImage.c	(revision 2156)
+++ trunk/psLib/test/image/tst_psImage.c	(revision 2204)
@@ -6,6 +6,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.27 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-09-29 20:17:58 $
+ *  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-10-27 00:57:33 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -21,6 +21,6 @@
 #include "psType.h"
 
-static int testImageAlloc(void);
-static int testImageCopy(void);
+static psS32 testImageAlloc(void);
+static psS32 testImageCopy(void);
 
 testDescription tests[] = {
@@ -31,5 +31,5 @@
                           };
 
-int main(int argc, char* argv[])
+psS32 main(psS32 argc, char* argv[])
 {
     psLogSetLevel(PS_LOG_INFO);
@@ -38,15 +38,15 @@
 }
 
-int testImageAlloc(void)
+psS32 testImageAlloc(void)
 {
     psImage* image = NULL;
-    unsigned int sizes = 6;
-    unsigned int numCols[] = {
-                                 0,1,1,100,100,150
-                             };
-    unsigned int numRows[] = {
-                                 0,1,100,1,150,100
-                             };
-    unsigned int types = 13;
+    psU32 sizes = 6;
+    psU32 numCols[] = {
+                          0,1,1,100,100,150
+                      };
+    psU32 numRows[] = {
+                          0,1,100,1,150,100
+                      };
+    psU32 types = 13;
     psElemType type[] = { PS_TYPE_S8, PS_TYPE_S16, PS_TYPE_S32, PS_TYPE_S64,
                           PS_TYPE_U8, PS_TYPE_U16, PS_TYPE_U32, PS_TYPE_U64,
@@ -56,8 +56,8 @@
     psLogMsg(__func__,PS_LOG_INFO,"#546 - psImageAlloc shall allocate memory for a psImage structure");
 
-    for (unsigned int t=0;t<types;t++) {
+    for (psU32 t=0;t<types;t++) {
         psLogMsg(__func__,PS_LOG_INFO,"Testing psImage with type %xh",type[t]);
 
-        for (unsigned int i=0;i<sizes;i++) {
+        for (psU32 i=0;i<sizes;i++) {
 
             if (numRows[i] == 0 || numCols[i] == 0) {
@@ -112,14 +112,14 @@
             switch (type[t]) {
             case PS_TYPE_U16: {
-                    unsigned int rows = numRows[i];
-                    unsigned int cols = numCols[i];
-
-                    for (int r=0;r<rows;r++) {
-                        for (int c=0;c<cols;c++) {
+                    psU32 rows = numRows[i];
+                    psU32 cols = numCols[i];
+
+                    for (psS32 r=0;r<rows;r++) {
+                        for (psS32 c=0;c<cols;c++) {
                             image->data.U16[r][c] = 2*c+r;
                         }
                     }
-                    for (int r=0;r<rows;r++) {
-                        for (int c=0;c<cols;c++) {
+                    for (psS32 r=0;r<rows;r++) {
+                        for (psS32 c=0;c<cols;c++) {
                             if (image->data.U16[r][c] != 2*c+r) {
                                 psError(__func__,"Could not set all pixels in uint16 image at (%d,%d)",c,r);
@@ -132,14 +132,14 @@
                 break;
             case PS_TYPE_F32: {
-                    unsigned int rows = numRows[i];
-                    unsigned int cols = numCols[i];
-
-                    for (int r=0;r<rows;r++) {
-                        for (int c=0;c<cols;c++) {
+                    psU32 rows = numRows[i];
+                    psU32 cols = numCols[i];
+
+                    for (psS32 r=0;r<rows;r++) {
+                        for (psS32 c=0;c<cols;c++) {
                             image->data.F32[r][c] = 2.0f*c+r;
                         }
                     }
-                    for (int r=0;r<rows;r++) {
-                        for (int c=0;c<cols;c++) {
+                    for (psS32 r=0;r<rows;r++) {
+                        for (psS32 c=0;c<cols;c++) {
                             if (fabsf(image->data.F32[r][c] - (2.0f*c+r)) > FLT_EPSILON) {
                                 psError(__func__,"Could not set all pixels in float image at (%d,%d)",c,r);
@@ -152,14 +152,14 @@
                 break;
             case PS_TYPE_F64: {
-                    unsigned int rows = numRows[i];
-                    unsigned int cols = numCols[i];
-
-                    for (int r=0;r<rows;r++) {
-                        for (int c=0;c<cols;c++) {
+                    psU32 rows = numRows[i];
+                    psU32 cols = numCols[i];
+
+                    for (psS32 r=0;r<rows;r++) {
+                        for (psS32 c=0;c<cols;c++) {
                             image->data.F64[r][c] = 2.0f*c+r;
                         }
                     }
-                    for (int r=0;r<rows;r++) {
-                        for (int c=0;c<cols;c++) {
+                    for (psS32 r=0;r<rows;r++) {
+                        for (psS32 c=0;c<cols;c++) {
                             if (fabs(image->data.F64[r][c] - (2.0f*c+r)) > DBL_EPSILON) {
                                 psError(__func__,"Could not set all pixels in double image at (%d,%d)",c,r);
@@ -172,14 +172,14 @@
                 break;
             case PS_TYPE_C32: {
-                    unsigned int rows = numRows[i];
-                    unsigned int cols = numCols[i];
-
-                    for (int r=0;r<rows;r++) {
-                        for (int c=0;c<cols;c++) {
+                    psU32 rows = numRows[i];
+                    psU32 cols = numCols[i];
+
+                    for (psS32 r=0;r<rows;r++) {
+                        for (psS32 c=0;c<cols;c++) {
                             image->data.C32[r][c] = r + I * c;
                         }
                     }
-                    for (int r=0;r<rows;r++) {
-                        for (int c=0;c<cols;c++) {
+                    for (psS32 r=0;r<rows;r++) {
+                        for (psS32 c=0;c<cols;c++) {
                             if (fabsf(crealf(image->data.C32[r][c]) - r) > FLT_EPSILON ||
                                     fabsf(cimagf(image->data.C32[r][c]) - c) > FLT_EPSILON ) {
@@ -193,15 +193,15 @@
                 break;
             case PS_TYPE_PTR: {
-                    unsigned int rows = numRows[i];
-                    unsigned int cols = numCols[i];
+                    psU32 rows = numRows[i];
+                    psU32 cols = numCols[i];
                     psImage* temp = psImageAlloc(1,1,PS_TYPE_F32);
 
-                    for (int r=0;r<rows;r++) {
-                        for (int c=0;c<cols;c++) {
+                    for (psS32 r=0;r<rows;r++) {
+                        for (psS32 c=0;c<cols;c++) {
                             image->data.PTR[r][c] = psMemIncrRefCounter(temp);
                         }
                     }
-                    for (int r=0;r<rows;r++) {
-                        for (int c=0;c<cols;c++) {
+                    for (psS32 r=0;r<rows;r++) {
+                        for (psS32 c=0;c<cols;c++) {
                             if (image->data.PTR[r][c] != temp) {
                                 psError(__func__, "Could not set pixel in pointer image at (%d,%d): %x %x",
@@ -218,14 +218,14 @@
             default: {
                     // ignore type and just use as byte bucket.
-                    unsigned int rows = numRows[i];
-                    unsigned int cols = numCols[i]*PSELEMTYPE_SIZEOF(type[t]);
-
-                    for (int r=0;r<rows;r++) {
-                        for (int c=0;c<cols;c++) {
+                    psU32 rows = numRows[i];
+                    psU32 cols = numCols[i]*PSELEMTYPE_SIZEOF(type[t]);
+
+                    for (psS32 r=0;r<rows;r++) {
+                        for (psS32 c=0;c<cols;c++) {
                             image->data.U8[r][c] = (uint8_t)(r + c);
                         }
                     }
-                    for (int r=0;r<rows;r++) {
-                        for (int c=0;c<cols;c++) {
+                    for (psS32 r=0;r<rows;r++) {
+                        for (psS32 c=0;c<cols;c++) {
                             if (image->data.U8[r][c] != (uint8_t)(r + c)) {
                                 psError(__func__,"Could not set all pixels in image (type=%d) at (%d,%d)",
@@ -253,5 +253,5 @@
 }
 
-int testImageCopy(void)
+psS32 testImageCopy(void)
 {
     psImage* img = NULL;
@@ -259,6 +259,6 @@
     psImage* img3 = NULL;
     psImage* img4 = NULL;
-    unsigned int c = 128;
-    unsigned int r = 256;
+    psU32 c = 128;
+    psU32 r = 256;
 
     img = psImageAlloc(c,r,PS_TYPE_F32);
@@ -296,5 +296,5 @@
         return 4;
     }
-    for (unsigned int row=0;row<r;row++) {
+    for (psU32 row=0;row<r;row++) {
         psF32* imgInRow = img->data.F32[row];
         psF32* imgOutRow = img4->data.F32[row];
@@ -324,8 +324,8 @@
         return 2; \
     } \
-    for (unsigned int row=0;row<r;row++) { \
+    for (psU32 row=0;row<r;row++) { \
         ps##IN* imgRow = img->data.IN[row]; \
         ps##OUT* img2Row = img2->data.OUT[row]; \
-        for (unsigned int col=0;col<c;col++) { \
+        for (psU32 col=0;col<c;col++) { \
             if (abs(imgRow[col] - (ps##IN)(row+col)) > 0.5) { \
                 psError(__func__,"Input image was changed at %d,%d!", \
Index: trunk/psLib/test/image/tst_psImageConvolve.c
===================================================================
--- trunk/psLib/test/image/tst_psImageConvolve.c	(revision 2156)
+++ trunk/psLib/test/image/tst_psImageConvolve.c	(revision 2204)
@@ -5,6 +5,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-10-13 01:22:38 $
+ *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-10-27 00:57:33 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -20,7 +20,7 @@
 #include "psType.h"
 
-static int testKernelAlloc(void);
-static int testKernelGenerate(void);
-//static int testImageConvolve(void);
+static psS32 testKernelAlloc(void);
+static psS32 testKernelGenerate(void);
+//static psS32 testImageConvolve(void);
 
 testDescription tests[] = {
@@ -31,5 +31,5 @@
                           };
 
-int main(int argc, char* argv[])
+psS32 main(psS32 argc, char* argv[])
 {
     psLogSetLevel(PS_LOG_INFO);
@@ -38,12 +38,12 @@
 }
 
-static int testKernelAlloc(void)
+static psS32 testKernelAlloc(void)
 {
-    int numCases = 4;
-    int xMin[] = { -5,  0,-10,  5};
-    int xMax[] = {  0,  5, -5, 10};
-    int yMin[] = { -4,  0, -8,  4};
-    int yMax[] = {  0,  4, -4,  8};
-    int i;
+    psS32 numCases = 4;
+    psS32 xMin[] = { -5,  0,-10,  5};
+    psS32 xMax[] = {  0,  5, -5, 10};
+    psS32 yMin[] = { -4,  0, -8,  4};
+    psS32 yMax[] = {  0,  4, -4,  8};
+    psS32 i;
     psKernel* k;
 
@@ -73,5 +73,5 @@
         }
 
-        for (int j=yMin[i]; j<yMax[i]; j++) {
+        for (psS32 j=yMin[i]; j<yMax[i]; j++) {
             if (k->kernel[j]+xMin[i] != k->image->data.PS_TYPE_KERNEL_DATA[j-yMin[i]]) {
                 psError(__func__,"The kernel pointer was set wrong for row %d.",
@@ -115,10 +115,10 @@
 }
 
-static int testKernelGenerate(void)
+static psS32 testKernelGenerate(void)
 {
-    int size = 4;
-    int t[] = { 1, 2, 8, 10 };
-    int x[] = { 0, 1, 0, -1 };
-    int y[] = { 2, 1, -1, -2 };
+    psS32 size = 4;
+    psS32 t[] = { 1, 2, 8, 10 };
+    psS32 x[] = { 0, 1, 0, -1 };
+    psS32 y[] = { 2, 1, -1, -2 };
     psKernelType sum;
 
@@ -127,5 +127,5 @@
     psVector* tVec = psVectorAlloc(size,PS_TYPE_U32);
 
-    for (int i = 0; i < size; i++) {
+    for (psS32 i = 0; i < size; i++) {
         xVec->data.U32[i] = x[i];
         yVec->data.U32[i] = y[i];
@@ -148,6 +148,6 @@
 
     sum = 0.0;
-    for (int y = result->yMin; y <= result->yMax; y++) {
-        for (int x = result->xMin; x <= result->xMax; x++) {
+    for (psS32 y = result->yMin; y <= result->yMax; y++) {
+        for (psS32 x = result->xMin; x <= result->xMax; x++) {
             sum += result->kernel[y][x];
         }
@@ -182,5 +182,5 @@
     tVec = psVectorAlloc(size,PS_TYPE_S16);
 
-    for (int i = 0; i < size; i++) {
+    for (psS32 i = 0; i < size; i++) {
         xVec->data.S16[i] = x[i];
         yVec->data.S16[i] = y[i];
@@ -203,6 +203,6 @@
 
     sum = 0.0;
-    for (int y = result->yMin; y <= result->yMax; y++) {
-        for (int x = result->xMin; x <= result->xMax; x++) {
+    for (psS32 y = result->yMin; y <= result->yMax; y++) {
+        for (psS32 x = result->xMin; x <= result->xMax; x++) {
             sum += result->kernel[y][x];
         }
@@ -236,5 +236,5 @@
     tVec = psVectorAlloc(size,PS_TYPE_F32);
 
-    for (int i = 0; i < size; i++) {
+    for (psS32 i = 0; i < size; i++) {
         xVec->data.F32[i] = x[i]+0.1;
         yVec->data.F32[i] = y[i]+0.2;
@@ -291,9 +291,9 @@
 
 /*
-static int testImageConvolve(void)
+static psS32 testImageConvolve(void)
 {
-    const int r = 200;
-    const int c = 300;
-    int sum;
+    const psS32 r = 200;
+    const psS32 c = 300;
+    psS32 sum;
  
     // approximate a normalized gaussian kernel.
@@ -312,12 +312,12 @@
     psKernel* nsk = psKernelAlloc(0,2,0,2);
     sum = 0.0;
-    for (int i=0;i<2;i++) {
-        for (int j=0;j<2;j++) {
+    for (psS32 i=0;i<2;i++) {
+        for (psS32 j=0;j<2;j++) {
             nsk->kernel[i][j] = i+j;
             sum = i+j;
         }
     }
-    for (int i=0;i<2;i++) {
-        for (int j=0;j<2;j++) {
+    for (psS32 i=0;i<2;i++) {
+        for (psS32 j=0;j<2;j++) {
             nsk->kernel[i][j] /= sum;
         }
@@ -356,6 +356,6 @@
  
     // test values
-    for (int i=-1;i<1;i++) {
-        for (int j=-1;j<1;j++) {
+    for (psS32 i=-1;i<1;i++) {
+        for (psS32 j=-1;j<1;j++) {
             if (fabsf(out->data.F32[r/2+i][c/2+j] - g->kernel[i][j]) > 0.0001) {
                 psError(__func__,"Convolved image wrong at %d,%d.  Value is %g, expected %g.",
@@ -423,6 +423,6 @@
     psImageWriteSection(out2,0,0,0,NULL,0,"out2.fits");
     // test values
-    for (int i=-1;i<1;i++) {
-        for (int j=-1;j<1;j++) {
+    for (psS32 i=-1;i<1;i++) {
+        for (psS32 j=-1;j<1;j++) {
             if (fabsf(out->data.F32[r/2+i][c/2+j] - g->kernel[i][j]) > 0.0001) {
                 psError(__func__,"Convolved image wrong at %d,%d.  Value is %g, expected %g.",
Index: trunk/psLib/test/image/tst_psImageExtraction.c
===================================================================
--- trunk/psLib/test/image/tst_psImageExtraction.c	(revision 2156)
+++ trunk/psLib/test/image/tst_psImageExtraction.c	(revision 2204)
@@ -6,6 +6,6 @@
 *  @author Robert DeSonia, MHPCC
 *
-*  @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-10-15 20:00:56 $
+*  @version $Revision: 1.18 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-10-27 00:57:33 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -18,10 +18,10 @@
 #include "psType.h"
 
-static int testImageSlice(void);
-static int testImageSubset(void);
-static int testImageSubsection(void);
-static int testImageTrim(void);
-static int testImageCut(void);
-static int testImageRadialCut(void);
+static psS32 testImageSlice(void);
+static psS32 testImageSubset(void);
+static psS32 testImageSubsection(void);
+static psS32 testImageTrim(void);
+static psS32 testImageCut(void);
+static psS32 testImageRadialCut(void);
 
 
@@ -37,15 +37,15 @@
                           };
 
-int main( int argc, char* argv[] )
+psS32 main( psS32 argc, char* argv[] )
 {
     return ! runTestSuite( stderr, "psImage", tests, argc, argv );
 }
 
-int testImageSlice(void)
+psS32 testImageSlice(void)
 {
-    const int r = 200;
-    const int c = 300;
-    const int m = r / 2 -1;
-    const int n = r / 4 -1;
+    const psS32 r = 200;
+    const psS32 c = 300;
+    const psS32 m = r / 2 -1;
+    const psS32 n = r / 4 -1;
     psVector* out = NULL;
     psImage* image;
@@ -68,7 +68,7 @@
      */
 
-    for ( int row = 0;row < r;row++ ) {
+    for ( psS32 row = 0;row < r;row++ ) {
         psMaskType* maskRow = mask->data.PS_TYPE_MASK_DATA[row];
-        for ( int col = 0;col < c;col++ ) {
+        for ( psS32 col = 0;col < c;col++ ) {
             maskRow[ col ] = 0;
         }
@@ -77,8 +77,8 @@
     #define PSIMAGESLICE_TEST1(TYPE,M,N,DIRECTION,TRUTH_SIZE,TRUTHPIX_X,TRUTHPIX_Y,TESTNUM) \
     image = psImageAlloc( c, r, PS_TYPE_##TYPE ); \
-    for ( int row = 0;row < r;row++ ) { \
+    for ( psS32 row = 0;row < r;row++ ) { \
         ps##TYPE *imageRow = image->data.TYPE[ row ]; \
         ps##TYPE rowOffset = row * 2; \
-        for ( int col = 0;col < c;col++ ) { \
+        for ( psS32 col = 0;col < c;col++ ) { \
             imageRow[ col ] = col + rowOffset; \
         } \
@@ -98,5 +98,5 @@
     } \
     \
-    for (int i=0;i<out->n;i++) { \
+    for (psS32 i=0;i<out->n;i++) { \
         if (fabs(out->data.F64[i]-image->data.TYPE[r/10+TRUTHPIX_Y][c/10+TRUTHPIX_X]) > 1.0/(psF64)r) { \
             psError(__func__,"Improper result at position %d.  Got %g, expected %g",i, \
@@ -363,5 +363,5 @@
 
 // #547: psImageSubset shall create child image of a specified size from a parent psImage structure
-int testImageSubset(void)
+psS32 testImageSubset(void)
 {
     psImage preSubsetStruct;
@@ -370,10 +370,10 @@
     psImage* subset2 = NULL;
     psImage* subset3 = NULL;
-    int c = 128;
-    int r = 256;
+    psS32 c = 128;
+    psS32 r = 256;
 
     original = psImageAlloc(c,r,PS_TYPE_U32);
-    for (int row=0;row<r;row++) {
-        for (int col=0;col<c;col++) {
+    for (psS32 row=0;row<r;row++) {
+        for (psS32 col=0;col<c;col++) {
             original->data.F32[row][col] = row*1000+col;
         }
@@ -404,6 +404,6 @@
              "row member, if the input psImage structure image contains known values.");
 
-    for (int row=0;row<r/2;row++) {
-        for (int col=0;col<c/2;col++) {
+    for (psS32 row=0;row<r/2;row++) {
+        for (psS32 col=0;col<c/2;col++) {
             if (subset2->data.U32[row][col] != original->data.U32[row+r/4][col+c/4]) {
                 psError(__func__,"psImageSubset output #1 was wrong at %dx%d (%d vs %d).",
@@ -596,20 +596,20 @@
 
 // #730: psImageSubsection shall create child image of a specified size from a parent psImage structure
-int testImageSubsection(void)
+psS32 testImageSubsection(void)
 {
     psImage* original;
     psImage* subset;
-    int c = 128;
-    int r = 256;
-    int i;
-    int numRegions = 4;
-    int x1[] = {  0, 32, 64, 32};
-    int x2[] = { 32, 64,127, 64};
-    int y1[] = {  0, 32, 32,128};
-    int y2[] = { 32, 64, 64,255};
+    psS32 c = 128;
+    psS32 r = 256;
+    psS32 i;
+    psS32 numRegions = 4;
+    psS32 x1[] = {  0, 32, 64, 32};
+    psS32 x2[] = { 32, 64,127, 64};
+    psS32 y1[] = {  0, 32, 32,128};
+    psS32 y2[] = { 32, 64, 64,255};
 
     original = psImageAlloc(c,r,PS_TYPE_U32);
-    for (int row=0;row<r;row++) {
-        for (int col=0;col<c;col++) {
+    for (psS32 row=0;row<r;row++) {
+        for (psS32 col=0;col<c;col++) {
             original->data.F32[row][col] = row*1000+col;
         }
@@ -664,6 +664,6 @@
         }
 
-        int numCols = x2[i]-x1[i]+1;
-        int numRows = y2[i]-y1[i]+1;
+        psS32 numCols = x2[i]-x1[i]+1;
+        psS32 numRows = y2[i]-y1[i]+1;
         if (subset->numCols != numCols || subset->numRows != numRows) {
             psError(__func__,"psImageSubsection output size was not proper(%dx%d, should be %dx%d).",
@@ -672,6 +672,6 @@
         }
 
-        for (int row=0;row<numRows;row++) {
-            for (int col=0;col<numCols;col++) {
+        for (psS32 row=0;row<numRows;row++) {
+            for (psS32 col=0;col<numCols;col++) {
                 if (subset->data.U32[row][col] != original->data.U32[row+y1[i]][col+x1[i]]) {
                     psError(__func__,"psImageSubset output #1 was wrong at %dx%d (%d vs %d).",
@@ -751,16 +751,16 @@
 }
 
-static int testImageTrim(void)
+static psS32 testImageTrim(void)
 {
-    int r = 200;
-    int c = 300;
-    int qtrR = r/4;
-    int qtrC = c/4;
-    int halfR = r/2;
-    int halfC = c/2;
+    psS32 r = 200;
+    psS32 c = 300;
+    psS32 qtrR = r/4;
+    psS32 qtrC = c/4;
+    psS32 halfR = r/2;
+    psS32 halfC = c/2;
 
     psImage* image = psImageAlloc(c,r,PS_TYPE_F32);
-    for (int row = 0; row < image->numRows; row++) {
-        for (int col = 0; col < image->numCols; col++) {
+    for (psS32 row = 0; row < image->numRows; row++) {
+        for (psS32 col = 0; col < image->numCols; col++) {
             image->data.F32[row][col] = (psF32)col + (psF32)row/1000.0f;
         }
@@ -792,6 +792,6 @@
     }
 
-    for (int row = 0; row < image2->numRows; row++) {
-        for (int col = 0; col < image2->numCols; col++) {
+    for (psS32 row = 0; row < image2->numRows; row++) {
+        for (psS32 col = 0; col < image2->numCols; col++) {
             if (fabsf(image2->data.F32[row][col] - image->data.F32[row+qtrR][col+qtrC]) > FLT_EPSILON) {
                 psLogMsg(__func__,PS_LOG_ERROR,
@@ -830,6 +830,6 @@
     }
 
-    for (int row = 0; row < image2->numRows; row++) {
-        for (int col = 0; col < image2->numCols; col++) {
+    for (psS32 row = 0; row < image2->numRows; row++) {
+        for (psS32 col = 0; col < image2->numCols; col++) {
             if (fabsf(image2->data.F32[row][col] -
                       image->data.F32[row+qtrR][col+qtrC]) > FLT_EPSILON) {
@@ -869,6 +869,6 @@
     }
 
-    for (int row = 0; row < image2->numRows; row++) {
-        for (int col = 0; col < image2->numCols; col++) {
+    for (psS32 row = 0; row < image2->numRows; row++) {
+        for (psS32 col = 0; col < image2->numCols; col++) {
             if (fabsf(image2->data.F32[row][col] -
                       image->data.F32[row+qtrR][col+qtrC]) > FLT_EPSILON) {
@@ -1014,20 +1014,20 @@
 }
 
-static int testImageCut(void)
+static psS32 testImageCut(void)
 {
-    int c = 300;
-    int r = 200;
-    int numPoints = 15;
+    psS32 c = 300;
+    psS32 r = 200;
+    psS32 numPoints = 15;
     float startCol[] = { 40,150, 40,  0,280, 40,280, -1,300, 20, 20, 20, 20, 20, 20};
     float endCol[] =   {240,150,240,299, 40,240, 40,240,240, -1,300,240,240,240,240};
     float startRow[] = { 20, 10,100,  0, 20,180,180, 10, 10, 10, 10, -1,200, 10, 10};
     float endRow[] =   {160,180,100,199,160, 10, 10,180,180,180,180,180,180, -1,200};
-    bool success[] = {true,true,true,true,true,true,true,false,false,false,false,false,false,false,false};
-    unsigned int length = 100;
+    psBool success[] = {true,true,true,true,true,true,true,false,false,false,false,false,false,false,false};
+    psU32 length = 100;
 
     psImage* image = psImageAlloc(c,r,PS_TYPE_F32);
     psImage* mask = psImageAlloc(c,r,PS_TYPE_MASK);
-    for (int row = 0; row < image->numRows; row++) {
-        for (int col = 0; col < image->numCols; col++) {
+    for (psS32 row = 0; row < image->numRows; row++) {
+        for (psS32 col = 0; col < image->numCols; col++) {
             image->data.F32[row][col] = (psF32)col + (psF32)row/1000.0f;
             if ((row & 0x0F) == 0) {
@@ -1042,5 +1042,5 @@
 
     psVector* result = NULL;
-    for (int n = 0; n < numPoints; n++) {
+    for (psS32 n = 0; n < numPoints; n++) {
         psVector* orig = result;
         if (! success[n]) {
@@ -1083,5 +1083,5 @@
             float deltaCol = (endCol[n]-startCol[n])/(length-1);
             psF32 truth;
-            for (int i = 0; i < length; i++) {
+            for (psS32 i = 0; i < length; i++) {
                 float x = (float)startCol[n]+(float)i*deltaCol;
                 float y = (float)startRow[n]+(float)i*deltaRow;
@@ -1177,16 +1177,16 @@
 }
 
-static int testImageRadialCut(void)
+static psS32 testImageRadialCut(void)
 {
-    int c = 300;
-    int r = 200;
-    int centerX = c/2;
-    int centerY = r/2;
+    psS32 c = 300;
+    psS32 r = 200;
+    psS32 centerX = c/2;
+    psS32 centerY = r/2;
     psErr* err = NULL;
 
     psImage* image = psImageAlloc(c,r,PS_TYPE_F32);
     psImage* mask = psImageAlloc(c,r,PS_TYPE_MASK);
-    for (int row = 0; row < image->numRows; row++) {
-        for (int col = 0; col < image->numCols; col++) {
+    for (psS32 row = 0; row < image->numRows; row++) {
+        for (psS32 col = 0; col < image->numCols; col++) {
             image->data.F32[row][col] = sqrtf((col-centerX)*(col-centerX)+(row-centerY)*(row-centerY));
             if ((row & 0x0F) == 0) {
@@ -1200,5 +1200,5 @@
     psStats* stat = psStatsAlloc(PS_STAT_SAMPLE_MEAN);
     psVector* radii = psVectorAlloc(10,PS_TYPE_F32);
-    for (int i=0; i < 10; i++) {
+    for (psS32 i=0; i < 10; i++) {
         radii->data.F32[i] = 10+i*10;
     }
@@ -1220,5 +1220,5 @@
     }
 
-    for (int i=0; i < 9; i++) {
+    for (psS32 i=0; i < 9; i++) {
         if (fabs(result->data.F64[i] - (15.0+i*10)) > 1) {
             psLogMsg(__func__,PS_LOG_ERROR,
@@ -1245,5 +1245,5 @@
     }
 
-    for (int i=0; i < 9; i++) {
+    for (psS32 i=0; i < 9; i++) {
         if (fabs(result->data.F64[i] - (15.0+i*10)) > 1) {
             psLogMsg(__func__,PS_LOG_ERROR,
Index: trunk/psLib/test/image/tst_psImageFFT.c
===================================================================
--- trunk/psLib/test/image/tst_psImageFFT.c	(revision 2156)
+++ trunk/psLib/test/image/tst_psImageFFT.c	(revision 2204)
@@ -6,6 +6,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-10-13 19:50:12 $
+ *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-10-27 00:57:33 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -20,16 +20,16 @@
 #define GENIMAGE(img,c,r,TYP, valueFcn) \
 img = psImageAlloc(c,r,PS_TYPE_##TYP); \
-for (unsigned int row=0;row<r;row++) { \
+for (psU32 row=0;row<r;row++) { \
     ps##TYP* imgRow = img->data.TYP[row]; \
-    for (unsigned int col=0;col<c;col++) { \
+    for (psU32 col=0;col<c;col++) { \
         imgRow[col] = (ps##TYP)(valueFcn); \
     } \
 }
 
-static int testImageFFT(void);
-static int testImageRealImaginary(void);
-static int testImageComplex(void);
-static int testImageConjugate(void);
-static int testImagePowerSpectrum(void);
+static psS32 testImageFFT(void);
+static psS32 testImageRealImaginary(void);
+static psS32 testImageComplex(void);
+static psS32 testImageConjugate(void);
+static psS32 testImagePowerSpectrum(void);
 
 testDescription tests[] = {
@@ -54,5 +54,5 @@
                           };
 
-int main(int argc, char* argv[])
+psS32 main(psS32 argc, char* argv[])
 {
     psLogSetLevel(PS_LOG_INFO);
@@ -61,11 +61,11 @@
 }
 
-int testImageFFT(void)
+psS32 testImageFFT(void)
 {
     psImage* img = NULL;
     psImage* img2 = NULL;
     psImage* img3 = NULL;
-    unsigned int m = 128;
-    unsigned int n = 64;
+    psU32 m = 128;
+    psU32 n = 64;
     psImage* img4 = NULL;
     psImage* img5 = NULL;
@@ -95,7 +95,7 @@
 
     // 3. verify that the only significant component cooresponds to the freqency of the input in step 1.
-    for (unsigned int row=0;row<n;row++) {
+    for (psU32 row=0;row<n;row++) {
         psC32* img2Row = img2->data.C32[row];
-        for (unsigned int col=0;col<m;col++) {
+        for (psU32 col=0;col<m;col++) {
             psF32 mag = cabsf(img2Row[col])/m/n;
             if (mag > 0.1f) {
@@ -130,8 +130,8 @@
     }
 
-    for (unsigned int row=0;row<n;row++) {
+    for (psU32 row=0;row<n;row++) {
         psC32* img3Row = img3->data.C32[row];
         psF32* imgRow = img->data.F32[row];
-        for (unsigned int col=0;col<m;col++) {
+        for (psU32 col=0;col<m;col++) {
             psF32 pixel = creal(img3Row[col])/m/n;
             if (fabsf(pixel-imgRow[col]) > 0.1) {
@@ -159,8 +159,8 @@
     }
 
-    for (unsigned int row=0;row<n;row++) {
+    for (psU32 row=0;row<n;row++) {
         psF32* img3Row = img3->data.F32[row];
         psF32* imgRow = img->data.F32[row];
-        for (unsigned int col=0;col<m;col++) {
+        for (psU32 col=0;col<m;col++) {
             psF32 pixel = img3Row[col]/m/n;
             if (fabsf(pixel-imgRow[col]) > 0.1) {
@@ -209,11 +209,11 @@
 }
 
-int testImageRealImaginary(void)
+psS32 testImageRealImaginary(void)
 {
     psImage* img = NULL;
     psImage* img2 = NULL;
     psImage* img3 = NULL;
-    unsigned int m = 128;
-    unsigned int n = 64;
+    psU32 m = 128;
+    psU32 n = 64;
 
     /*
@@ -250,8 +250,8 @@
 
     // 3. compare results to the real/imaginary components of input
-    for (unsigned int row=0;row<n;row++) {
+    for (psU32 row=0;row<n;row++) {
         psF32* img2Row = img2->data.F32[row];
         psF32* img3Row = img3->data.F32[row];
-        for (unsigned int col=0;col<m;col++) {
+        for (psU32 col=0;col<m;col++) {
             if (fabsf(img2Row[col] - row) > FLT_EPSILON) {
                 psError(__func__,"psImageReal didn't return the real portion at n=%d",
@@ -274,11 +274,11 @@
 }
 
-int testImageComplex(void)
+psS32 testImageComplex(void)
 {
     psImage* img = NULL;
     psImage* img2 = NULL;
     psImage* img3 = NULL;
-    unsigned int m = 128;
-    unsigned int n = 64;
+    psU32 m = 128;
+    psU32 n = 64;
 
     /*
@@ -314,7 +314,7 @@
     // 4. call psImageReal and psImageImaginary on step 2 results (not needed, just use crealf/cimagf)
     // 5. compare step 4 results to input.
-    for (unsigned int row=0;row<n;row++) {
+    for (psU32 row=0;row<n;row++) {
         psC32* img3Row = img3->data.C32[row];
-        for (unsigned int col=0;col<m;col++) {
+        for (psU32 col=0;col<m;col++) {
             if (fabsf(crealf(img3Row[col]) - row) > FLT_EPSILON ||
                     fabsf(cimagf(img3Row[col]) - col) > FLT_EPSILON) {
@@ -358,10 +358,10 @@
 }
 
-int testImageConjugate(void)
+psS32 testImageConjugate(void)
 {
     psImage* img = NULL;
     psImage* img2 = NULL;
-    unsigned int m = 128;
-    unsigned int n = 64;
+    psU32 m = 128;
+    psU32 n = 64;
 
     /*
@@ -385,7 +385,7 @@
 
     // 4. verify each value is conjugate of input (a+bi -> a-bi)
-    for (unsigned int row=0;row<n;row++) {
+    for (psU32 row=0;row<n;row++) {
         psC32* img2Row = img2->data.C32[row];
-        for (unsigned int col=0;col<m;col++) {
+        for (psU32 col=0;col<m;col++) {
             if (fabsf(crealf(img2Row[col]) - row) > FLT_EPSILON ||
                     fabsf(cimagf(img2Row[col]) + col) > FLT_EPSILON) {
@@ -403,10 +403,10 @@
 }
 
-int testImagePowerSpectrum(void)
+psS32 testImagePowerSpectrum(void)
 {
     psImage* img = NULL;
     psImage* img2 = NULL;
-    unsigned int m = 128;
-    unsigned int n = 64;
+    psU32 m = 128;
+    psU32 n = 64;
 
     /*
@@ -430,8 +430,8 @@
 
     // 4. verify the values are the square of the absolute values of the original
-    for (unsigned int row=0;row<n;row++) {
+    for (psU32 row=0;row<n;row++) {
         psC32* imgRow = img->data.C32[row];
         psF32* img2Row = img2->data.F32[row];
-        for (unsigned int col=0;col<m;col++) {
+        for (psU32 col=0;col<m;col++) {
             psF32 power = cabs(imgRow[col]);
             power *= power/n/n/m/m;
Index: trunk/psLib/test/image/tst_psImageIO.c
===================================================================
--- trunk/psLib/test/image/tst_psImageIO.c	(revision 2156)
+++ trunk/psLib/test/image/tst_psImageIO.c	(revision 2204)
@@ -6,6 +6,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-10-02 02:09:21 $
+ *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-10-27 00:57:33 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -25,13 +25,13 @@
 #define GENIMAGE(img,c,r,TYP, valueFcn) \
 img = psImageAlloc(c,r,PS_TYPE_##TYP); \
-for (unsigned int row=0;row<r;row++) { \
+for (psU32 row=0;row<r;row++) { \
     ps##TYP* imgRow = img->data.TYP[row]; \
-    for (unsigned int col=0;col<c;col++) { \
+    for (psU32 col=0;col<c;col++) { \
         imgRow[col] = (ps##TYP)(valueFcn); \
     } \
 }
 
-static int testImageRead(void);
-static int testImageWrite(void);
+static psS32 testImageRead(void);
+static psS32 testImageWrite(void);
 
 testDescription tests[] = {
@@ -47,5 +47,5 @@
                           };
 
-int main(int argc, char* argv[])
+psS32 main(psS32 argc, char* argv[])
 {
     psLogSetLevel(PS_LOG_INFO);
@@ -57,8 +57,8 @@
 }
 
-int testImageRead(void)
+psS32 testImageRead(void)
 {
-    int N = 256;
-    int M = 128;
+    psS32 N = 256;
+    psS32 M = 128;
     psImage* image = NULL;
 
@@ -127,10 +127,10 @@
             return 6; \
         } \
-        for (unsigned int row = readN0; row < readN; row++) { \
+        for (psU32 row = readN0; row < readN; row++) { \
             ps##TYP* imgRow = img->data.TYP[row-readN0]; \
             ps##TYP* img2Row = img2->data.TYP[row]; \
             ps##TYP* img3Row = img3->data.TYP[row-readN0]; \
             ps##TYP* img4Row = img4->data.TYP[row]; \
-            for (unsigned int col = readM0; col < readM; col++) { \
+            for (psU32 col = readM0; col < readM; col++) { \
                 if (fabsf(imgRow[col-readM0]-img2Row[col]) > FLT_EPSILON) { \
                     psError(__func__,"Image changed in I/O operation at %d,%d,0 (%.2f vs %.2f) for %s", \
@@ -155,10 +155,10 @@
             return 9; \
         } \
-        for (unsigned int row = readN0; row < readN; row++) { \
+        for (psU32 row = readN0; row < readN; row++) { \
             ps##TYP* imgRow = img->data.TYP[row-readN0]; \
             ps##TYP* img2Row = img2->data.TYP[row]; \
             ps##TYP* img3Row = img3->data.TYP[row-readN0]; \
             ps##TYP* img4Row = img4->data.TYP[row]; \
-            for (unsigned int col = readM0; col < readM; col++) { \
+            for (psU32 col = readM0; col < readM; col++) { \
                 if (fabsf(imgRow[col-readM0]-img2Row[col]) > FLT_EPSILON) { \
                     psError(__func__,"Image changed in I/O operation at %d,%d,0 (%.2f vs %.2f) for %s", \
@@ -258,10 +258,10 @@
 }
 
-int testImageWrite(void)
+psS32 testImageWrite(void)
 {
     psImage* img = NULL;
     psImage* img2 = NULL;
-    int m = 64;
-    int n = 96;
+    psS32 m = 64;
+    psS32 n = 96;
 
     /*
@@ -318,7 +318,7 @@
         return 16;
     }
-    for (unsigned int row=0;row<n;row++) {
+    for (psU32 row=0;row<n;row++) {
         psF32* imgRow = img->data.F32[row];
-        for (unsigned int col=0;col<m;col++) {
+        for (psU32 col=0;col<m;col++) {
             if (fabsf(imgRow[col] - (row+2*col)) > FLT_EPSILON) {
                 psError(__func__,"The image values were not overwritten at %d,%d (%.2f vs %.2f)",
Index: trunk/psLib/test/image/tst_psImageManip.c
===================================================================
--- trunk/psLib/test/image/tst_psImageManip.c	(revision 2156)
+++ trunk/psLib/test/image/tst_psImageManip.c	(revision 2204)
@@ -6,6 +6,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.29 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-10-14 01:22:59 $
+ *  @version $Revision: 1.30 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-10-27 00:57:33 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -25,14 +25,14 @@
 #include "psType.h"
 
-static int testImageClip(void);
-static int testImageClipNAN(void);
-static int testImageClipComplexRegion(void);
-static int testImageOverlay(void);
-static int testImageRebin(void);
-static int testImageRoll(void);
-static int testImageRotate(void);
-static int testImageShift(void);
-static int testImageShiftCase(int cols, int rows, float colShift,float rowShift);
-static int testImageResample(void);
+static psS32 testImageClip(void);
+static psS32 testImageClipNAN(void);
+static psS32 testImageClipComplexRegion(void);
+static psS32 testImageOverlay(void);
+static psS32 testImageRebin(void);
+static psS32 testImageRoll(void);
+static psS32 testImageRotate(void);
+static psS32 testImageShift(void);
+static psS32 testImageShiftCase(psS32 cols, psS32 rows, float colShift,float rowShift);
+static psS32 testImageResample(void);
 
 testDescription tests[] = {
@@ -49,5 +49,5 @@
                           };
 
-int main(int argc, char* argv[])
+psS32 main(psS32 argc, char* argv[])
 {
     psLogSetLevel(PS_LOG_INFO);
@@ -57,13 +57,13 @@
 
 
-int testImageClip(void)
+psS32 testImageClip(void)
 {
     psImage* img = NULL;
-    unsigned int c = 128;
-    unsigned int r = 256;
+    psU32 c = 128;
+    psU32 r = 256;
     psF64 min;
     psF64 max;
-    int numClipped = 0;
-    int retVal;
+    psS32 numClipped = 0;
+    psS32 retVal;
 
     psLogMsg(__func__,PS_LOG_INFO,
@@ -95,7 +95,7 @@
     #define testImageClipByType(datatype) \
     img = psImageAlloc(c,r,PS_TYPE_##datatype); \
-    for (unsigned int row=0;row<r;row++) { \
+    for (psU32 row=0;row<r;row++) { \
         ps##datatype* imgRow = img->data.datatype[row]; \
-        for (unsigned int col=0;col<c;col++) { \
+        for (psU32 col=0;col<c;col++) { \
             imgRow[col] = (ps##datatype)(row+col); \
         } \
@@ -107,7 +107,7 @@
     \
     numClipped = 0; \
-    for (unsigned int row=0;row<r;row++) { \
+    for (psU32 row=0;row<r;row++) { \
         ps##datatype* imgRow = img->data.datatype[row]; \
-        for (unsigned int col=0;col<c;col++) { \
+        for (psU32 col=0;col<c;col++) { \
             ps##datatype value = (ps##datatype)(row+col); \
             if (value < min) { \
@@ -134,7 +134,7 @@
     #define testImageClipByComplexType(datatype) \
     img = psImageAlloc(c,r,PS_TYPE_##datatype); \
-    for (unsigned int row=0;row<r;row++) { \
+    for (psU32 row=0;row<r;row++) { \
         ps##datatype* imgRow = img->data.datatype[row]; \
-        for (unsigned int col=0;col<c;col++) { \
+        for (psU32 col=0;col<c;col++) { \
             imgRow[col] = (ps##datatype)(row+I*col); \
         } \
@@ -146,7 +146,7 @@
     \
     numClipped = 0; \
-    for (unsigned int row=0;row<r;row++) { \
+    for (psU32 row=0;row<r;row++) { \
         ps##datatype* imgRow = img->data.datatype[row]; \
-        for (unsigned int col=0;col<c;col++) { \
+        for (psU32 col=0;col<c;col++) { \
             ps##datatype value = row+I*col; \
             if (cabs(value) < min) { \
@@ -225,11 +225,11 @@
 }
 
-int testImageClipNAN(void)
+psS32 testImageClipNAN(void)
 {
     psImage* img = NULL;
-    unsigned int c = 128;
-    unsigned int r = 256;
-    int numClipped = 0;
-    int retVal;
+    psU32 c = 128;
+    psU32 r = 256;
+    psS32 numClipped = 0;
+    psS32 retVal;
 
     psLogMsg(__func__,PS_LOG_INFO,
@@ -317,11 +317,11 @@
 }
 
-int testImageClipComplexRegion(void)
+psS32 testImageClipComplexRegion(void)
 {
     psImage* img = NULL;
-    unsigned int c = 1024;
-    unsigned int r = 2048;
-    int numClipped = 0;
-    int retVal;
+    psU32 c = 1024;
+    psU32 r = 2048;
+    psS32 numClipped = 0;
+    psS32 retVal;
 
     psLogMsg(__func__,PS_LOG_INFO,
@@ -581,5 +581,5 @@
 }
 
-int testImageOverlay(void)
+psS32 testImageOverlay(void)
 {
 
@@ -588,7 +588,7 @@
     psImage* img3 = NULL;
     psImage* img4 = NULL;
-    unsigned int c = 128;
-    unsigned int r = 256;
-    int retVal;
+    psU32 c = 128;
+    psU32 r = 256;
+    psS32 retVal;
 
     /*
@@ -833,5 +833,5 @@
 }
 
-static int testImageRebin(void)
+static psS32 testImageRebin(void)
 {
 
@@ -869,5 +869,5 @@
     memset(meanTruthWMask->data.F32[0],0,sizeof(psF32)*4*4); \
     memset(maxTruth->data.F32[0],0,sizeof(psF32)*6*6); \
-    for (int row = 0; row<16; row++) { \
+    for (psS32 row = 0; row<16; row++) { \
         ps##DATATYPE* inRow = in->data.DATATYPE[row]; \
         psF32* meanTruthRow = meanTruth->data.F32[row/4]; \
@@ -875,5 +875,5 @@
         psF32* maxTruthRow = maxTruth->data.F32[row/3]; \
         psU8* maskRow = mask->data.U8[row]; \
-        for (int col = 0; col<16; col++) { \
+        for (psS32 col = 0; col<16; col++) { \
             if(col != 15) { \
                 maskRow[col] = 0; \
@@ -891,8 +891,8 @@
         } \
     } \
-    for (int row = 0; row<4; row++) { \
+    for (psS32 row = 0; row<4; row++) { \
         psF32* meanTruthRow = meanTruth->data.F32[row]; \
         psF32* meanTruthWMaskRow = meanTruthWMask->data.F32[row]; \
-        for (int col = 0; col<4; col++) { \
+        for (psS32 col = 0; col<4; col++) { \
             meanTruthRow[col] /= 16; \
             if ( col == 3 ) { \
@@ -915,8 +915,8 @@
         return 2; \
     } \
-    for (int row = 0; row<4; row++) { \
+    for (psS32 row = 0; row<4; row++) { \
         ps##DATATYPE* outRow = out->data.DATATYPE[row]; \
         psF32* truthRow = meanTruth->data.F32[row]; \
-        for (int col = 0; col<4; col++) { \
+        for (psS32 col = 0; col<4; col++) { \
             if (fabsf((float)outRow[col]-(float)truthRow[col]) > FLT_EPSILON) { \
                 psError(__func__,"psImageRebin didn't produce the proper mean " \
@@ -929,9 +929,9 @@
     stats.options = PS_STAT_SAMPLE_MEAN; \
     out3 = psImageRebin(NULL,in,mask,1,4,&stats); \
-    for (int row = 0; row<4; row++) { \
+    for (psS32 row = 0; row<4; row++) { \
         ps##DATATYPE* outRow = out3->data.DATATYPE[row]; \
         psF32* truthRow = meanTruthWMask->data.F32[row]; \
-        for ( int col = 0; col<4; col++) { \
-            if(abs((int)outRow[col]-(int)truthRow[col]) > FLT_EPSILON) { \
+        for ( psS32 col = 0; col<4; col++) { \
+            if(abs((psS32)outRow[col]-(psS32)truthRow[col]) > FLT_EPSILON) { \
                 psError(__func__,"psImageRebin with mask didn't produce the proper mean " \
                         "result at (%d,%d) [%f vs %f].", \
@@ -957,8 +957,8 @@
         return 5; \
     } \
-    for (int row = 0; row<6; row++) { \
+    for (psS32 row = 0; row<6; row++) { \
         ps##DATATYPE* outRow = out->data.DATATYPE[row]; \
         psF32* truthRow = maxTruth->data.F32[row]; \
-        for (int col = 0; col<6; col++) { \
+        for (psS32 col = 0; col<6; col++) { \
             if (fabsf((float)outRow[col]-(float)truthRow[col]) > FLT_EPSILON) { \
                 psError(__func__,"psImageRebin didn't produce the proper " \
@@ -1082,5 +1082,5 @@
 }
 
-static int testImageRoll(void)
+static psS32 testImageRoll(void)
 {
 
@@ -1088,8 +1088,8 @@
     psImage* out;
     psImage* out2;
-    int rows = 64;
-    int cols = 64;
-    int rows1 = 8;
-    int cols1 = 8;
+    psS32 rows = 64;
+    psS32 cols = 64;
+    psS32 rows1 = 8;
+    psS32 cols1 = 8;
 
     /*
@@ -1108,7 +1108,7 @@
 
     in = psImageAlloc(cols,rows,PS_TYPE_F32);
-    for (int row=0;row<rows;row++) {
+    for (psS32 row=0;row<rows;row++) {
         psF32* inRow = in->data.F32[row];
-        for (int col=0;col<cols;col++) {
+        for (psS32 col=0;col<cols;col++) {
             inRow[col] = (psF32)row+(psF32)col/1000.0f;
         }
@@ -1116,8 +1116,8 @@
 
     out = psImageRoll(NULL,in,0,0);
-    for (int row=0;row<rows;row++) {
+    for (psS32 row=0;row<rows;row++) {
         psF32* inRow = in->data.F32[row];
         psF32* outRow = out->data.F32[row];
-        for (int col=0;col<cols;col++) {
+        for (psS32 col=0;col<cols;col++) {
             if (inRow[col] != outRow[col]) {
                 psError(__func__,"psImageRoll didn't produce expected result "
@@ -1130,8 +1130,8 @@
 
     out2 = psImageRoll(out,in,cols/4,0);
-    for (int row=0;row<rows;row++) {
+    for (psS32 row=0;row<rows;row++) {
         psF32* inRow = in->data.F32[row];
         psF32* outRow = out->data.F32[row];
-        for (int col=0;col<cols;col++) {
+        for (psS32 col=0;col<cols;col++) {
             if (inRow[(col+cols/4) % cols] != outRow[col]) {
                 psError(__func__,"psImageRoll didn't produce expected result "
@@ -1151,8 +1151,8 @@
 
     out = psImageRoll(out,in,0,rows/4);
-    for (int row=0;row<rows;row++) {
+    for (psS32 row=0;row<rows;row++) {
         psF32* inRow = in->data.F32[(row+rows/4)%rows];
         psF32* outRow = out->data.F32[row];
-        for (int col=0;col<cols;col++) {
+        for (psS32 col=0;col<cols;col++) {
             if (inRow[col] != outRow[col]) {
                 psError(__func__,"psImageRoll didn't produce expected result "
@@ -1165,8 +1165,8 @@
 
     out = psImageRoll(out,in,cols/4,rows/4);
-    for (int row=0;row<rows;row++) {
+    for (psS32 row=0;row<rows;row++) {
         psF32* inRow = in->data.F32[(row+rows/4)%rows];
         psF32* outRow = out->data.F32[row];
-        for (int col=0;col<cols;col++) {
+        for (psS32 col=0;col<cols;col++) {
             if (inRow[(col+cols/4) % cols] != outRow[col]) {
                 psError(__func__,"psImageRoll didn't produce expected result "
@@ -1179,8 +1179,8 @@
 
     out = psImageRoll(out,in,-cols/4,0);
-    for (int row=0;row<rows;row++) {
+    for (psS32 row=0;row<rows;row++) {
         psF32* inRow = in->data.F32[row];
         psF32* outRow = out->data.F32[row];
-        for (int col=0;col<cols;col++) {
+        for (psS32 col=0;col<cols;col++) {
             if (inRow[(col+(cols-cols/4)) % cols] != outRow[col]) {
                 psError(__func__,"psImageRoll didn't produce expected result "
@@ -1193,8 +1193,8 @@
 
     out = psImageRoll(out,in,0,-rows/4);
-    for (int row=0;row<rows;row++) {
+    for (psS32 row=0;row<rows;row++) {
         psF32* inRow = in->data.F32[(row+rows-rows/4)%rows];
         psF32* outRow = out->data.F32[row];
-        for (int col=0;col<cols;col++) {
+        for (psS32 col=0;col<cols;col++) {
             if (inRow[col] != outRow[col]) {
                 psError(__func__,"psImageRoll didn't produce expected result "
@@ -1207,8 +1207,8 @@
 
     out = psImageRoll(out,in,-cols/4,-rows/4);
-    for (int row=0;row<rows;row++) {
+    for (psS32 row=0;row<rows;row++) {
         psF32* inRow = in->data.F32[(row+rows-rows/4)%rows];
         psF32* outRow = out->data.F32[row];
-        for (int col=0;col<cols;col++) {
+        for (psS32 col=0;col<cols;col++) {
             if (inRow[(col+cols-cols/4) % cols] != outRow[col]) {
                 psError(__func__,"psImageRoll didn't produce expected result "
@@ -1236,7 +1236,7 @@
     in = psImageAlloc(rows1,cols1,PS_TYPE_##DATATYPE); \
     \
-    for (int row=0;row<rows1;row++) { \
+    for (psS32 row=0;row<rows1;row++) { \
         ps##DATATYPE* inRow = in->data.DATATYPE[row]; \
-        for (int col=0;col<cols1;col++) { \
+        for (psS32 col=0;col<cols1;col++) { \
             inRow[col] = (ps##DATATYPE)row+(ps##DATATYPE)col; \
         } \
@@ -1244,8 +1244,8 @@
     \
     out = psImageRoll(NULL,in,rows1/4,cols1/4); \
-    for (int row=0;row<rows1;row++) { \
+    for (psS32 row=0;row<rows1;row++) { \
         ps##DATATYPE* inRow = in->data.DATATYPE[(row+rows1/4)%rows1]; \
         ps##DATATYPE* outRow = out->data.DATATYPE[row]; \
-        for (int col=0;col<cols1;col++) { \
+        for (psS32 col=0;col<cols1;col++) { \
             if (inRow[(col+cols1/4)%cols1] != outRow[col]) { \
                 psError(__func__,"psImageRoll didn't produce expected result " \
@@ -1270,5 +1270,5 @@
 }
 
-int testImageRotate(void)
+psS32 testImageRotate(void)
 {
     /*
@@ -1300,15 +1300,15 @@
     psImage* fBiTruth = NULL;
     psImage* sBiTruth = NULL;
-    int rows = 64;
-    int cols = 64;
+    psS32 rows = 64;
+    psS32 cols = 64;
     psImage* fImg = psImageAlloc(cols,rows,PS_TYPE_F32);
     psImage* sImg = psImageAlloc(cols,rows,PS_TYPE_S16);
     psImage* s32Img = psImageAlloc(cols,rows,PS_TYPE_S32);
 
-    for(int row=0;row<rows;row++) {
+    for(psS32 row=0;row<rows;row++) {
         psF32* fRow = fImg->data.F32[row];
         psS16* sRow = sImg->data.S16[row];
         psS32* s32Row = s32Img->data.S32[row];
-        for (int col=0;col<cols;col++) {
+        for (psS32 col=0;col<cols;col++) {
             fRow[col] = (psF32)(row)+(psF32)(col)/100.0f;
             sRow[col] = row-2*col;
@@ -1336,7 +1336,7 @@
         ("temp/sBiOut.fits");
     ;
-    int index = 0;
-    bool fail = false;
-    for (int rot=-180;rot<=180;rot+=45) {
+    psS32 index = 0;
+    psBool fail = false;
+    for (psS32 rot=-180;rot<=180;rot+=45) {
         psImage* oldOut = fOut;
         psImage* oldBiOut = fBiOut;
@@ -1388,8 +1388,8 @@
                 fail = true;
             } else {
-                for (int row=0;row<fTruth->numRows;row++) {
+                for (psS32 row=0;row<fTruth->numRows;row++) {
                     psF32* truthRow = fTruth->data.F32[row];
                     psF32* outRow = fOut->data.F32[row];
-                    for (int col=0;col<fTruth->numCols;col++) {
+                    for (psS32 col=0;col<fTruth->numCols;col++) {
                         if (fabsf(truthRow[col]-outRow[col]) > 1) {
                             psError(__func__,"Float Image mismatch (%f vs %f) at %d,%d.",
@@ -1409,12 +1409,12 @@
             if (sTruth->numRows != sOut->numRows ||
                     sTruth->numCols != sOut->numCols) {
-                psError(__func__,"Rotated short image size did not match truth "
+                psError(__func__,"Rotated psS16 image size did not match truth "
                         "image for %d deg rotation.",rot);
                 fail = true;
             } else {
-                for (int row=0;row<sTruth->numRows;row++) {
+                for (psS32 row=0;row<sTruth->numRows;row++) {
                     psS16* truthRow = sTruth->data.S16[row];
                     psS16* outRow = sOut->data.S16[row];
-                    for (int col=0;col<sTruth->numCols;col++) {
+                    for (psS32 col=0;col<sTruth->numCols;col++) {
                         if (fabsf(truthRow[col]-outRow[col]) > 1) {
                             psError(__func__,"Short Image mismatch (%d vs %d) "
@@ -1440,8 +1440,8 @@
                 fail = true;
             } else {
-                for (int row=0;row<fBiTruth->numRows;row++) {
+                for (psS32 row=0;row<fBiTruth->numRows;row++) {
                     psF32* truthRow = fBiTruth->data.F32[row];
                     psF32* outRow = fBiOut->data.F32[row];
-                    for (int col=0;col<fBiTruth->numCols;col++) {
+                    for (psS32 col=0;col<fBiTruth->numCols;col++) {
                         if (fabsf(truthRow[col]-outRow[col]) > 1) {
                             psError(__func__,"Float Image mismatch (%f vs %f) at %d,%d. BILINEAR",
@@ -1461,12 +1461,12 @@
             if (sBiTruth->numRows != sBiOut->numRows ||
                     sBiTruth->numCols != sBiOut->numCols) {
-                psError(__func__,"Rotated short image size did not match truth "
+                psError(__func__,"Rotated psS16 image size did not match truth "
                         "image for %d deg rotation. BILINEAR",rot);
                 fail = true;
             } else {
-                for (int row=0;row<sBiTruth->numRows;row++) {
+                for (psS32 row=0;row<sBiTruth->numRows;row++) {
                     psS16* truthRow = sBiTruth->data.S16[row];
                     psS16* outRow = sBiOut->data.S16[row];
-                    for (int col=0;col<sBiTruth->numCols;col++) {
+                    for (psS32 col=0;col<sBiTruth->numCols;col++) {
                         if (fabsf(truthRow[col]-outRow[col]) > 1) {
                             psError(__func__,"Short Image mismatch (%d vs %d) "
@@ -1537,5 +1537,5 @@
 }
 
-static int testImageShift(void)
+static psS32 testImageShift(void)
 {
     /* psImageShift:
@@ -1558,5 +1558,5 @@
     */
 
-    int retVal=0;
+    psS32 retVal=0;
 
     // integer shift
@@ -1627,8 +1627,8 @@
 }
 
-static int testImageShiftCase(int cols,
-                              int rows,
-                              float colShift,
-                              float rowShift)
+static psS32 testImageShiftCase(psS32 cols,
+                                psS32 rows,
+                                float colShift,
+                                float rowShift)
 {
     psImage* fOut = NULL;
@@ -1643,8 +1643,8 @@
     psImage* sBiOut = psImageAlloc(cols,rows,PS_TYPE_S16);
 
-    for(int row=0;row<rows;row++) {
+    for(psS32 row=0;row<rows;row++) {
         psF32* fRow = fImg->data.F32[row];
         psS16* sRow = sImg->data.S16[row];
-        for (int col=0;col<cols;col++) {
+        for (psS32 col=0;col<cols;col++) {
             fRow[col] = (psF32)(row)+(psF32)(col)/100.0f;
             sRow[col] = row-2*col;
@@ -1657,5 +1657,5 @@
     sBiOut = psImageShift(sBiOut, sImg, colShift, rowShift, -1, PS_INTERPOLATE_BILINEAR);
 
-    for(int row=0;row<rows;row++) {
+    for(psS32 row=0;row<rows;row++) {
         psF32* fRow = fOut->data.F32[row];
         psS16* sRow = sOut->data.S16[row];
@@ -1663,5 +1663,5 @@
         psS16* sBiRow = sBiOut->data.S16[row];
 
-        for (int col=0;col<cols;col++) {
+        for (psS32 col=0;col<cols;col++) {
             psF32 fValue = psImagePixelInterpolate(fImg,col+colShift,
                                                    row+rowShift,NULL,0,NAN,PS_INTERPOLATE_FLAT);
@@ -1707,17 +1707,17 @@
 }
 
-static int testImageResample(void)
+static psS32 testImageResample(void)
 {
 
-    int rows = 60;
-    int cols = 80;
+    psS32 rows = 60;
+    psS32 cols = 80;
     psImage* result = NULL;
-    int scale = 4;
+    psS32 scale = 4;
     psErr* err;
 
     psImage* image = psImageAlloc(cols,rows,PS_TYPE_F32);
-    for(int row=0;row<rows;row++) {
+    for(psS32 row=0;row<rows;row++) {
         psF32* imageRow = image->data.F32[row];
-        for (int col=0;col<cols;col++) {
+        for (psS32 col=0;col<cols;col++) {
             imageRow[col] = row+2*col;
         }
@@ -1753,6 +1753,6 @@
 
     psF32 truthValue;
-    for(int row=0;row<result->numRows;row++) {
-        for (int col=0;col<result->numCols;col++) {
+    for(psS32 row=0;row<result->numRows;row++) {
+        for (psS32 col=0;col<result->numCols;col++) {
             truthValue = psImagePixelInterpolate(image,
                                                  (float)col/(float)scale,(float)row/(float)scale,
Index: trunk/psLib/test/image/tst_psImageStats00.c
===================================================================
--- trunk/psLib/test/image/tst_psImageStats00.c	(revision 2156)
+++ trunk/psLib/test/image/tst_psImageStats00.c	(revision 2204)
@@ -14,5 +14,5 @@
 #define M 64
 
-int main()
+psS32 main()
 {
     psHistogram * myHist = NULL;
@@ -20,12 +20,12 @@
     psImage *tmpImage = NULL;
     psImage *tmpMask = NULL;
-    int testStatus = true;
-    int memLeaks = 0;
-    int nb = 0;
-    int i = 0;
-    int j = 0;
-    int IMAGE_X_SIZE = 0;
-    int IMAGE_Y_SIZE = 0;
-    int currentId = 0;
+    psS32 testStatus = true;
+    psS32 memLeaks = 0;
+    psS32 nb = 0;
+    psS32 i = 0;
+    psS32 j = 0;
+    psS32 IMAGE_X_SIZE = 0;
+    psS32 IMAGE_Y_SIZE = 0;
+    psS32 currentId = 0;
 
     currentId = psMemGetId();
Index: trunk/psLib/test/image/tst_psImageStats01.c
===================================================================
--- trunk/psLib/test/image/tst_psImageStats01.c	(revision 2156)
+++ trunk/psLib/test/image/tst_psImageStats01.c	(revision 2204)
@@ -15,5 +15,5 @@
 #define M 64
 
-int main()
+psS32 main()
 {
     psStats * myStats = NULL;
@@ -21,12 +21,12 @@
     psImage *tmpImage = NULL;
     psImage *tmpMask = NULL;
-    int testStatus = true;
-    int memLeaks = 0;
-    int nb = 0;
-    int i = 0;
-    int j = 0;
-    int IMAGE_X_SIZE = 0;
-    int IMAGE_Y_SIZE = 0;
-    int currentId = 0;
+    psS32 testStatus = true;
+    psS32 memLeaks = 0;
+    psS32 nb = 0;
+    psS32 i = 0;
+    psS32 j = 0;
+    psS32 IMAGE_X_SIZE = 0;
+    psS32 IMAGE_Y_SIZE = 0;
+    psS32 currentId = 0;
 
     currentId = psMemGetId();
Index: trunk/psLib/test/image/tst_psImageStats02.c
===================================================================
--- trunk/psLib/test/image/tst_psImageStats02.c	(revision 2156)
+++ trunk/psLib/test/image/tst_psImageStats02.c	(revision 2204)
@@ -18,5 +18,5 @@
 #define CHEBY_Y_DIM 8
 #define THRESHOLD 10
-int main()
+psS32 main()
 {
     psStats * myStats = NULL;
@@ -26,9 +26,9 @@
     psPolynomial2D *my2DPoly = NULL;
     psPolynomial2D *null2DPoly = NULL;
-    int testStatus = true;
-    int memLeaks = 0;
-    int i = 0;
-    int j = 0;
-    int currentId = 0;
+    psS32 testStatus = true;
+    psS32 memLeaks = 0;
+    psS32 i = 0;
+    psS32 j = 0;
+    psS32 currentId = 0;
 
     currentId = psMemGetId();
Index: trunk/psLib/test/image/tst_psImageStats03.c
===================================================================
--- trunk/psLib/test/image/tst_psImageStats03.c	(revision 2156)
+++ trunk/psLib/test/image/tst_psImageStats03.c	(revision 2204)
@@ -13,15 +13,15 @@
 #define IMAGE_SIZE 10
 
-int main()
+psS32 main()
 {
     psImage *tmpImage   = NULL;
-    int testStatus      = true;
-    int memLeaks        = 0;
-    int i               = 0;
-    int j               = 0;
+    psS32 testStatus      = true;
+    psS32 memLeaks        = 0;
+    psS32 i               = 0;
+    psS32 j               = 0;
     float pixel         = 0.0;
     float x             = 0.0;
     float y             = 0.0;
-    int currentId       = psMemGetId();
+    psS32 currentId       = psMemGetId();
 
     /*************************************************************************/
Index: trunk/psLib/test/image/verified/fBiOut.fits
===================================================================
--- trunk/psLib/test/image/verified/fBiOut.fits	(revision 2156)
+++ trunk/psLib/test/image/verified/fBiOut.fits	(revision 2204)
Index: trunk/psLib/test/image/verified/sBiOut.fits
===================================================================
--- trunk/psLib/test/image/verified/sBiOut.fits	(revision 2156)
+++ trunk/psLib/test/image/verified/sBiOut.fits	(revision 2204)
