Skip to content

Commit

Permalink
Fix compiler warnings about variable declaration shadowing
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
cgraf78 committed Jun 5, 2023
1 parent bcb61a4 commit b65d5b5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions AudioFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -907,12 +907,12 @@ bool AudioFile<T>::tenByteMatch (std::vector<uint8_t>& v1, int startIndex1, std:

//=============================================================
template <class T>
void AudioFile<T>::addSampleRateToAiffData (std::vector<uint8_t>& fileData, uint32_t sampleRate)
void AudioFile<T>::addSampleRateToAiffData (std::vector<uint8_t>& 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]);
}
}

Expand Down Expand Up @@ -1205,8 +1205,8 @@ void AudioFile<T>::addInt32ToFileData (std::vector<uint8_t>& 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]);
}

//=============================================================
Expand Down

0 comments on commit b65d5b5

Please sign in to comment.