| 3981 | #define stb__in4(x) ((i[x] << 24) + stb__in3((x)+1)) |
| 3982 | |
| 3983 | static const unsigned char *stb_decompress_token(const unsigned char *i) |
| 3984 | { |
| 3985 | if (*i >= 0x20) { // use fewer if's for cases that expand small |
| 3986 | if (*i >= 0x80) stb__match(stb__dout-i[1]-1, i[0] - 0x80 + 1), i += 2; |
| 3987 | else if (*i >= 0x40) stb__match(stb__dout-(stb__in2(0) - 0x4000 + 1), i[2]+1), i += 3; |
| 3988 | else /* *i >= 0x20 */ stb__lit(i+1, i[0] - 0x20 + 1), i += 1 + (i[0] - 0x20 + 1); |
| 3989 | } else { // more ifs for cases that expand large, since overhead is amortized |
| 3990 | if (*i >= 0x18) stb__match(stb__dout-(stb__in3(0) - 0x180000 + 1), i[3]+1), i += 4; |
| 3991 | else if (*i >= 0x10) stb__match(stb__dout-(stb__in3(0) - 0x100000 + 1), stb__in2(3)+1), i += 5; |
| 3992 | else if (*i >= 0x08) stb__lit(i+2, stb__in2(0) - 0x0800 + 1), i += 2 + (stb__in2(0) - 0x0800 + 1); |
| 3993 | else if (*i == 0x07) stb__lit(i+3, stb__in2(1) + 1), i += 3 + (stb__in2(1) + 1); |
| 3994 | else if (*i == 0x06) stb__match(stb__dout-(stb__in3(1)+1), i[4]+1), i += 5; |
| 3995 | else if (*i == 0x04) stb__match(stb__dout-(stb__in3(1)+1), stb__in2(4)+1), i += 6; |
| 3996 | } |
| 3997 | return i; |
| 3998 | } |
| 3999 | |
| 4000 | static unsigned int stb_adler32(unsigned int adler32, unsigned char *buffer, unsigned int buflen) |
| 4001 | { |
no test coverage detected