From 39630716d78c27714aa1827a92f12c29f2ab66fd Mon Sep 17 00:00:00 2001 From: "yann.collet.73@gmail.com" Date: Fri, 9 Dec 2011 13:59:59 +0000 Subject: Endianess correction git-svn-id: https://lz4.googlecode.com/svn/trunk@42 650e7d94-2a16-8b24-b05c-7c0b3f6821cd --- Makefile | 4 ++-- lz4.c | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 06e4d9e..bd0a567 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,10 @@ all: lz4demo64 lz4demo32 lz4demo64: lz4.c lz4.h lz4demo.c - gcc -g -O3 -I. -std=c99 -Wall -W lz4.c lz4demo.c -o lz4demo64.exe + gcc -g -O3 -I. -std=c99 -Wall -W -Wno-implicit-function-declaration lz4.c lz4demo.c -o lz4demo64.exe lz4demo32: lz4.c lz4.h lz4demo.c - gcc -m32 -g -O3 -I. -std=c99 -Wall -W lz4.c lz4demo.c -o lz4demo32.exe + gcc -m32 -g -O3 -I. -std=c99 -Wall -W -Wno-implicit-function-declaration lz4.c lz4demo.c -o lz4demo32.exe clean: rm -f core *.o lz4demo32.exe lz4demo64.exe diff --git a/lz4.c b/lz4.c index 92fe61a..8041552 100644 --- a/lz4.c +++ b/lz4.c @@ -230,9 +230,15 @@ _next_match: anchor = ip; while (ip> 27]; +#else + if (A32(ref) == A32(ip)) { ip+=4; ref+=4; continue; } + if (A16(ref) == A16(ip)) { ip+=2; ref+=2; } + if (*ref == *ip) ip++; +#endif goto _endCount; } if ((ip<(matchlimit-1)) && (A16(ref) == A16(ip))) { ip+=2; ref+=2; } @@ -371,9 +377,15 @@ _next_match: anchor = ip; while (ip> 27]; +#else + if (A32(ref) == A32(ip)) { ip+=4; ref+=4; continue; } + if (A16(ref) == A16(ip)) { ip+=2; ref+=2; } + if (*ref == *ip) ip++; +#endif goto _endCount; } if ((ip<(matchlimit-1)) && (A16(ref) == A16(ip))) { ip+=2; ref+=2; } -- cgit v0.12