about summary refs log tree commit diff
path: root/converter/other/pnmtops.c
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2010-10-24 17:43:44 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2010-10-24 17:43:44 +0000
commit9c4f5b0e8d380cd2d908534c18bc9d9316bcb056 (patch)
tree08baa9d221d3ecca96aa6999e05214c3dcda5e25 /converter/other/pnmtops.c
parentcbd5385ea11b9b4816cc82bdd5ff47377367d4ef (diff)
downloadnetpbm-mirror-9c4f5b0e8d380cd2d908534c18bc9d9316bcb056.tar.gz
netpbm-mirror-9c4f5b0e8d380cd2d908534c18bc9d9316bcb056.tar.xz
netpbm-mirror-9c4f5b0e8d380cd2d908534c18bc9d9316bcb056.zip
cleanup
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@1350 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter/other/pnmtops.c')
-rw-r--r--converter/other/pnmtops.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/converter/other/pnmtops.c b/converter/other/pnmtops.c
index 76979459..2d513853 100644
--- a/converter/other/pnmtops.c
+++ b/converter/other/pnmtops.c
@@ -813,16 +813,17 @@ static void
 setupReadstringNative(bool         const rle,
                       bool         const color,
                       unsigned int const icols, 
-                      unsigned int const bps) {
+                      unsigned int const bitsPerSample) {
 /*----------------------------------------------------------------------------
    Write to Standard Output statements to define /readstring and also
    arguments for it (/picstr or /rpicstr, /gpicstr, and /bpicstr).
 -----------------------------------------------------------------------------*/
-    unsigned int const bytesPerRow = icols / (8/bps) +
-        (icols % (8/bps) > 0 ? 1 : 0);
+    unsigned int const bytesPerRow = icols / (8/bitsPerSample) +
+        (icols % (8/bitsPerSample) > 0 ? 1 : 0);
         /* Size of row buffer, padded up to byte boundary.
 
-           A more straightforward calculation would be (icols * bps +7) / 8, 
+           A more straightforward calculation would be
+             (icols * bitsPerSample + 7) / 8 ,
            but this overflows when icols is large.
         */
 
@@ -878,7 +879,7 @@ putSetup(unsigned int const dictSize,
          bool         const rle,
          bool         const color,
          unsigned int const icols,
-         unsigned int const bps) {
+         unsigned int const bitsPerSample) {
 /*----------------------------------------------------------------------------
    Put the setup section in the Postscript program on Standard Output.
 -----------------------------------------------------------------------------*/
@@ -889,7 +890,7 @@ putSetup(unsigned int const dictSize,
         printf("%u dict begin\n", dictSize);
     
     if (!psFilter)
-        setupReadstringNative(rle, color, icols, bps);
+        setupReadstringNative(rle, color, icols, bitsPerSample);
 
     printf("%%%%EndSetup\n");
 }
@@ -956,7 +957,7 @@ putInit(unsigned int const postscriptLevel,
         float        const srows,
         float        const llx, 
         float        const lly,
-        int          const bps,
+        int          const bitsPerSample,
         int          const pagewid, 
         int          const pagehgt,
         bool         const color, 
@@ -988,7 +989,7 @@ putInit(unsigned int const postscriptLevel,
         (int) (llx + scols + 0.5), (int) (lly + srows + 0.5));
     printf("%%%%EndComments\n");
 
-    putSetup(dictSize, psFilter, rle, color, icols, bps);
+    putSetup(dictSize, psFilter, rle, color, icols, bitsPerSample);
 
     printf("%%%%Page: 1 1\n");
     if (setpage)
@@ -999,7 +1000,7 @@ putInit(unsigned int const postscriptLevel,
     printf("%g %g scale\n", scols, srows);
     if (turned)
         printf("0.5 0.5 translate  90 rotate  -0.5 -0.5 translate\n");
-    printf("%d %d %d\n", icols, irows, bps);
+    printf("%d %d %d\n", icols, irows, bitsPerSample);
     printf("[ %d 0 0 -%d 0 %d ]\n", icols, irows, irows);
 
     if (psFilter)