From b0a38e92add12a0bf87678a610020e7fa7e90420 Mon Sep 17 00:00:00 2001 From: giraffedata Date: Wed, 13 Mar 2024 18:07:35 +0000 Subject: cleanup git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4874 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- converter/other/infotopam.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/converter/other/infotopam.c b/converter/other/infotopam.c index 59fcbc75..bf5391b5 100644 --- a/converter/other/infotopam.c +++ b/converter/other/infotopam.c @@ -300,17 +300,16 @@ addBitplane(unsigned char * const icon, Add bitplane to existing icon image -----------------------------------------------------------------------------*/ unsigned int i; - unsigned int j; - - for (i = j = 0; i < bpsize; ++i, j += 8) { - icon[j+0] = (icon[j+0] << 1) | ((buff[i] >> 7) & 0x01); - icon[j+1] = (icon[j+1] << 1) | ((buff[i] >> 6) & 0x01); - icon[j+2] = (icon[j+2] << 1) | ((buff[i] >> 5) & 0x01); - icon[j+3] = (icon[j+3] << 1) | ((buff[i] >> 4) & 0x01); - icon[j+4] = (icon[j+4] << 1) | ((buff[i] >> 3) & 0x01); - icon[j+5] = (icon[j+5] << 1) | ((buff[i] >> 2) & 0x01); - icon[j+6] = (icon[j+6] << 1) | ((buff[i] >> 1) & 0x01); - icon[j+7] = (icon[j+7] << 1) | ((buff[i] >> 0) & 0x01); + + for (i = 0; i < bpsize; ++i) { + icon[(i*8)+0] = (icon[(i*8)+0] << 1) | ((buff[i] >> 7) & 0x01); + icon[(i*8)+1] = (icon[(i*8)+1] << 1) | ((buff[i] >> 6) & 0x01); + icon[(i*8)+2] = (icon[(i*8)+2] << 1) | ((buff[i] >> 5) & 0x01); + icon[(i*8)+3] = (icon[(i*8)+3] << 1) | ((buff[i] >> 4) & 0x01); + icon[(i*8)+4] = (icon[(i*8)+4] << 1) | ((buff[i] >> 3) & 0x01); + icon[(i*8)+5] = (icon[(i*8)+5] << 1) | ((buff[i] >> 2) & 0x01); + icon[(i*8)+6] = (icon[(i*8)+6] << 1) | ((buff[i] >> 1) & 0x01); + icon[(i*8)+7] = (icon[(i*8)+7] << 1) | ((buff[i] >> 0) & 0x01); } } -- cgit 1.4.1