Skip to content

Commit

Permalink
Let deflate_medium be enabled by default.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dead2 committed Jan 21, 2019
1 parent 18d2622 commit 24772ef
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Expand Up @@ -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()

#
Expand Down
6 changes: 3 additions & 3 deletions configure
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions deflate.c
Expand Up @@ -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);
Expand Down Expand Up @@ -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},
Expand Down
2 changes: 1 addition & 1 deletion deflate_medium.c
Expand Up @@ -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"
Expand Down

0 comments on commit 24772ef

Please sign in to comment.