]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Avoid use of DEBUG macro -- change to ZLIB_DEBUG.
authorMark Adler <madler@alumni.caltech.edu>
Wed, 29 Jul 2015 05:44:31 +0000 (22:44 -0700)
committerHans Kristian Rosbach <hk-git@circlestorm.org>
Mon, 6 Feb 2017 13:33:22 +0000 (14:33 +0100)
CMakeLists.txt
Makefile.in
arch/x86/deflate_quick.c
deflate.c
deflate.h
deflate_p.h
treebuild.xml
trees.c
zlib.h
zutil.c
zutil.h

index a099b6cc8433cce361a53e7941935ce032f97773..a6dec89e22cc6f22fc5983974327890049123d38 100644 (file)
@@ -112,6 +112,8 @@ if(HAVE_BUILTIN_CTZL)
     add_definitions(-DHAVE_BUILTIN_CTZL)
 endif()
 
+set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DZLIB_DEBUG")
+
 if(MSVC)
     set(CMAKE_DEBUG_POSTFIX "d")
     add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
index ae7044d11281c5093fadb852c3b6599c483f0ef6..f8bf807195e3509675622930aecfef2bdb6729f6 100644 (file)
@@ -16,7 +16,7 @@ CC=cc
 
 CFLAGS=-O
 #CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
-#CFLAGS=-g -DDEBUG
+#CFLAGS=-g -DZLIB_DEBUG
 #CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
 #           -Wstrict-prototypes -Wmissing-prototypes
 
index 6fc5136ea0f588d3f5ab724e9cde57bd49c11a22..222f39e8ee4a4d0aade92517b17812f07e59c98d 100644 (file)
@@ -19,7 +19,7 @@
 #endif
 #include "deflate.h"
 
-#ifdef DEBUG
+#ifdef ZLIB_DEBUG
 #include <ctype.h>
 #endif
 
index ee803bc8e99a8675da36d864b80d343c79b3602e..e28a9a80639b87a4073506229dc9ee56281e495e 100644 (file)
--- a/deflate.c
+++ b/deflate.c
@@ -1125,7 +1125,7 @@ static void lm_init(deflate_state *s) {
     s->ins_h = 0;
 }
 
-#ifdef DEBUG
+#ifdef ZLIB_DEBUG
 #define EQUAL 0
 /* result of memcmp for equal strings */
 
@@ -1150,7 +1150,7 @@ void check_match(deflate_state *s, IPos start, IPos match, int length) {
 }
 #else
 #  define check_match(s, start, match, length)
-#endif /* DEBUG */
+#endif /* ZLIB_DEBUG */
 
 /* ===========================================================================
  * Fill the window when the lookahead becomes insufficient.
@@ -1576,7 +1576,7 @@ static block_state deflate_huff(deflate_state *s, int flush) {
     return block_done;
 }
 
-#ifdef DEBUG
+#ifdef ZLIB_DEBUG
 /* ===========================================================================
  * Send a value on a given number of bits.
  * IN assertion: length <= 16 and value fits in length bits.
index 8f96203b4917580164f1254aa95e9955dd98f05e..7266e53ff47ecb6b09041df393281c52c77ce580 100644 (file)
--- a/deflate.h
+++ b/deflate.h
@@ -261,7 +261,7 @@ typedef struct internal_state {
     unsigned int matches;         /* number of string matches in current block */
     unsigned int insert;          /* bytes at end of window left to insert */
 
-#ifdef DEBUG
+#ifdef ZLIB_DEBUG
     unsigned long compressed_len; /* total bit length of compressed file mod 2^32 */
     unsigned long bits_sent;      /* bit length of compressed data sent mod 2^32 */
 #endif
@@ -349,7 +349,7 @@ void ZLIB_INTERNAL bi_windup(deflate_state *s);
  * used.
  */
 
-#ifndef DEBUG
+#ifndef ZLIB_DEBUG
 /* Inline versions of _tr_tally for speed: */
 
 # if defined(GEN_TREES_H)
