From 2df94e8bc7c40de0bf6c46eba3a00dbb9241b74b Mon Sep 17 00:00:00 2001 From: helixhorned Date: Sun, 3 Jun 2012 19:20:32 +0000 Subject: [PATCH] Fix a "set but not used warning" in xdelta3.c, revert definition of XD3_ASSERT. git-svn-id: https://svn.eduke32.com/eduke32@2733 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/xdelta3/xdelta3.c | 12 +++++++++--- polymer/eduke32/source/xdelta3/xdelta3.h | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/polymer/eduke32/source/xdelta3/xdelta3.c b/polymer/eduke32/source/xdelta3/xdelta3.c index 1e3099f0e..04571d07e 100644 --- a/polymer/eduke32/source/xdelta3/xdelta3.c +++ b/polymer/eduke32/source/xdelta3/xdelta3.c @@ -2654,10 +2654,16 @@ xd3_set_source (xd3_stream *stream, * calculations are cheap. */ if (!xd3_check_pow2 (src->blksize, &shiftby) == 0) { - int check; src->blksize = xd3_pow2_roundup(src->blksize); - check = xd3_check_pow2 (src->blksize, &shiftby); - XD3_ASSERT (check == 0); +#if XD3_DEBUG + { + int check; + check = xd3_check_pow2 (src->blksize, &shiftby); + XD3_ASSERT (check == 0); + } +#else + xd3_check_pow2 (src->blksize, &shiftby); +#endif IF_DEBUG1 (DP(RINT "raising srcblksz to %u\n", src->blksize)); } diff --git a/polymer/eduke32/source/xdelta3/xdelta3.h b/polymer/eduke32/source/xdelta3/xdelta3.h index cf4682ab3..394db910e 100644 --- a/polymer/eduke32/source/xdelta3/xdelta3.h +++ b/polymer/eduke32/source/xdelta3/xdelta3.h @@ -297,7 +297,7 @@ typedef int (xd3_comp_table_func) (xd3_stream *stream, do { if (! (x)) { DP(RINT "%s:%d: XD3 assertion failed: %s\n", __FILE__, __LINE__, #x); \ abort (); } } while (0) #else -#define XD3_ASSERT(x) +#define XD3_ASSERT(x) (void)0 #endif /* XD3_DEBUG */ #ifdef __GNUC__