swf_SetU16(t,width);
swf_SetU16(t,height);
- if (data=malloc(OUTBUFFER_SIZE))
+ if ((data=malloc(OUTBUFFER_SIZE)))
{ z_stream zs;
memset(&zs,0x00,sizeof(z_stream));
swf_SetU16(t,height);
swf_SetU8(t,ncolors-1); // number of pal entries
- if (data=malloc(OUTBUFFER_SIZE))
+ if ((data=malloc(OUTBUFFER_SIZE)))
{ z_stream zs;
memset(&zs,0x00,sizeof(z_stream));
if (deflateInit(&zs,Z_DEFAULT_COMPRESSION)==Z_OK)
{ U8 * zpal; // compress palette
- if (zpal = malloc(ncolors*4))
+ if ((zpal = malloc(ncolors*4)))
{ U8 * pp = zpal;
int i;
swf_GetU16(t); // condition
- while (a=swf_GetU8(t)) // skip action records
+ while ((a=swf_GetU8(t))) // skip action records
{ if (a&0x80)
{ U16 l = swf_GetU16(t);
swf_GetBlock(t,NULL,l);
//#define SWAP16(s) ((U16) ((U8*)&s)[0] | ((U16) ((U8*)&s)[1] << 8))
//#define SWAP32(s) ((U32) ((U8*)&s)[0] | ((U32) ((U8*)&s)[1] << 8) | ((U32) ((U8*)&s)[2] << 16) | ((U32) ((U8*)&s)[3] << 24))
-#define PUT16(ptr,x) ((U8*)(ptr))[0]=(U8)(x);((U8*)(ptr))[1]=(U8)(x>>8);
-#define PUT32(ptr,x) ((U8*)(ptr))[0]=(U8)(x);((U8*)(ptr))[1]=(U8)(x>>8);((U8*)(ptr))[2]=(U8)(x>>16);((U8*)(ptr))[3]=(U8)(x>>24);
+#define PUT16(ptr,x) ((U8*)(ptr))[0]=(U8)(x);((U8*)(ptr))[1]=(U8)((x)>>8);
+#define PUT32(ptr,x) ((U8*)(ptr))[0]=(U8)(x);((U8*)(ptr))[1]=(U8)((x)>>8);((U8*)(ptr))[2]=(U8)((x)>>16);((U8*)(ptr))[3]=(U8)((x)>>24);
#define GET16(ptr) (((U16)(((U8*)(ptr))[0]))+(((U16)(((U8*)(ptr))[1]))<<8))
#define GET32(ptr) (((U16)(((U8*)(ptr))[0]))+(((U16)(((U8*)(ptr))[1]))<<8)+(((U16)(((U8*)(ptr))[2]))<<16)+(((U16)(((U8*)(ptr))[3]))<<24))
pos += 4;
}
}
- PUT16(pos, (TAGID_END<<6 + 0));
+ PUT16(pos, ((TAGID_END<<6) + 0));
*masterlength = pos - *masterdata;
PUT32(fixpos, *masterlength);
}