Index: /trunk/psLib/src/mathtypes/psImage.c
===================================================================
--- /trunk/psLib/src/mathtypes/psImage.c	(revision 5571)
+++ /trunk/psLib/src/mathtypes/psImage.c	(revision 5572)
@@ -9,6 +9,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.89 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-10-01 02:22:12 $
+ *  @version $Revision: 1.90 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-11-22 19:58:16 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -220,8 +220,4 @@
 
     va_list argp;
-    psU8  vU8;
-    psF32 vF32;
-    psF64 vF64;
-    int temp;
 
     if (image == NULL)
@@ -231,38 +227,58 @@
 
     switch (image->type.type) {
-    case PS_TYPE_U8:
-        temp = va_arg (argp, psU32);
-        if ( temp >= PS_MIN_U8 && temp <= PS_MAX_U8 )
-            vU8 = temp;
-        else {
-            psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Error:  U8 Value out of Range.\n");
-            return false;
+        #define IMAGEINIT_INTCASE(TTT,NATIVETYPE) \
+    case PS_TYPE_##TTT: { \
+            NATIVETYPE temp = va_arg (argp, NATIVETYPE); \
+            if ( temp < PS_MIN_##TTT || temp > PS_MAX_##TTT ) { \
+                psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Error: Value out of Range.\n"); \
+                return false; \
+            } \
+            ps##TTT value = temp; \
+            for (int iy = 0; iy < image->numRows; iy++) { \
+                ps##TTT *row = image->data.TTT[iy]; \
+                for (int ix = 0; ix < image->numCols; ix++) { \
+                    row[ix] = value; \
+                } \
+            } \
+            return (true); \
         }
-        for (int iy = 0; iy < image->numRows; iy++) {
-            for (int ix = 0; ix < image->numCols; ix++) {
-                image->data.U8[iy][ix] = vU8;
-            }
+
+        IMAGEINIT_INTCASE(U8,unsigned int)
+        IMAGEINIT_INTCASE(U16,unsigned int)
+        IMAGEINIT_INTCASE(U32,unsigned int)
+        IMAGEINIT_INTCASE(S8,int)
+        IMAGEINIT_INTCASE(S16,int)
+        IMAGEINIT_INTCASE(S32,int)
+
+        #define IMAGEINIT_LONGCASE(TTT,NATIVETYPE) \
+    case PS_TYPE_##TTT: { \
+            ps##TTT value = va_arg (argp, NATIVETYPE); \
+            for (int iy = 0; iy < image->numRows; iy++) { \
+                ps##TTT *row = image->data.TTT[iy]; \
+                for (int ix = 0; ix < image->numCols; ix++) { \
+                    row[ix] = value; \
+                } \
+            } \
+            return (true); \
         }
-        return (true);
-
-    case PS_TYPE_F32:
-        vF32 = va_arg (argp, psF64);
-
-        for (int iy = 0; iy < image->numRows; iy++) {
-            for (int ix = 0; ix < image->numCols; ix++) {
-                image->data.F32[iy][ix] = vF32;
-            }
+
+        IMAGEINIT_LONGCASE(U64,unsigned long)
+        IMAGEINIT_LONGCASE(S64,long)
+
+        #define IMAGEINIT_FLOATCASE(TTT) \
+    case PS_TYPE_##TTT: { \
+            ps##TTT value = va_arg(argp, psF64); \
+            \
+            for (int iy = 0; iy < image->numRows; iy++) { \
+                ps##TTT *row = image->data.TTT[iy]; \
+                for (int ix = 0; ix < image->numCols; ix++) { \
+                    row[ix] = value; \
+                } \
+            } \
+            return (true); \
         }
-        return (true);
-
-    case PS_TYPE_F64:
-        vF64 = va_arg (argp, psF64);
-
-        for (int iy = 0; iy < image->numRows; iy++) {
-            for (int ix = 0; ix < image->numCols; ix++) {
-                image->data.F64[iy][ix] = vF64;
-            }
-        }
-        return (true);
+
+        IMAGEINIT_FLOATCASE(F32)
+        IMAGEINIT_FLOATCASE(F64)
 
     default:
Index: /trunk/psLib/test/mathtypes/verified/tst_psImage.stderr
===================================================================
--- /trunk/psLib/test/mathtypes/verified/tst_psImage.stderr	(revision 5571)
+++ /trunk/psLib/test/mathtypes/verified/tst_psImage.stderr	(revision 5572)
@@ -122,11 +122,7 @@
 
 <DATE><TIME>|<HOST>|E|psImageInit (FILE:LINENO)
-    Error:  U8 Value out of Range.
+    Error: Value out of Range.
 <DATE><TIME>|<HOST>|E|testImageInit (FILE:LINENO)
     ImageInit failed.  U8 Case - 1x1
-<DATE><TIME>|<HOST>|E|psImageInit (FILE:LINENO)
-    datatype 260 not defined in psImageInit
-<DATE><TIME>|<HOST>|E|testImageInit (FILE:LINENO)
-    ImageInit failed.  S32 Case - 5x5
 
 ---> TESTPOINT PASSED (psImage{psImageInit} | tst_psImage.c)
