From 2a4c6f7cc19c9a2f94f472aa7b3e01735b34139e Mon Sep 17 00:00:00 2001 From: divverent Date: Mon, 13 Jun 2011 18:34:46 +0000 Subject: [PATCH] fix some warnings about useless code (unsigned < 0, x = x) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11198 d7cf8633-e32d-0410-b094-e92efae38249 ::stable-branch::merge=76ac9a336b02cf18504e9c3253294e8058cdc3dc --- cl_input.c | 7 ------- cl_video_jamdecode.c | 4 ++-- gl_rmain.c | 4 +++- snd_mix.c | 2 +- 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/cl_input.c b/cl_input.c index 5bdc34bc..8fe0d4cb 100644 --- a/cl_input.c +++ b/cl_input.c @@ -588,14 +588,7 @@ void CL_Input (void) } else { - /* - f = log(averagespeed); - mi = log(mi); - ma = log(ma); - */ f = averagespeed; - mi = mi; - ma = ma; f = (f - mi) / (ma - mi) * (m_accelerate.value - 1) + 1; } diff --git a/cl_video_jamdecode.c b/cl_video_jamdecode.c index 05650016..a652dbc2 100644 --- a/cl_video_jamdecode.c +++ b/cl_video_jamdecode.c @@ -250,7 +250,7 @@ readframe: { compsize = LittleLong(*(frameHead + 8)) - 16; outsize = LittleLong(*(frameHead + 12)); - if (compsize < 0 || compsize > s->framesize || outsize < 0 || outsize > s->framesize) + if (compsize > s->framesize || outsize > s->framesize) s->error = JAMDECODEERROR_BAD_FRAME_HEADER; else if (FS_Read(s->file, s->compressed, compsize)) { @@ -352,4 +352,4 @@ readframe: else s->error = DPVSIMPLEDECODEERROR_EOF; return s->error; -} \ No newline at end of file +} diff --git a/gl_rmain.c b/gl_rmain.c index 8574aeb2..2c5eb11c 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -7490,7 +7490,9 @@ static float R_EvaluateQ3WaveFunc(q3wavefunc_t func, const float *parms) index *= 4; f = index - floor(index); if (index < 1) - f = f; + { + // f = f; + } else if (index < 2) f = 1 - f; else if (index < 3) diff --git a/snd_mix.c b/snd_mix.c index d4975781..6bec880e 100644 --- a/snd_mix.c +++ b/snd_mix.c @@ -510,7 +510,7 @@ void S_MixToBuffer(void *stream, unsigned int bufferframes) continue; if (!sfx->total_length) continue; - if (sfx->total_length < 0 || sfx->total_length > 1<<30) + if (sfx->total_length > 1<<30) Sys_Error("S_MixToBuffer: sfx corrupt\n"); ltime = 0; -- 2.39.2