From 62c39e2445023183f34ae65faaa16a5b80ea8bda Mon Sep 17 00:00:00 2001 From: "yann.collet.73@gmail.com" Date: Thu, 17 Nov 2011 23:07:28 +0000 Subject: [PATCH] Modified makefile to specify C99 support to compiler (GCC) Slightly improved compression speed in small packet mode git-svn-id: https://lz4.googlecode.com/svn/trunk@39 650e7d94-2a16-8b24-b05c-7c0b3f6821cd --- Makefile | 4 ++-- lz4.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 7c65bf6..06e4d9e 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,10 @@ all: lz4demo64 lz4demo32 lz4demo64: lz4.c lz4.h lz4demo.c - gcc -g -O3 -I. -Wall -W lz4.c lz4demo.c -o lz4demo64.exe + gcc -g -O3 -I. -std=c99 -Wall -W lz4.c lz4demo.c -o lz4demo64.exe lz4demo32: lz4.c lz4.h lz4demo.c - gcc -m32 -g -O3 -I. -Wall -W lz4.c lz4demo.c -o lz4demo32.exe + gcc -m32 -g -O3 -I. -std=c99 -Wall -W 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 804d622..3a94f99 100644 --- a/lz4.c +++ b/lz4.c @@ -378,7 +378,7 @@ _endCount: // Test next position ref = base + HashTable[LZ4_HASH64K_VALUE(ip)]; HashTable[LZ4_HASH64K_VALUE(ip)] = ip - base; - if ((ref > ip - (MAX_DISTANCE + 1)) && (A32(ref) == A32(ip))) { token = op++; *token=0; goto _next_match; } + if (A32(ref) == A32(ip)) { token = op++; *token=0; goto _next_match; } // Prepare next loop anchor = ip++; -- 2.7.4