change DEBUG to ZLIB_DEBUG.

This commit is contained in:
christos 2006-01-16 17:02:29 +00:00
parent 920fcf7c8c
commit a1f9f4c090
6 changed files with 32 additions and 32 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: deflate.c,v 1.1.1.1 2006/01/14 20:10:26 christos Exp $ */ /* $NetBSD: deflate.c,v 1.2 2006/01/16 17:02:29 christos Exp $ */
/* deflate.c -- compress data using the deflation algorithm /* deflate.c -- compress data using the deflation algorithm
* Copyright (C) 1995-2005 Jean-loup Gailly. * Copyright (C) 1995-2005 Jean-loup Gailly.
@ -95,7 +95,7 @@ local uInt longest_match OF((deflate_state *s, IPos cur_match));
#endif #endif
local uInt longest_match_fast OF((deflate_state *s, IPos cur_match)); local uInt longest_match_fast OF((deflate_state *s, IPos cur_match));
#ifdef DEBUG #ifdef ZLIB_DEBUG
local void check_match OF((deflate_state *s, IPos start, IPos match, local void check_match OF((deflate_state *s, IPos start, IPos match,
int length)); int length));
#endif #endif
@ -1227,7 +1227,7 @@ local uInt longest_match_fast(s, cur_match)
return (uInt)len <= s->lookahead ? (uInt)len : s->lookahead; return (uInt)len <= s->lookahead ? (uInt)len : s->lookahead;
} }
#ifdef DEBUG #ifdef ZLIB_DEBUG
/* =========================================================================== /* ===========================================================================
* Check that the match at match_start is indeed a match. * Check that the match at match_start is indeed a match.
*/ */
@ -1253,7 +1253,7 @@ local void check_match(s, start, match, length)
} }
#else #else
# define check_match(s, start, match, length) # define check_match(s, start, match, length)
#endif /* DEBUG */ #endif /* ZLIB_DEBUG */
/* =========================================================================== /* ===========================================================================
* Fill the window when the lookahead becomes insufficient. * Fill the window when the lookahead becomes insufficient.

View File

@ -1,4 +1,4 @@
/* $NetBSD: deflate.h,v 1.1.1.1 2006/01/14 20:10:28 christos Exp $ */ /* $NetBSD: deflate.h,v 1.2 2006/01/16 17:02:29 christos Exp $ */
/* deflate.h -- internal compression state /* deflate.h -- internal compression state
* Copyright (C) 1995-2004 Jean-loup Gailly * Copyright (C) 1995-2004 Jean-loup Gailly
@ -248,7 +248,7 @@ typedef struct internal_state {
uInt matches; /* number of string matches in current block */ uInt matches; /* number of string matches in current block */
int last_eob_len; /* bit length of EOB code for last block */ int last_eob_len; /* bit length of EOB code for last block */
#ifdef DEBUG #ifdef ZLIB_DEBUG
ulg compressed_len; /* total bit length of compressed file mod 2^32 */ ulg compressed_len; /* total bit length of compressed file mod 2^32 */
ulg bits_sent; /* bit length of compressed data sent mod 2^32 */ ulg bits_sent; /* bit length of compressed data sent mod 2^32 */
#endif #endif
@ -296,7 +296,7 @@ void _tr_stored_block OF((deflate_state *s, charf *buf, ulg stored_len,
* used. * used.
*/ */
#ifndef DEBUG #ifndef ZLIB_DEBUG
/* Inline versions of _tr_tally for speed: */ /* Inline versions of _tr_tally for speed: */
#if defined(GEN_TREES_H) || !defined(STDC) #if defined(GEN_TREES_H) || !defined(STDC)

View File

@ -1,4 +1,4 @@
/* $NetBSD: trees.c,v 1.1.1.1 2006/01/14 20:10:33 christos Exp $ */ /* $NetBSD: trees.c,v 1.2 2006/01/16 17:02:29 christos Exp $ */
/* trees.c -- output deflated data using Huffman coding /* trees.c -- output deflated data using Huffman coding
* Copyright (C) 1995-2005 Jean-loup Gailly * Copyright (C) 1995-2005 Jean-loup Gailly
@ -37,7 +37,7 @@
#include "deflate.h" #include "deflate.h"
#ifdef DEBUG #ifdef ZLIB_DEBUG
# include <ctype.h> # include <ctype.h>
#endif #endif
@ -165,11 +165,11 @@ local void copy_block OF((deflate_state *s, charf *buf, unsigned len,
local void gen_trees_header OF((void)); local void gen_trees_header OF((void));
#endif #endif
#ifndef DEBUG #ifndef ZLIB_DEBUG
# define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len) # 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 */ /* 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) \ # define send_code(s, c, tree) \
{ if (z_verbose>2) fprintf(stderr,"\ncd %3d ",(c)); \ { if (z_verbose>2) fprintf(stderr,"\ncd %3d ",(c)); \
send_bits(s, tree[c].Code, tree[c].Len); } send_bits(s, tree[c].Code, tree[c].Len); }
@ -188,7 +188,7 @@ local void gen_trees_header OF((void));
* Send a value on a given number of bits. * Send a value on a given number of bits.
* IN assertion: length <= 16 and value fits in length bits. * IN assertion: length <= 16 and value fits in length bits.
*/ */
#ifdef DEBUG #ifdef ZLIB_DEBUG
local void send_bits OF((deflate_state *s, int value, int length)); local void send_bits OF((deflate_state *s, int value, int length));
local void send_bits(s, value, length) local void send_bits(s, value, length)
@ -214,7 +214,7 @@ local void send_bits(s, value, length)
s->bi_valid += length; s->bi_valid += length;
} }
} }
#else /* !DEBUG */ #else /* !ZLIB_DEBUG */
#define send_bits(s, value, length) \ #define send_bits(s, value, length) \
{ int len = length;\ { int len = length;\
@ -229,7 +229,7 @@ local void send_bits(s, value, length)
s->bi_valid += len;\ s->bi_valid += len;\
}\ }\
} }
#endif /* DEBUG */ #endif /* ZLIB_DEBUG */
/* the arguments must not have side effects */ /* the arguments must not have side effects */
@ -321,7 +321,7 @@ local void tr_static_init()
* Genererate the file trees.h describing the static trees. * Genererate the file trees.h describing the static trees.
*/ */
#ifdef GEN_TREES_H #ifdef GEN_TREES_H
# ifndef DEBUG # ifndef ZLIB_DEBUG
# include <stdio.h> # include <stdio.h>
# endif # endif
@ -398,7 +398,7 @@ void _tr_init(s)
s->bi_buf = 0; s->bi_buf = 0;
s->bi_valid = 0; s->bi_valid = 0;
s->last_eob_len = 8; /* enough lookahead for inflate */ s->last_eob_len = 8; /* enough lookahead for inflate */
#ifdef DEBUG #ifdef ZLIB_DEBUG
s->compressed_len = 0L; s->compressed_len = 0L;
s->bits_sent = 0L; s->bits_sent = 0L;
#endif #endif
@ -873,7 +873,7 @@ void _tr_stored_block(s, buf, stored_len, eof)
int eof; /* true if this is the last block for a file */ int eof; /* true if this is the last block for a file */
{ {
send_bits(s, (STORED_BLOCK<<1)+eof, 3); /* send block type */ send_bits(s, (STORED_BLOCK<<1)+eof, 3); /* send block type */
#ifdef DEBUG #ifdef ZLIB_DEBUG
s->compressed_len = (s->compressed_len + 3 + 7) & (ulg)~7L; s->compressed_len = (s->compressed_len + 3 + 7) & (ulg)~7L;
s->compressed_len += (stored_len + 4) << 3; s->compressed_len += (stored_len + 4) << 3;
#endif #endif
@ -896,7 +896,7 @@ void _tr_align(s)
{ {
send_bits(s, STATIC_TREES<<1, 3); send_bits(s, STATIC_TREES<<1, 3);
send_code(s, END_BLOCK, static_ltree); send_code(s, END_BLOCK, static_ltree);
#ifdef DEBUG #ifdef ZLIB_DEBUG
s->compressed_len += 10L; /* 3 for block type, 7 for EOB */ s->compressed_len += 10L; /* 3 for block type, 7 for EOB */
#endif #endif
bi_flush(s); bi_flush(s);
@ -908,7 +908,7 @@ void _tr_align(s)
if (1 + s->last_eob_len + 10 - s->bi_valid < 9) { if (1 + s->last_eob_len + 10 - s->bi_valid < 9) {
send_bits(s, STATIC_TREES<<1, 3); send_bits(s, STATIC_TREES<<1, 3);
send_code(s, END_BLOCK, static_ltree); send_code(s, END_BLOCK, static_ltree);
#ifdef DEBUG #ifdef ZLIB_DEBUG
s->compressed_len += 10L; s->compressed_len += 10L;
#endif #endif
bi_flush(s); bi_flush(s);
@ -989,7 +989,7 @@ void _tr_flush_block(s, buf, stored_len, eof)
#endif #endif
send_bits(s, (STATIC_TREES<<1)+eof, 3); send_bits(s, (STATIC_TREES<<1)+eof, 3);
compress_block(s, (ct_data *)static_ltree, (ct_data *)static_dtree); compress_block(s, (ct_data *)static_ltree, (ct_data *)static_dtree);
#ifdef DEBUG #ifdef ZLIB_DEBUG
s->compressed_len += 3 + s->static_len; s->compressed_len += 3 + s->static_len;
#endif #endif
} else { } else {
@ -997,7 +997,7 @@ void _tr_flush_block(s, buf, stored_len, eof)
send_all_trees(s, s->l_desc.max_code+1, s->d_desc.max_code+1, send_all_trees(s, s->l_desc.max_code+1, s->d_desc.max_code+1,
max_blindex+1); max_blindex+1);
compress_block(s, (ct_data *)s->dyn_ltree, (ct_data *)s->dyn_dtree); compress_block(s, (ct_data *)s->dyn_ltree, (ct_data *)s->dyn_dtree);
#ifdef DEBUG #ifdef ZLIB_DEBUG
s->compressed_len += 3 + s->opt_len; s->compressed_len += 3 + s->opt_len;
#endif #endif
} }
@ -1009,7 +1009,7 @@ void _tr_flush_block(s, buf, stored_len, eof)
if (eof) { if (eof) {
bi_windup(s); bi_windup(s);
#ifdef DEBUG #ifdef ZLIB_DEBUG
s->compressed_len += 7; /* align on byte boundary */ s->compressed_len += 7; /* align on byte boundary */
#endif #endif
} }
@ -1187,7 +1187,7 @@ local void bi_windup(s)
} }
s->bi_buf = 0; s->bi_buf = 0;
s->bi_valid = 0; s->bi_valid = 0;
#ifdef DEBUG #ifdef ZLIB_DEBUG
s->bits_sent = (s->bits_sent+7) & ~7; s->bits_sent = (s->bits_sent+7) & ~7;
#endif #endif
} }
@ -1208,11 +1208,11 @@ local void copy_block(s, buf, len, header)
if (header) { if (header) {
put_short(s, (ush)len); put_short(s, (ush)len);
put_short(s, (ush)~len); put_short(s, (ush)~len);
#ifdef DEBUG #ifdef ZLIB_DEBUG
s->bits_sent += 2*16; s->bits_sent += 2*16;
#endif #endif
} }
#ifdef DEBUG #ifdef ZLIB_DEBUG
s->bits_sent += (ulg)len<<3; s->bits_sent += (ulg)len<<3;
#endif #endif
while (len--) { while (len--) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: zlib.h,v 1.1.1.1 2006/01/14 20:10:42 christos Exp $ */ /* $NetBSD: zlib.h,v 1.2 2006/01/16 17:02:29 christos Exp $ */
/* zlib.h -- interface of the 'zlib' general purpose compression library /* zlib.h -- interface of the 'zlib' general purpose compression library
version 1.2.3, July 18th, 2005 version 1.2.3, July 18th, 2005
@ -966,7 +966,7 @@ ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void));
7.6: size of z_off_t 7.6: size of z_off_t
Compiler, assembler, and debug options: Compiler, assembler, and debug options:
8: DEBUG 8: ZLIB_DEBUG
9: ASMV or ASMINF -- use ASM code 9: ASMV or ASMINF -- use ASM code
10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention 10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention
11: 0 (reserved) 11: 0 (reserved)

View File

@ -1,4 +1,4 @@
/* $NetBSD: zutil.c,v 1.1.1.1 2006/01/14 20:10:34 christos Exp $ */ /* $NetBSD: zutil.c,v 1.2 2006/01/16 17:02:29 christos Exp $ */
/* zutil.c -- target dependent utility functions for the compression library /* zutil.c -- target dependent utility functions for the compression library
* Copyright (C) 1995-2005 Jean-loup Gailly. * Copyright (C) 1995-2005 Jean-loup Gailly.
@ -60,7 +60,7 @@ uLong ZEXPORT zlibCompileFlags()
case 8: flags += 2 << 6; break; case 8: flags += 2 << 6; break;
default: flags += 3 << 6; default: flags += 3 << 6;
} }
#ifdef DEBUG #ifdef ZLIB_DEBUG
flags += 1 << 8; flags += 1 << 8;
#endif #endif
#if defined(ASMV) || defined(ASMINF) #if defined(ASMV) || defined(ASMINF)
@ -114,7 +114,7 @@ uLong ZEXPORT zlibCompileFlags()
return flags; return flags;
} }
#ifdef DEBUG #ifdef ZLIB_DEBUG
# ifndef verbose # ifndef verbose
# define verbose 0 # define verbose 0

View File

@ -1,4 +1,4 @@
/* $NetBSD: zutil.h,v 1.2 2006/01/14 20:28:58 christos Exp $ */ /* $NetBSD: zutil.h,v 1.3 2006/01/16 17:02:29 christos Exp $ */
/* zutil.h -- internal interface and configuration of the compression library /* zutil.h -- internal interface and configuration of the compression library
* Copyright (C) 1995-2005 Jean-loup Gailly. * Copyright (C) 1995-2005 Jean-loup Gailly.
@ -247,7 +247,7 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
#endif #endif
/* Diagnostic functions */ /* Diagnostic functions */
#ifdef DEBUG #if defined(ZLIB_DEBUG) && !(defined(_KERNEL) || defined(_STANDALONE))
# include <stdio.h> # include <stdio.h>
extern int z_verbose; extern int z_verbose;
extern void z_error OF((char *m)); extern void z_error OF((char *m));