diff options
author | Mark Adler <madler@alumni.caltech.edu> | 2012-02-11 00:26:38 -0800 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2012-02-11 00:26:38 -0800 |
commit | 7d45cf5a1dbe9d34f9fb18e2f485efda83019493 (patch) | |
tree | 290e01d92e398389e83c943ca26e4c9201d3a5bb /inflate.c | |
parent | 1a4ba8cd912466fe538f62d61fbcc25eead6d31a (diff) | |
download | zlib-7d45cf5a1dbe9d34f9fb18e2f485efda83019493.tar.gz |
Use optimized byte swap operations for Microsoft and GNU [Snyder].
Diffstat (limited to 'inflate.c')
-rw-r--r-- | inflate.c | 9 |
1 files changed, 2 insertions, 7 deletions
@@ -519,11 +519,6 @@ unsigned out; bits -= bits & 7; \ } while (0) -/* Reverse the bytes in a 32-bit value */ -#define REVERSE(q) \ - ((((q) >> 24) & 0xff) + (((q) >> 8) & 0xff00) + \ - (((q) & 0xff00) << 8) + (((q) & 0xff) << 24)) - /* inflate() uses a state machine to process as much input data and generate as much output data as possible before returning. The state machine is @@ -817,7 +812,7 @@ int flush; #endif case DICTID: NEEDBITS(32); - strm->adler = state->check = REVERSE(hold); + strm->adler = state->check = ZSWAP32(hold); INITBITS(); state->mode = DICT; case DICT: @@ -1189,7 +1184,7 @@ int flush; #ifdef GUNZIP state->flags ? hold : #endif - REVERSE(hold)) != state->check) { + ZSWAP32(hold)) != state->check) { strm->msg = (char *)"incorrect data check"; state->mode = BAD; break; |