From f9f7ce08dbd97def3fd4e0e683e884db9a3ba91b Mon Sep 17 00:00:00 2001 From: Kp Date: Sun, 22 May 2016 17:49:31 +0000 Subject: [PATCH] Fix -Wshadow warnings in bm_read_sound --- d2x-rebirth/main/bmread.cpp | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/d2x-rebirth/main/bmread.cpp b/d2x-rebirth/main/bmread.cpp index f75bc440e..7844ad1f2 100644 --- a/d2x-rebirth/main/bmread.cpp +++ b/d2x-rebirth/main/bmread.cpp @@ -1019,33 +1019,32 @@ void clear_to_end_of_line(void) void bm_read_sound(int skip) { - int sound_num; int alt_sound_num; - sound_num = get_int(); + const int read_sound_num = get_int(); alt_sound_num = get_int(); - if ( sound_num>=MAX_SOUNDS ) + if ( read_sound_num>=MAX_SOUNDS ) Error( "Too many sound files.\n" ); - if (sound_num >= num_sounds) - num_sounds = sound_num+1; + if (read_sound_num >= num_sounds) + num_sounds = read_sound_num+1; - if (Sounds[sound_num] != 255) - Error("Sound num %d already used, bitmaps.tbl, line %d\n",sound_num,linenum); + if (Sounds[read_sound_num] != 255) + Error("Sound num %d already used, bitmaps.tbl, line %d\n",read_sound_num,linenum); arg = strtok(NULL, space_tab); - Sounds[sound_num] = ds_load(skip, arg); + Sounds[read_sound_num] = ds_load(skip, arg); if ( alt_sound_num == 0 ) - AltSounds[sound_num] = sound_num; + AltSounds[read_sound_num] = sound_num; else if (alt_sound_num < 0 ) - AltSounds[sound_num] = 255; + AltSounds[read_sound_num] = 255; else - AltSounds[sound_num] = alt_sound_num; + AltSounds[read_sound_num] = alt_sound_num; - if (Sounds[sound_num] == 255) + if (Sounds[read_sound_num] == 255) Error("Can't load soundfile <%s>",arg); }