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,
