about summary refs log tree commit diff
path: root/converter/other/rasttopnm.c
diff options
context:
space:
mode:
Diffstat (limited to 'converter/other/rasttopnm.c')
-rw-r--r--converter/other/rasttopnm.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/converter/other/rasttopnm.c b/converter/other/rasttopnm.c
index 285fc5e0..bc199ef7 100644
--- a/converter/other/rasttopnm.c
+++ b/converter/other/rasttopnm.c
@@ -37,9 +37,7 @@ parseCommandLine(int argc, const char ** argv,
    Note that the file spec array we return is stored in the storage that
    was passed to us as the argv array.
 -----------------------------------------------------------------------------*/
-    optEntry * option_def;
-        /* Instructions to OptParseOptions2 on how to parse our options.
-         */
+    optEntry * option_def;   /* Used by OPTENT3 */
     optStruct3 opt;
 
     unsigned int option_def_index;
@@ -47,7 +45,7 @@ parseCommandLine(int argc, const char ** argv,
     MALLOCARRAY_NOFAIL(option_def, 100);
 
     option_def_index = 0;   /* incremented by OPTENT3 */
- 
+
     opt.opt_table = option_def;
     opt.short_allowed = false;  /* We have no short (old-fashioned) options */
     opt.allowNegNum = false;  /* We have no parms that are negative numbers */
@@ -59,10 +57,10 @@ parseCommandLine(int argc, const char ** argv,
     OPTENT3(0,   "dumpcolormap", OPT_FLAG,   NULL,
             &cmdlineP->dumpcolormap,   0);
 
-    pm_optParseOptions3(&argc, (char **)argv, opt, sizeof(opt), 0);
+    pm_optParseOptions4(&argc, argv, opt, sizeof(opt), 0);
         /* Uses and sets argc, argv, and some of *cmdlineP and others. */
 
-    if (argc-1 == 0) 
+    if (argc-1 == 0)
         cmdlineP->inputFileName = "-";
     else if (argc-1 != 1)
         pm_error("Program takes zero or one argument (filename).  You "
@@ -258,7 +256,7 @@ convertRowDepth8(const unsigned char * const lineStart,
 
         ++byteP;
     }
-} 
+}
 
 
 
@@ -299,7 +297,7 @@ convertRowRgb(const unsigned char * const lineStart,
         else
             PPM_ASSIGN(xelrow[col], r, g, b);
     }
-} 
+}
 
 
 
@@ -387,9 +385,9 @@ dumpHeader(struct rasterfile const header) {
 
 
 static void
-dumpHeaderAnalysis(bool         const grayscale, 
+dumpHeaderAnalysis(bool         const grayscale,
                    unsigned int const depth,
-                   xel          const zero, 
+                   xel          const zero,
                    xel          const one) {
 
     pm_message("grayscale: %s", grayscale ? "YES" : "NO");
@@ -464,9 +462,9 @@ main(int argc, const char ** const argv) {
 
     if (header.ras_maplength != 0) {
         int rc;
-        
+
         rc = pr_load_colormap(ifP, &header, &colorMap);
-        
+
         if (rc != 0 )
             pm_error("unable to read colormap from RAST file");
 
@@ -488,7 +486,7 @@ main(int argc, const char ** const argv) {
                  "but this is not a color mapped image");
 
     writePnm(stdout, pr, header.ras_width, header.ras_height, maxval, format,
-             header.ras_depth, header.ras_type, grayscale, 
+             header.ras_depth, header.ras_type, grayscale,
              header.ras_maplength > 0, colorMap, zero, one, cmdline.index);
 
     pm_close(ifP);
@@ -496,3 +494,6 @@ main(int argc, const char ** const argv) {
 
     return 0;
 }
+
+
+