about summary refs log tree commit diff
path: root/converter/ppm/ppmtospu.c
diff options
context:
space:
mode:
Diffstat (limited to 'converter/ppm/ppmtospu.c')
-rw-r--r--converter/ppm/ppmtospu.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/converter/ppm/ppmtospu.c b/converter/ppm/ppmtospu.c
index a6acbaa0..4ba70f02 100644
--- a/converter/ppm/ppmtospu.c
+++ b/converter/ppm/ppmtospu.c
@@ -5,6 +5,7 @@
  *  Copyright (C) 1990, Steve Belczyk
  */
 
+#include <stdbool.h>
 #include <assert.h>
 #include <stdio.h>
 
@@ -48,18 +49,18 @@ parseCommandLine(int argc, const char ** argv,
     MALLOCARRAY_NOFAIL(option_def, 100);
 
     option_def_index = 0;   /* incremented by OPTENT3 */
-    OPTENT3(0,   "d0",       OPT_FLAG,   
+    OPTENT3(0,   "d0",       OPT_FLAG,
             NULL,                       &d0Spec, 0);
-    OPTENT3(0,   "d2",       OPT_FLAG,   
+    OPTENT3(0,   "d2",       OPT_FLAG,
             NULL,                       &d2Spec, 0);
-    OPTENT3(0,   "d4",       OPT_FLAG,   
+    OPTENT3(0,   "d4",       OPT_FLAG,
             NULL,                       &d4Spec, 0);
 
     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 */
+    opt.short_allowed = false;  /* We have no short (old-fashioned) options */
+    opt.allowNegNum = false;  /* We have no parms that are negative numbers */
 
-    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. */
 
 
@@ -72,7 +73,7 @@ parseCommandLine(int argc, const char ** argv,
     else
         cmdlineP->dithflag = 2;
 
-    if (argc-1 < 1) 
+    if (argc-1 < 1)
         cmdlineP->inputFileName = "-";
     else {
         cmdlineP->inputFileName = argv[1];
@@ -129,7 +130,7 @@ findIndex(unsigned int const col,
    Spectrum palette index.
 -----------------------------------------------------------------------------*/
     int r, x1;
-    
+
     x1 = 10 * index;  /* initial value */
     if (index & 0x1)
         x1 -= 5;
@@ -143,7 +144,7 @@ findIndex(unsigned int const col,
 
     if (col >= (x1+160))
         r += 32;
-    
+
     return r;
 }
 
@@ -183,7 +184,7 @@ dither(unsigned int       const row,
         { 0, 2 },
         { 3, 1 }
     };
-    
+
     unsigned int c[3];  /* An element for each plane */
     unsigned int col;
 
@@ -262,7 +263,7 @@ sort(struct PixelType * const pixelType,
             ++i;
         while (pixelType[j-1].popularity > pivot)
             --j;
-        
+
         if (i < j) {
             /* An element not less popular than pivot is to the left of a
                pixel not more popular than pivot, so swap them.  Note that we
@@ -274,7 +275,7 @@ sort(struct PixelType * const pixelType,
             --j;
         }
     }
-    
+
     if (j - left > 1)
         sort(pixelType, left, j);
     if (right - i > 1)
@@ -445,7 +446,7 @@ convertRow(unsigned int       const row,
     /* Mark palette entries as all free */
     for (i = 0; i < 48; ++i)
         palP->pal[row][i] = -1;
-    
+
     /* Mark reserved palette entries */
     palP->pal[row][0]  = palP->pal[row][15] = palP->pal[row][16] = 0;
     palP->pal[row][31] = palP->pal[row][32] = palP->pal[row][47] = 0;
@@ -494,7 +495,7 @@ writeScreen(const short * const screen) {
     /* Write the bitmap */
 
     unsigned int i;
-    
+
     for (i = 0; i < 16000; ++i) {
         char const c0 = 0xff & (screen[i] >> 8);
         char const c1 = 0xff & screen[i];