From b39bee760988ba2e9f10f718652b7f326d0885aa Mon Sep 17 00:00:00 2001 From: gered Date: Wed, 6 Nov 2019 19:08:15 -0500 Subject: [PATCH] this should've just been declared unsigned instead of always casting it everywhere. of course there are many places in this codebase where this kind of thing is done ... --- ack_lib/ACKPCX.C | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ack_lib/ACKPCX.C b/ack_lib/ACKPCX.C index a8bfd64..485d5af 100644 --- a/ack_lib/ACKPCX.C +++ b/ack_lib/ACKPCX.C @@ -55,7 +55,7 @@ unsigned char *AckReadPCX(char *filename) { long i; int mode=NORMAL,nbytes; - char abyte,*p; + UCHAR abyte,*p; FILE *f; PcxFile *pcx; @@ -105,14 +105,14 @@ if (pcx->bitmap == NULL) ErrorCode = ERR_NOMEMORY; return(NULL); } -p=(char*)&pcx->bitmap[4]; +p=&pcx->bitmap[4]; for (i=0;iimagebytes;i++) { if(mode == NORMAL) { abyte=fgetc(f); - if ((unsigned char)abyte > 0xbf) + if (abyte > 0xbf) { nbytes=abyte & 0x3f; abyte=fgetc(f); @@ -127,14 +127,14 @@ for (i=0;iimagebytes;i++) fseek(f,-768L,SEEK_END); // get palette from pcx file fread(colordat,768,1,f); -p=(char*)colordat; +p=colordat; for (i=0;i<768;i++) // bit shift palette *p++=*p >>2; if (!rsHandle) fclose(f); -p = (char*)pcx->bitmap; +p = pcx->bitmap; (*(short *)p) = pcx->width; p += sizeof(short); (*(short *)p) = pcx->height;