From: Paul Cruz Date: Tue, 25 Jul 2017 21:08:39 +0000 (-0700) Subject: moved debug statements to a compiler flag X-Git-Tag: v1.3.1^2~13^2^2~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=310c12d07eb5a982fdcd2c025b5e3c98ec181c1b;p=thirdparty%2Fzstd.git moved debug statements to a compiler flag --- diff --git a/contrib/adaptive-compression/Makefile b/contrib/adaptive-compression/Makefile index f2059a193..9bc19ee15 100644 --- a/contrib/adaptive-compression/Makefile +++ b/contrib/adaptive-compression/Makefile @@ -24,6 +24,9 @@ all: adapt datagen adapt: $(ZSTD_FILES) adapt.c $(CC) $(FLAGS) $^ -o $@ +adapt-debug: $(ZSTD_FILES) adapt.c + $(CC) $(FLAGS) -DDEBUG_MODE=2 $^ -o adapt + datagen : $(PRGDIR)/datagen.c datagencli.c $(CC) $(FLAGS) $^ -o $@$(EXT) diff --git a/contrib/adaptive-compression/adapt.c b/contrib/adaptive-compression/adapt.c index fac93d273..d1fe753c9 100644 --- a/contrib/adaptive-compression/adapt.c +++ b/contrib/adaptive-compression/adapt.c @@ -29,7 +29,12 @@ #define CONVERGENCE_LOWER_BOUND 5 #define CLEVEL_DECREASE_COOLDOWN 5 +#ifndef DEBUG_MODE static int g_displayLevel = DEFAULT_DISPLAY_LEVEL; +#else +static int g_displayLevel = DEBUG_MODE; +#endif + static unsigned g_compressionLevel = DEFAULT_COMPRESSION_LEVEL; static UTIL_time_t g_startTime; static size_t g_streamedSize = 0; @@ -949,7 +954,6 @@ static void help() PRINT("\n"); PRINT("Options:\n"); PRINT(" -oFILE : specify the output file name\n"); - PRINT(" -v : display debug information\n"); PRINT(" -i# : provide initial compression level\n"); PRINT(" -h : display help/information\n"); PRINT(" -f : force the compression level to stay constant\n"); @@ -984,9 +988,6 @@ int main(int argCount, const char* argv[]) argument += 2; outFilename = argument; break; - case 'v': - g_displayLevel++; - break; case 'i': argument += 2; g_compressionLevel = readU32FromChar(&argument);