about summary refs log tree commit diff
path: root/converter/pbm/pbmtoepson.c
diff options
context:
space:
mode:
Diffstat (limited to 'converter/pbm/pbmtoepson.c')
-rw-r--r--converter/pbm/pbmtoepson.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/converter/pbm/pbmtoepson.c b/converter/pbm/pbmtoepson.c
index 122a438f..293167ac 100644
--- a/converter/pbm/pbmtoepson.c
+++ b/converter/pbm/pbmtoepson.c
@@ -1,7 +1,7 @@
 /* pbmtoeps.c - read a PBM image and produce Epson graphics
 **
 ** Copyright (C) 1990 by John Tiller (tiller@galois.msfc.nasa.gov)
-**			 and Jef Poskanzer.
+**                       and Jef Poskanzer.
 **
 ** Permission to use, copy, modify, and distribute this software and its
 ** documentation for any purpose and without fee is hereby granted, provided
@@ -42,12 +42,12 @@ struct CmdlineInfo {
 
 
 static void
-parseCommandLine(int                  argc, 
+parseCommandLine(int                  argc,
                  const char **        argv,
                  struct CmdlineInfo * cmdlineP ) {
 /*----------------------------------------------------------------------------
    Parse program command line described in Unix standard form by argc
-   and argv.  Return the information in the options as *cmdlineP.  
+   and argv.  Return the information in the options as *cmdlineP.
 
    If command line is internally inconsistent (invalid options, etc.),
    issue error message to stderr and abort program.
@@ -55,11 +55,8 @@ parseCommandLine(int                  argc,
    Note that the strings we return are stored in the storage that
    was passed to us as the argv array.  We also trash *argv.
 -----------------------------------------------------------------------------*/
-    optEntry *option_def;
-        /* Instructions to pm_optParseOptions3 on how to parse our options.
-         */
+    optEntry * option_def;
     optStruct3 opt;
-
     unsigned int option_def_index;
 
     char * protocol;
@@ -82,7 +79,7 @@ parseCommandLine(int                  argc,
     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. */
 
 
@@ -107,7 +104,7 @@ parseCommandLine(int                  argc,
                      "Only recognized values are 'escp9' and 'escp'",
                      protocol);
     }
-    
+
     if (adjacentSpec && nonadjacentSpec)
         pm_error("You can't specify both -adjacent and -nonadjacent");
     else if (adjacentSpec)
@@ -143,7 +140,7 @@ lineWidth(const bit ** const stripeBits,
 -----------------------------------------------------------------------------*/
     unsigned int col;
     unsigned int endSoFar;
-    
+
     endSoFar = 0;
 
     for (col = 0; col < cols; ++ col) {
@@ -177,14 +174,14 @@ printStripe(const bit ** const stripeBits,
 
     /* Print header of Select Bit Image command */
     printf("%c%c%c%c%c", esc, '*', m, cols % 256, cols / 256);
-    
+
     /* Print the data part of the Select Bit Image command */
     for (col = 0; col < cols; ++col) {
         unsigned int stripeRow;
         int val;
-        
+
         val = 0;
-        for (stripeRow = 0; stripeRow < stripeRows; ++stripeRow) 
+        for (stripeRow = 0; stripeRow < stripeRows; ++stripeRow)
             if (stripeBits[stripeRow][col] == PBM_BLACK)
                 val |= (1 << (8-1-stripeRow));
         putchar(val);
@@ -213,7 +210,7 @@ computeM(enum epsonProtocol const protocol,
             }
         }
         break;
-    case 60: 
+    case 60:
         if (adjacence == ADJACENT_NO)
             pm_error("You can't print at %u dpi "
                      "with adjacent dot printing", dpi);
@@ -236,7 +233,7 @@ computeM(enum epsonProtocol const protocol,
         break;
     case 72:
         if (protocol != ESCP9)
-            pm_error("%u dpi is possible only with the ESC/P 9-pin protocol", 
+            pm_error("%u dpi is possible only with the ESC/P 9-pin protocol",
                      dpi);
         if (adjacence == ADJACENT_NO)
             pm_error("You can't print at %u dpi "
@@ -251,7 +248,7 @@ computeM(enum epsonProtocol const protocol,
         break;
     case 144:
         if (protocol != ESCP9)
-            pm_error("%u dpi is possible only with the ESC/P 9-pin protocol", 
+            pm_error("%u dpi is possible only with the ESC/P 9-pin protocol",
                      dpi);
         if (adjacence == ADJACENT_NO)
             pm_error("You can't print at %u dpi "
@@ -273,13 +270,13 @@ convertToEpson(const bit **       const bits,
                enum epsonProtocol const protocol,
                unsigned int       const dpi,
                enum adjacence     const adjacence) {
-    
+
     unsigned int const rowsPerStripe = 8;
     unsigned int const stripeCt = (rows + rowsPerStripe-1) / rowsPerStripe;
 
     unsigned int stripe;
     char m;
-    
+
     computeM(protocol, dpi, adjacence, &m);
 
     /* Change line spacing to 8/72 inches. */
@@ -292,10 +289,10 @@ convertToEpson(const bit **       const bits,
 
     for (stripe = 0; stripe < stripeCt; ++stripe) {
         const bit ** const stripeBits = &bits[stripe*rowsPerStripe];
-        unsigned int const stripeRows = 
+        unsigned int const stripeRows =
             MIN(rowsPerStripe, rows - stripe * rowsPerStripe);
             /* Number of rows in this stripe (8 for all but bottom stripe) */
-        
+
         unsigned int const endcol = lineWidth(stripeBits, cols, stripeRows);
             /* Column where right margin (contiguous white area at right
                end of stripe) begins.  Zero if entire stripe is white.
@@ -332,10 +329,13 @@ main(int argc, const char ** argv) {
 
     pm_close(ifP);
 
-    convertToEpson(bits, cols, rows, 
+    convertToEpson(bits, cols, rows,
                    cmdline.protocol, cmdline.dpi, cmdline.adjacence);
 
     pbm_freearray(bits, rows);
 
     return 0;
 }
+
+
+