From b65d5b50d0737a6cd28d117f7c2585f08de8c169 Mon Sep 17 00:00:00 2001 From: Chris Graf Date: Sun, 4 Jun 2023 20:59:51 -0500 Subject: [PATCH] Fix compiler warnings about variable declaration shadowing Fix a couple of instances where a local variable declaration shadowed another variable. This was causing a compiler error when compiling with clang and treating most compiler warnings as errors (-Wall, -Wextra, -Werror). --- AudioFile.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/AudioFile.h b/AudioFile.h index fcd3fd5..21ba6d2 100644 --- a/AudioFile.h +++ b/AudioFile.h @@ -907,12 +907,12 @@ bool AudioFile::tenByteMatch (std::vector& v1, int startIndex1, std: //============================================================= template -void AudioFile::addSampleRateToAiffData (std::vector& fileData, uint32_t sampleRate) +void AudioFile::addSampleRateToAiffData (std::vector& fileData, uint32_t sampleRate_) { - if (aiffSampleRateTable.count (sampleRate) > 0) + if (aiffSampleRateTable.count (sampleRate_) > 0) { for (int i = 0; i < 10; i++) - fileData.push_back (aiffSampleRateTable[sampleRate][i]); + fileData.push_back (aiffSampleRateTable[sampleRate_][i]); } } @@ -1205,8 +1205,8 @@ void AudioFile::addInt32ToFileData (std::vector& fileData, int32_t i bytes[3] = i & 0xFF; } - for (int i = 0; i < 4; i++) - fileData.push_back (bytes[i]); + for (int j = 0; j < 4; j++) + fileData.push_back (bytes[j]); } //=============================================================