@@ -413,11 +413,11 @@ void ZLIB_INTERNAL bi_windup(deflate_state *s);
 #   define UPDATE_HASH(s, h, i) (h = (((h) << s->hash_shift) ^ (s->window[i + (MIN_MATCH-1)])) & s->hash_mask)
 #endif
 
-#ifndef DEBUG
+#ifndef ZLIB_DEBUG
 #  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
 /* Send a code of the given tree. c and tree must not have side effects */
 
-#else /* DEBUG */
+#else /* ZLIB_DEBUG */
 #  define send_code(s, c, tree) \
     {  if (z_verbose > 2) { \
            fprintf(stderr, "\ncd %3d ", (c)); \
@@ -426,7 +426,7 @@ void ZLIB_INTERNAL bi_windup(deflate_state *s);
      }
 #endif
 
-#ifdef DEBUG
+#ifdef ZLIB_DEBUG
 void send_bits(deflate_state *s, int value, int length);
 #else
 #define send_bits(s, value, length) \
index 6c9957a66676482c710227b3806c2fb725c70e47..3550818aa91b191fe0125e1a13798bd03b99b8da 100644 (file)
@@ -15,7 +15,7 @@
 
 /* Forward declare common non-inlined functions declared in deflate.c */
 
-#ifdef DEBUG
+#ifdef ZLIB_DEBUG
 void check_match(deflate_state *s, IPos start, IPos match, int length);
 #else
 #define check_match(s, start, match, length)
index 38d29d75efc79b94ac7155f6e07acb3e4d8f04c0..34a4f779aa56c452cf00db6a0ef7004c503f7d60 100644 (file)
 <!--
 CFLAGS=-O
 #CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
-#CFLAGS=-g -DDEBUG
+#CFLAGS=-g -DZLIB_DEBUG
 #CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
 #           -Wstrict-prototypes -Wmissing-prototypes
 
diff --git a/trees.c b/trees.c
index d480a9a040b0bfd3f5106fc5a7d0240926cbf756..f10caa4b2cc4a2a709a4daa12a96142988787f4b 100644 (file)
--- a/trees.c
+++ b/trees.c
@@ -36,7 +36,7 @@
 
 #include "deflate.h"
 
-#ifdef DEBUG
+#ifdef ZLIB_DEBUG
 #  include <ctype.h>
 #endif
 
@@ -241,7 +241,7 @@ static void tr_static_init(void) {
  * Genererate the file trees.h describing the static trees.
  */
 #ifdef GEN_TREES_H
-#  ifndef DEBUG
+#  ifndef ZLIB_DEBUG
 #    include <stdio.h>
 #  endif
 
@@ -311,7 +311,7 @@ void ZLIB_INTERNAL _tr_init(deflate_state *s) {
 
     s->bi_buf = 0;
     s->bi_valid = 0;
-#ifdef DEBUG
+#ifdef ZLIB_DEBUG
     s->compressed_len = 0L;
     s->bits_sent = 0L;
 #endif
@@ -798,7 +798,7 @@ void ZLIB_INTERNAL _tr_stored_block(deflate_state *s, char *buf, unsigned long s
     put_short(s, (uint16_t)~stored_len);
     memcpy(s->pending_buf + s->pending, buf, stored_len);
     s->pending += stored_len;
-#ifdef DEBUG
+#ifdef ZLIB_DEBUG
     s->compressed_len = (s->compressed_len + 3 + 7) & (unsigned long)~7L;
     s->compressed_len += (stored_len + 4) << 3;
     s->bits_sent += 2*16;
@@ -820,7 +820,7 @@ void ZLIB_INTERNAL _tr_flush_bits(deflate_state *s) {
 void ZLIB_INTERNAL _tr_align(deflate_state *s) {
     send_bits(s, STATIC_TREES << 1, 3);
     send_code(s, END_BLOCK, static_ltree);
-#ifdef DEBUG
+#ifdef ZLIB_DEBUG
     s->compressed_len += 10L; /* 3 for block type, 7 for EOB */
 #endif
     bi_flush(s);
@@ -894,14 +894,14 @@ void ZLIB_INTERNAL _tr_flush_block(deflate_state *s, char *buf, unsigned long st
 #endif
         send_bits(s, (STATIC_TREES << 1)+last, 3);
         compress_block(s, (const ct_data *)static_ltree, (const ct_data *)static_dtree);
-#ifdef DEBUG
+#ifdef ZLIB_DEBUG
         s->compressed_len += 3 + s->static_len;
 #endif
     } else {
         send_bits(s, (DYN_TREES << 1)+last, 3);
         send_all_trees(s, s->l_desc.max_code+1, s->d_desc.max_code+1, max_blindex+1);
         compress_block(s, (const ct_data *)s->dyn_ltree, (const ct_data *)s->dyn_dtree);
-#ifdef DEBUG
+#ifdef ZLIB_DEBUG
         s->compressed_len += 3 + s->opt_len;
 #endif
     }
@@ -913,7 +913,7 @@ void ZLIB_INTERNAL _tr_flush_block(deflate_state *s, char *buf, unsigned long st
 
     if (last) {
         bi_windup(s);
-#ifdef DEBUG
+#ifdef ZLIB_DEBUG
         s->compressed_len += 7;  /* align on byte boundary */
 #endif
     }
@@ -1097,7 +1097,7 @@ ZLIB_INTERNAL void bi_windup(deflate_state *s) {
     }
     s->bi_buf = 0;
     s->bi_valid = 0;
-#ifdef DEBUG
+#ifdef ZLIB_DEBUG
     s->bits_sent = (s->bits_sent+7) & ~7;
 #endif
 }
diff --git a/zlib.h b/zlib.h
index 2284cc1ded40d3d1006a7dd1117f8bac3900d981..ff7441415e9623adb638d94ace4ad30bed8b1acc 100644 (file)
--- a/zlib.h
+++ b/zlib.h
@@ -1127,7 +1127,7 @@ ZEXTERN unsigned long ZEXPORT zlibCompileFlags(void);
      7.6: size of z_off_t
 
     Compiler, assembler, and debug options:
-     8: DEBUG
+     8: ZLIB_DEBUG
      9: ASMV or ASMINF -- use ASM code
      10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention
      11: 0 (reserved)
diff --git a/zutil.c b/zutil.c
index a5dc4aa42d418a0997728804a052a662b2b4a9e1..6a26d6f93d99d2f7b2b54f3630d62018effcbc9b 100644 (file)
--- a/zutil.c
+++ b/zutil.c
@@ -60,7 +60,7 @@ unsigned long ZEXPORT zlibCompileFlags(void)
     case 8:     flags += 2 << 6;        break;
     default:    flags += 3 << 6;
     }
-#ifdef DEBUG
+#ifdef ZLIB_DEBUG
     flags += 1 << 8;
 #endif
 #ifdef ZLIB_WINAPI
@@ -84,7 +84,7 @@ unsigned long ZEXPORT zlibCompileFlags(void)
     return flags;
 }
 
-#ifdef DEBUG
+#ifdef ZLIB_DEBUG
 
 #  ifndef verbose
 #    define verbose 0
diff --git a/zutil.h b/zutil.h
index 21371bea8228136b475489723b89bc24c226e1ad..898eb32d3d95141ef6804606d7066fe44712379d 100644 (file)
--- a/zutil.h
+++ b/zutil.h
@@ -135,7 +135,7 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
          /* functions */
 
 /* Diagnostic functions */
-#ifdef DEBUG
+#ifdef ZLIB_DEBUG
 #   include <stdio.h>
     extern int ZLIB_INTERNAL z_verbose;
     extern void ZLIB_INTERNAL z_error(char *m);