1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-13 14:13:32 +02:00

Fix C4456 Warnings.

"C4456 declaration hides previous local declaration."
These arise from repeated declarations of the same name.
This commit is contained in:
James Crook
2018-10-10 17:28:50 +01:00
parent 43402438f8
commit 5fd95dd131
25 changed files with 198 additions and 169 deletions

View File

@@ -454,10 +454,11 @@ ProgressResult FLACImportFileHandle::Import(TrackFactory *trackFactory,
mChannels.resize(mNumChannels);
auto iter = mChannels.begin();
for (size_t c = 0; c < mNumChannels; ++iter, ++c)
*iter = trackFactory->NewWaveTrack(mFormat, mSampleRate);
{
auto iter = mChannels.begin();
for (size_t c = 0; c < mNumChannels; ++iter, ++c)
*iter = trackFactory->NewWaveTrack(mFormat, mSampleRate);
}
//Start OD
bool useOD = false;

View File

@@ -366,9 +366,12 @@ ProgressResult PCMImportFileHandle::Import(TrackFactory *trackFactory,
NewChannelGroup channels(mInfo.channels);
auto iter = channels.begin();
for (int c = 0; c < mInfo.channels; ++iter, ++c)
*iter = trackFactory->NewWaveTrack(mFormat, mInfo.samplerate);
{
// iter not used outside this scope.
auto iter = channels.begin();
for (int c = 0; c < mInfo.channels; ++iter, ++c)
*iter = trackFactory->NewWaveTrack(mFormat, mInfo.samplerate);
}
auto fileTotalFrames =
(sampleCount)mInfo.frames; // convert from sf_count_t
@@ -673,8 +676,8 @@ ProgressResult PCMImportFileHandle::Import(TrackFactory *trackFactory,
ustr = id3_field_getstring(&frame->fields[1]);
if (ustr) {
// Is this duplication really needed?
MallocString<> str{ (char *)id3_ucs4_utf8duplicate(ustr) };
n = UTF8CTOWX(str.get());
MallocString<> convStr{ (char *)id3_ucs4_utf8duplicate(ustr) };
n = UTF8CTOWX(convStr.get());
}
ustr = id3_field_getstring(&frame->fields[2]);
@@ -685,8 +688,8 @@ ProgressResult PCMImportFileHandle::Import(TrackFactory *trackFactory,
if (ustr) {
// Is this duplication really needed?
MallocString<> str{ (char *)id3_ucs4_utf8duplicate(ustr) };
v = UTF8CTOWX(str.get());
MallocString<> convStr{ (char *)id3_ucs4_utf8duplicate(ustr) };
v = UTF8CTOWX(convStr.get());
}
if (!n.IsEmpty() && !v.IsEmpty()) {

View File

@@ -112,8 +112,6 @@ void ImportRaw(wxWindow *parent, const wxString &fileName,
{
SF_INFO sndInfo;
int result;
unsigned numChannels = 0;
try {
@@ -171,15 +169,17 @@ void ImportRaw(wxWindow *parent, const wxString &fileName,
throw FileException{ FileException::Cause::Open, fileName };
}
result = sf_command(sndFile.get(), SFC_SET_RAW_START_OFFSET, &offset, sizeof(offset));
if (result != 0) {
char str[1000];
sf_error_str(sndFile.get(), str, 1000);
wxPrintf("%s\n", str);
throw FileException{ FileException::Cause::Read, fileName };
{
int result = sf_command(sndFile.get(), SFC_SET_RAW_START_OFFSET, &offset, sizeof(offset));
if (result != 0) {
char str[1000];
sf_error_str(sndFile.get(), str, 1000);
wxPrintf("%s\n", str);
throw FileException{ FileException::Cause::Read, fileName };
}
}
SFCall<sf_count_t>(sf_seek, sndFile.get(), 0, SEEK_SET);
auto totalFrames =
@@ -204,10 +204,12 @@ void ImportRaw(wxWindow *parent, const wxString &fileName,
auto &channels = results[0];
channels.resize(numChannels);
auto iter = channels.begin();
for (decltype(numChannels) c = 0; c < numChannels; ++iter, ++c)
*iter = trackFactory->NewWaveTrack(format, rate);
{
// iter not used outside this scope.
auto iter = channels.begin();
for (decltype(numChannels) c = 0; c < numChannels; ++iter, ++c)
*iter = trackFactory->NewWaveTrack(format, rate);
}
const auto firstChannel = channels.begin()->get();
auto maxBlockSize = firstChannel->GetMaxBlockSize();
@@ -232,14 +234,14 @@ void ImportRaw(wxWindow *parent, const wxString &fileName,
block =
limitSampleBufferSize( maxBlockSize, totalFrames - framescompleted );
sf_count_t result;
sf_count_t sf_result;
if (format == int16Sample)
result = SFCall<sf_count_t>(sf_readf_short, sndFile.get(), (short *)srcbuffer.ptr(), block);
sf_result = SFCall<sf_count_t>(sf_readf_short, sndFile.get(), (short *)srcbuffer.ptr(), block);
else
result = SFCall<sf_count_t>(sf_readf_float, sndFile.get(), (float *)srcbuffer.ptr(), block);
sf_result = SFCall<sf_count_t>(sf_readf_float, sndFile.get(), (float *)srcbuffer.ptr(), block);
if (result >= 0) {
block = result;
if (sf_result >= 0) {
block = sf_result;
}
else {
// This is not supposed to happen, sndfile.h says result is always