Skip to content

Commit

Permalink
Replaced pointless comparison with loop_start range check
Browse files Browse the repository at this point in the history
src/sound/oalsound.cpp:1285:17: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
  • Loading branch information
alexey-lysiuk committed Apr 23, 2017
1 parent 93fa9ac commit 70abf19
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/sound/oalsound.cpp
Expand Up @@ -1282,8 +1282,9 @@ std::pair<SoundHandle,bool> 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)
{
Expand Down

0 comments on commit 70abf19

Please sign in to comment.