From: Giuseppe CONDORELLI Date: Thu, 3 Sep 2009 05:30:09 -0400 Subject: [U-Boot] [PATCH v2] zlib: fix code when DEBUG is defined Message-ID: <1251970209-9053-1-git-send-email-giuseppe.condorelli@st.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Removed stdio.h inclusion and moved trace macros to use printf avoiding to write debug informations to standard error. Signed-off-by: Giuseppe Condorelli --- lib_generic/zlib.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_generic/zlib.c b/lib_generic/zlib.c index 1b6db32..25ae88f 100644 --- a/lib_generic/zlib.c +++ b/lib_generic/zlib.c @@ -27,6 +27,7 @@ #define ZLIB_INTERNAL #include "u-boot/zlib.h" +#include /* To avoid a build time warning */ #ifdef STDC #include @@ -83,10 +84,10 @@ typedef unsigned long ulg; /* Diagnostic functions */ #ifdef DEBUG -#include extern int z_verbose; extern void z_error OF((char *m)); #define Assert(cond,msg) {if(!(cond)) z_error(msg);} +#define fprintf(fp,...) printf(__VA_ARGS__) #define Trace(x) {if (z_verbose>=0) fprintf x ;} #define Tracev(x) {if (z_verbose>0) fprintf x ;} #define Tracevv(x) {if (z_verbose>1) fprintf x ;} @@ -2000,7 +2001,6 @@ void z_error (m) char *m; { fprintf(stderr, "%s\n", m); - exit(1); } #endif -- 1.6.0.6