| 4040 | #define stb__in4(x) ((i[x] << 24) + stb__in3((x)+1)) |
| 4041 | |
| 4042 | static const unsigned char* stb_decompress_token(const unsigned char* i) |
| 4043 | { |
| 4044 | if (*i >= 0x20) { // use fewer if's for cases that expand small |
| 4045 | if (*i >= 0x80) stb__match(stb__dout - i[1] - 1, i[0] - 0x80 + 1), i += 2; |
| 4046 | else if (*i >= 0x40) stb__match(stb__dout - (stb__in2(0) - 0x4000 + 1), i[2] + 1), i += 3; |
| 4047 | else /* *i >= 0x20 */ stb__lit(i + 1, i[0] - 0x20 + 1), i += 1 + (i[0] - 0x20 + 1); |
| 4048 | } |
| 4049 | else { // more ifs for cases that expand large, since overhead is amortized |
| 4050 | if (*i >= 0x18) stb__match(stb__dout - (stb__in3(0) - 0x180000 + 1), i[3] + 1), i += 4; |
| 4051 | else if (*i >= 0x10) stb__match(stb__dout - (stb__in3(0) - 0x100000 + 1), stb__in2(3) + 1), i += 5; |
| 4052 | else if (*i >= 0x08) stb__lit(i + 2, stb__in2(0) - 0x0800 + 1), i += 2 + (stb__in2(0) - 0x0800 + 1); |
| 4053 | else if (*i == 0x07) stb__lit(i + 3, stb__in2(1) + 1), i += 3 + (stb__in2(1) + 1); |
| 4054 | else if (*i == 0x06) stb__match(stb__dout - (stb__in3(1) + 1), i[4] + 1), i += 5; |
| 4055 | else if (*i == 0x04) stb__match(stb__dout - (stb__in3(1) + 1), stb__in2(4) + 1), i += 6; |
| 4056 | } |
| 4057 | return i; |
| 4058 | } |
| 4059 | |
| 4060 | static unsigned int stb_adler32(unsigned int adler32, unsigned char* buffer, unsigned int buflen) |
| 4061 | { |
no test coverage detected