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 ...
This commit is contained in:
Gered 2019-11-06 19:08:15 -05:00
parent 29efe17506
commit b39bee7609

View file

@ -55,7 +55,7 @@ unsigned char *AckReadPCX(char *filename)
{ {
long i; long i;
int mode=NORMAL,nbytes; int mode=NORMAL,nbytes;
char abyte,*p; UCHAR abyte,*p;
FILE *f; FILE *f;
PcxFile *pcx; PcxFile *pcx;
@ -105,14 +105,14 @@ if (pcx->bitmap == NULL)
ErrorCode = ERR_NOMEMORY; ErrorCode = ERR_NOMEMORY;
return(NULL); return(NULL);
} }
p=(char*)&pcx->bitmap[4]; p=&pcx->bitmap[4];
for (i=0;i<pcx->imagebytes;i++) for (i=0;i<pcx->imagebytes;i++)
{ {
if(mode == NORMAL) if(mode == NORMAL)
{ {
abyte=fgetc(f); abyte=fgetc(f);
if ((unsigned char)abyte > 0xbf) if (abyte > 0xbf)
{ {
nbytes=abyte & 0x3f; nbytes=abyte & 0x3f;
abyte=fgetc(f); abyte=fgetc(f);
@ -127,14 +127,14 @@ for (i=0;i<pcx->imagebytes;i++)
fseek(f,-768L,SEEK_END); // get palette from pcx file fseek(f,-768L,SEEK_END); // get palette from pcx file
fread(colordat,768,1,f); fread(colordat,768,1,f);
p=(char*)colordat; p=colordat;
for (i=0;i<768;i++) // bit shift palette for (i=0;i<768;i++) // bit shift palette
*p++=*p >>2; *p++=*p >>2;
if (!rsHandle) if (!rsHandle)
fclose(f); fclose(f);
p = (char*)pcx->bitmap; p = pcx->bitmap;
(*(short *)p) = pcx->width; (*(short *)p) = pcx->width;
p += sizeof(short); p += sizeof(short);
(*(short *)p) = pcx->height; (*(short *)p) = pcx->height;