From 7d45cf5a1dbe9d34f9fb18e2f485efda83019493 Mon Sep 17 00:00:00 2001 From: Mark Adler Date: Sat, 11 Feb 2012 00:26:38 -0800 Subject: Use optimized byte swap operations for Microsoft and GNU [Snyder]. --- inflate.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'inflate.c') diff --git a/inflate.c b/inflate.c index 0885c1d..70cd7d9 100644 --- a/inflate.c +++ b/inflate.c @@ -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; -- cgit v1.2.3-55-g6feb