From 70abf19f762330b35d2f7c4d54d1fc056d2897f5 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 23 Apr 2017 14:42:47 +0300 Subject: [PATCH] Replaced pointless comparison with loop_start range check src/sound/oalsound.cpp:1285:17: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare] --- src/sound/oalsound.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/sound/oalsound.cpp b/src/sound/oalsound.cpp index f2c7249a7..6e3447679 100644 --- a/src/sound/oalsound.cpp +++ b/src/sound/oalsound.cpp @@ -1282,8 +1282,9 @@ std::pair OpenALSoundRenderer::LoadSound(uint8_t *sfxdata, int if (!startass) loop_start = Scale(loop_start, srate, 1000); if (!endass) loop_end = Scale(loop_end, srate, 1000); - if (loop_start < 0) loop_start = 0; - if (loop_end > data.Size() / samplesize) loop_end = data.Size() / samplesize; + const uint32_t samples = data.Size() / samplesize; + if (loop_start > samples) loop_start = 0; + if (loop_end > samples) loop_end = samples; if ((loop_start > 0 || loop_end > 0) && loop_end > loop_start && AL.SOFT_loop_points) {