From 36e956cd9f475b97d579da7349abcad90359e389 Mon Sep 17 00:00:00 2001 From: Kp Date: Sat, 15 Jan 2022 20:39:10 +0000 Subject: [PATCH] Preprocess out unused-but-set variable d2x-rebirth/libmve/mveplay.cpp total This variable is only used in a print statement which is itself commented out. Move the declaration, assignment, and commented print into a preprocessor guard. --- d2x-rebirth/libmve/mveplay.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/d2x-rebirth/libmve/mveplay.cpp b/d2x-rebirth/libmve/mveplay.cpp index be80d289a..3423b0027 100644 --- a/d2x-rebirth/libmve/mveplay.cpp +++ b/d2x-rebirth/libmve/mveplay.cpp @@ -271,7 +271,9 @@ static std::unique_ptr mve_audio_spec; static void mve_audio_callback(void *, unsigned char *stream, int len) { +#ifdef DXX_REPORT_TOTAL_LENGTH int total=0; +#endif int length; if (mve_audio_bufhead == mve_audio_buftail) return /* 0 */; @@ -286,7 +288,9 @@ static void mve_audio_callback(void *, unsigned char *stream, int len) (reinterpret_cast(mve_audio_buffers[mve_audio_bufhead].get()))+mve_audio_curbuf_curpos, /* cur input position */ length); /* cur input length */ +#ifdef DXX_REPORT_TOTAL_LENGTH total += length; +#endif stream += length; /* advance output */ len -= length; /* decrement avail ospace */ mve_audio_buffers[mve_audio_bufhead].reset(); /* free the buffer */ @@ -297,7 +301,9 @@ static void mve_audio_callback(void *, unsigned char *stream, int len) mve_audio_curbuf_curpos = 0; } +#ifdef DXX_REPORT_TOTAL_LENGTH //con_printf(CON_CRITICAL, "= <%d (%d), %d, %d>: %d", mve_audio_bufhead, mve_audio_curbuf_curpos, mve_audio_buftail, len, total); +#endif /* return total; */ if (len != 0 /* ospace remaining */