]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Let deflate_medium be enabled by default.
authorHans Kristian Rosbach <hk-git@circlestorm.org>
Wed, 16 Jan 2019 11:35:34 +0000 (12:35 +0100)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Mon, 21 Jan 2019 09:27:08 +0000 (10:27 +0100)
CMakeLists.txt
configure
deflate.c
deflate_medium.c

index 4f9176ceb00c7dc569787bee9bfefc833abc1123..99524b09e22a7d7f302292ccd6fff93bc9d1b247 100644 (file)
@@ -456,8 +456,8 @@ set(CMAKE_REQUIRED_FLAGS)
 #
 # Enable deflate_medium at level 4-6
 #
-if(WITH_NEW_STRATEGIES)
-    add_definitions(-DMEDIUM_STRATEGY)
+if(NOT WITH_NEW_STRATEGIES)
+    add_definitions(-DNO_MEDIUM_STRATEGY)
 endif()
 
 #
index 355987ed0a47a7e181e74b3c74ef29a5587ce74e..6fd91f84a76cba4d464c5297808a388de9238dc0 100755 (executable)
--- a/configure
+++ b/configure
@@ -921,9 +921,9 @@ else
 fi
 
 # Enable deflate_medium at level 4-6
-if test $without_new_strategies -eq 0; then
-    CFLAGS="${CFLAGS} -DMEDIUM_STRATEGY"
-    SFLAGS="${SFLAGS} -DMEDIUM_STRATEGY"
+if test $without_new_strategies -eq 1; then
+    CFLAGS="${CFLAGS} -DNO_MEDIUM_STRATEGY"
+    SFLAGS="${SFLAGS} -DNO_MEDIUM_STRATEGY"
 fi
 
 fi
index 52d5c11af77e8170acab4cf9daae11a548b803d0..7275120c126d3f17d15fc1244ceb6cc686d1c8b9 100644 (file)
--- a/deflate.c
+++ b/deflate.c
@@ -75,7 +75,7 @@ static void slide_hash            (deflate_state *s);
 static block_state deflate_stored (deflate_state *s, int flush);
 ZLIB_INTERNAL block_state deflate_fast         (deflate_state *s, int flush);
 ZLIB_INTERNAL block_state deflate_quick        (deflate_state *s, int flush);
-#ifdef MEDIUM_STRATEGY
+#ifndef NO_MEDIUM_STRATEGY
 ZLIB_INTERNAL block_state deflate_medium       (deflate_state *s, int flush);
 #endif
 ZLIB_INTERNAL block_state deflate_slow         (deflate_state *s, int flush);
@@ -126,14 +126,14 @@ static const config configuration_table[10] = {
 
 /* 3 */ {4,    6, 32,   32, deflate_fast},
 
-#ifdef MEDIUM_STRATEGY
-/* 4 */ {4,    4, 16,   16, deflate_medium},  /* lazy matches */
-/* 5 */ {8,   16, 32,   32, deflate_medium},
-/* 6 */ {8,   16, 128, 128, deflate_medium},
-#else
+#ifdef NO_MEDIUM_STRATEGY
 /* 4 */ {4,    4, 16,   16, deflate_slow},  /* lazy matches */
 /* 5 */ {8,   16, 32,   32, deflate_slow},
 /* 6 */ {8,   16, 128, 128, deflate_slow},
+#else
+/* 4 */ {4,    4, 16,   16, deflate_medium},  /* lazy matches */
+/* 5 */ {8,   16, 32,   32, deflate_medium},
+/* 6 */ {8,   16, 128, 128, deflate_medium},
 #endif
 
 /* 7 */ {8,   32, 128,  256, deflate_slow},
index 314c3c93e490e92198e25593e0310774e65e0ee0..330d255c875575c448de2b323ae3a0050afbfc7d 100644 (file)
@@ -6,7 +6,7 @@
  *
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
-#ifdef MEDIUM_STRATEGY
+#ifndef NO_MEDIUM_STRATEGY
 #include "zbuild.h"
 #include "deflate.h"
 #include "deflate_p.h"