Skip to content
Myr

allow STBIW_CRC32 override default crc32

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by jarnoh · committed by jarnoh · parent e6afb9c · Browse files · 1 file+4 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+4 added−0 removed

  • other:+4 added−0 removed

1 file+4 added−0 removed

modified:stb_image_write.h+4 added
921 unmodified lines
922}923924static unsigned int stbiw__crc32(unsigned char *buffer, int len)925{926#ifdef STBIW_CRC32927 return STBIW_CRC32(buffer, len);928#else929 static unsigned int crc_table[256] =930 {931 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3,932 0x0eDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91,
33 unmodified lines
966 int i;967 for (i=0; i < len; ++i)968 crc = (crc >> 8) ^ crc_table[buffer[i] ^ (crc & 0xff)];969 return ~crc;970#endif971}972973#define stbiw__wpng4(o,a,b,c,d) ((o)[0]=STBIW_UCHAR(a),(o)[1]=STBIW_UCHAR(b),(o)[2]=STBIW_UCHAR(c),(o)[3]=STBIW_UCHAR(d),(o)+=4)974#define stbiw__wp32(data,v) stbiw__wpng4(data, (v)>>24,(v)>>16,(v)>>8,(v));
598 unmodified lines