diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2019-06-15 17:51:35 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2019-06-15 17:51:35 +0000 |
commit | b13ba8b9b606c916e0bda39348ee009e920df22e (patch) | |
tree | 678c2212e125e66e0a868773e2b4ec460794da4e /converter | |
parent | 7a5291a126732a4ca220a79cfe5e6763e71ace73 (diff) | |
download | netpbm-mirror-b13ba8b9b606c916e0bda39348ee009e920df22e.tar.gz netpbm-mirror-b13ba8b9b606c916e0bda39348ee009e920df22e.tar.xz netpbm-mirror-b13ba8b9b606c916e0bda39348ee009e920df22e.zip |
Releaes 10.86.04
git-svn-id: http://svn.code.sf.net/p/netpbm/code/advanced@3632 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter')
-rw-r--r-- | converter/pbm/pbmtozinc.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/converter/pbm/pbmtozinc.c b/converter/pbm/pbmtozinc.c index 66ec5582..a89b8c9f 100644 --- a/converter/pbm/pbmtozinc.c +++ b/converter/pbm/pbmtozinc.c @@ -92,7 +92,9 @@ packer_init(Packer * const packerP) { static void -packer_putitem(Packer * const packerP) { +packer_putitem(Packer * const packerP, + unsigned char const hi, + unsigned char const lo) { if (packerP->firstitem) packerP->firstitem = 0; @@ -107,7 +109,8 @@ packer_putitem(Packer * const packerP) { putchar(' '); ++packerP->itemsperline; - printf ("0x%02x%02x", packerP->item & 255, packerP->item >> 8); + + printf ("0x%02x%02x", hi, lo); } @@ -119,7 +122,7 @@ writeRaster(FILE * const ifP, unsigned int const cols, int const format) { - bit * const bitrow = pbm_allocrow_packed(cols + 8); + unsigned char * const bitrow = pbm_allocrow_packed(cols + 8); Packer packer; unsigned int row; @@ -129,7 +132,6 @@ writeRaster(FILE * const ifP, bitrow[pbm_packed_bytes(cols+8) -1 ] = 0x00; for (row = 0; row < rows; ++row) { - uint16_t * const itemrow = (uint16_t *) bitrow; unsigned int const itemCt = (cols + 15 ) / 16; unsigned int i; @@ -139,8 +141,7 @@ writeRaster(FILE * const ifP, pbm_cleanrowend_packed(bitrow, cols); for (i = 0; i < itemCt; ++i) { - packer.item = itemrow[i]; - packer_putitem(&packer); + packer_putitem(&packer, bitrow[2*i+0], bitrow[2*i+1]); } } pbm_freerow_packed(bitrow); |