diff options
author | XhmikosR <xhmikosr@users.sourceforge.net> | 2012-06-21 11:59:05 +0400 |
---|---|---|
committer | XhmikosR <xhmikosr@users.sourceforge.net> | 2012-06-21 11:59:05 +0400 |
commit | 7b2f02697a49724f280eb31255900e4626b5e12b (patch) | |
tree | 898c49a2417bbbe60f9615b7c33bec6f1dae27cb | |
parent | 362bbc61eeaf9a02191d0cbd9f314ddb8d03923d (diff) |
avoid variable shadowing (/analyze C6246)
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@5211 10f7b99b-c216-0410-bff0-8a66a9350fd8
15 files changed, 61 insertions, 69 deletions
diff --git a/src/filters/muxer/BaseMuxer/BaseMuxerInputPin.cpp b/src/filters/muxer/BaseMuxer/BaseMuxerInputPin.cpp index d8465153d..0bc693467 100644 --- a/src/filters/muxer/BaseMuxer/BaseMuxerInputPin.cpp +++ b/src/filters/muxer/BaseMuxer/BaseMuxerInputPin.cpp @@ -172,9 +172,9 @@ HRESULT CBaseMuxerInputPin::CompleteConnect(IPin* pReceivePin) continue;
}
- HRESULT hr;
+ HRESULT hr2;
CComVariant var;
- if (SUCCEEDED(pPB->Read(1, &PropBag, NULL, &var, &hr)) && SUCCEEDED(hr)) {
+ if (SUCCEEDED(pPB->Read(1, &PropBag, NULL, &var, &hr2)) && SUCCEEDED(hr2)) {
SetProperty(PropBag.pstrName, &var);
}
diff --git a/src/filters/muxer/MatroskaMuxer/MatroskaMuxer.cpp b/src/filters/muxer/MatroskaMuxer/MatroskaMuxer.cpp index 7a00dd123..e66175dd3 100644 --- a/src/filters/muxer/MatroskaMuxer/MatroskaMuxer.cpp +++ b/src/filters/muxer/MatroskaMuxer/MatroskaMuxer.cpp @@ -1097,8 +1097,8 @@ HRESULT CMatroskaMuxerInputPin::CompleteConnect(IPin* pPin) *dst++ = 2;
for (int i = 0; i < 2; i++)
- for (int len = pvf2->HeaderSize[i]; len >= 0; len -= 255) {
- *dst++ = min(len, 255);
+ for (int len2 = pvf2->HeaderSize[i]; len2 >= 0; len2 -= 255) {
+ *dst++ = min(len2, 255);
}
memcpy(dst, src, pvf2->HeaderSize[0]);
diff --git a/src/filters/parser/AviSplitter/AviSplitter.cpp b/src/filters/parser/AviSplitter/AviSplitter.cpp index 4ce3b15fd..654540e10 100644 --- a/src/filters/parser/AviSplitter/AviSplitter.cpp +++ b/src/filters/parser/AviSplitter/AviSplitter.cpp @@ -252,8 +252,8 @@ HRESULT CAviSplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader) if (s->cs.GetCount() && pvih->AvgTimePerFrame > 0) {
UINT64 size = 0;
- for (unsigned int i = 0; i < s->cs.GetCount(); ++i) {
- size += s->cs[i].orgsize;
+ for (unsigned int j = 0; j < s->cs.GetCount(); ++j) {
+ size += s->cs[j].orgsize;
}
pvih->dwBitRate = (DWORD)(10000000.0 * size * 8 / (s->cs.GetCount() * pvih->AvgTimePerFrame) + 0.5);
// need calculate in double, because the (10000000ui64 * size * 8) can give overflow
diff --git a/src/filters/parser/BaseSplitter/AsyncReader.cpp b/src/filters/parser/BaseSplitter/AsyncReader.cpp index 7ae1455af..10339667c 100644 --- a/src/filters/parser/BaseSplitter/AsyncReader.cpp +++ b/src/filters/parser/BaseSplitter/AsyncReader.cpp @@ -100,13 +100,13 @@ STDMETHODIMP CAsyncFileReader::SyncRead(LONGLONG llPosition, LONG lLength, BYTE* CString fn = m_strFileName;
try {
Close();
- } catch (CFileException* e) {
- e->Delete();
+ } catch (CFileException* fe) {
+ fe->Delete();
}
try {
Open(fn, modeRead | shareDenyNone | typeBinary | osSequentialScan);
- } catch (CFileException* e) {
- e->Delete();
+ } catch (CFileException* fe) {
+ fe->Delete();
}
m_strFileName = fn;
}
@@ -213,9 +213,9 @@ DWORD CAsyncUrlReader::ThreadProc() Reply(S_OK);
while (!CheckRequest(&cmd)) {
- int len = fin->Read(buff, sizeof(buff));
- if (len > 0) {
- fout.Write(buff, len);
+ int len2 = fin->Read(buff, sizeof(buff));
+ if (len2 > 0) {
+ fout.Write(buff, len2);
}
}
} else {
diff --git a/src/filters/parser/FLVSplitter/FLVSplitter.cpp b/src/filters/parser/FLVSplitter/FLVSplitter.cpp index d99dcf3a9..3d7ccf5fe 100644 --- a/src/filters/parser/FLVSplitter/FLVSplitter.cpp +++ b/src/filters/parser/FLVSplitter/FLVSplitter.cpp @@ -555,7 +555,7 @@ HRESULT CFLVSplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader) m_pFile->UExpGolombRead(); // bit_depth_chroma_minus8
m_pFile->BitRead(1); // qpprime_y_zero_transform_bypass_flag
if (m_pFile->BitRead(1)) // seq_scaling_matrix_present_flag
- for (int i = 0; i < 8; i++)
+ for (int k = 0; k < 8; k++)
if (m_pFile->BitRead(1)) // seq_scaling_list_present_flag
for (int j = 0, size = i < 6 ? 16 : 64, next = 8; j < size && next != 0; ++j) {
next = (next + m_pFile->SExpGolombRead() + 256) & 255;
@@ -570,8 +570,8 @@ HRESULT CFLVSplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader) m_pFile->SExpGolombRead(); // offset_for_non_ref_pic
m_pFile->SExpGolombRead(); // offset_for_top_to_bottom_field
UINT64 num_ref_frames_in_pic_order_cnt_cycle = m_pFile->UExpGolombRead();
- for (int i = 0; i < num_ref_frames_in_pic_order_cnt_cycle; i++) {
- m_pFile->SExpGolombRead(); // offset_for_ref_frame[i]
+ for (int k = 0; k < num_ref_frames_in_pic_order_cnt_cycle; k++) {
+ m_pFile->SExpGolombRead(); // offset_for_ref_frame[k]
}
}
m_pFile->UExpGolombRead(); // num_ref_frames
diff --git a/src/filters/parser/MatroskaSplitter/MatroskaSplitter.cpp b/src/filters/parser/MatroskaSplitter/MatroskaSplitter.cpp index aa3597dc9..da026e51b 100644 --- a/src/filters/parser/MatroskaSplitter/MatroskaSplitter.cpp +++ b/src/filters/parser/MatroskaSplitter/MatroskaSplitter.cpp @@ -844,9 +844,9 @@ avcsuccess: Name = Name + L" [Default]";
}
- HRESULT hr;
+ HRESULT hr2;
- CAutoPtr<CBaseSplitterOutputPin> pPinOut(DNew CMatroskaSplitterOutputPin(pTE->MinCache, pTE->DefaultDuration / 100, mts, Name, this, this, &hr));
+ CAutoPtr<CBaseSplitterOutputPin> pPinOut(DNew CMatroskaSplitterOutputPin(pTE->MinCache, pTE->DefaultDuration / 100, mts, Name, this, this, &hr2));
if (!pTE->Name.IsEmpty()) {
pPinOut->SetProperty(L"NAME", pTE->Name);
}
@@ -855,10 +855,10 @@ avcsuccess: }
if (!isSub) {
- pinOut.InsertAt((iVideo + iAudio - 3), DNew CMatroskaSplitterOutputPin(pTE->MinCache, pTE->DefaultDuration / 100, mts, Name, this, this, &hr), 1);
+ pinOut.InsertAt((iVideo + iAudio - 3), DNew CMatroskaSplitterOutputPin(pTE->MinCache, pTE->DefaultDuration / 100, mts, Name, this, this, &hr2), 1);
pinOutTE.InsertAt((iVideo + iAudio - 3), pTE, 1);
} else {
- pinOut.Add(DNew CMatroskaSplitterOutputPin(pTE->MinCache, pTE->DefaultDuration / 100, mts, Name, this, this, &hr));
+ pinOut.Add(DNew CMatroskaSplitterOutputPin(pTE->MinCache, pTE->DefaultDuration / 100, mts, Name, this, this, &hr2));
pinOutTE.Add(pTE);
}
diff --git a/src/filters/parser/MpegSplitter/MpegSplitter.cpp b/src/filters/parser/MpegSplitter/MpegSplitter.cpp index 1bd059821..b0298cbfd 100644 --- a/src/filters/parser/MpegSplitter/MpegSplitter.cpp +++ b/src/filters/parser/MpegSplitter/MpegSplitter.cpp @@ -1056,19 +1056,19 @@ void CMpegSplitterFilter::DemuxSeek(REFERENCE_TIME rt) REFERENCE_TIME pdt = _I64_MIN;
for (int j = 0; j < 10; j++) {
- REFERENCE_TIME rt = m_pFile->NextPTS(TrackNum);
+ REFERENCE_TIME rt2 = m_pFile->NextPTS(TrackNum);
- if (rt < 0) {
+ if (rt2 < 0) {
break;
}
- REFERENCE_TIME dt = rt - rtmax;
+ REFERENCE_TIME dt = rt2 - rtmax;
if (dt > 0 && dt == pdt) {
dt = 10000000i64;
}
- if (rtmin <= rt && rt <= rtmax || pdt > 0 && dt < 0) {
+ if (rtmin <= rt2 && rt2 <= rtmax || pdt > 0 && dt < 0) {
minseekpos = min(minseekpos, curpos);
break;
}
diff --git a/src/filters/parser/MpegSplitter/MpegSplitterFile.cpp b/src/filters/parser/MpegSplitter/MpegSplitterFile.cpp index 800e42b8e..b08c9e154 100644 --- a/src/filters/parser/MpegSplitter/MpegSplitterFile.cpp +++ b/src/filters/parser/MpegSplitter/MpegSplitterFile.cpp @@ -951,8 +951,8 @@ void CMpegSplitterFile::UpdatePrograms(const trhdr& h, bool UpdateLang) pPair->m_value.ts_len_packet = len;
memcpy(pPair->m_value.ts_buffer, buffer, max_len);
} else {
- CGolombBuffer gb(buffer, len);
- UpdatePrograms(gb, h.pid, UpdateLang);
+ CGolombBuffer gb2(buffer, len);
+ UpdatePrograms(gb2, h.pid, UpdateLang);
}
}
} else {
@@ -1044,7 +1044,7 @@ void CMpegSplitterFile::UpdatePrograms(CGolombBuffer gb, WORD pid, bool UpdateLa case 0x59: // Subtitling descriptor
gb.ReadBuffer((BYTE*)ch, 3);
ch[3] = 0;
- for (int i = 3; i < descriptor_length; i++) {
+ for (int j = 3; j < descriptor_length; j++) {
gb.BitRead(8);
}
if (!(ch[0] == 'u' && ch[1] == 'n' && ch[2] == 'd')) {
@@ -1052,7 +1052,7 @@ void CMpegSplitterFile::UpdatePrograms(CGolombBuffer gb, WORD pid, bool UpdateLa }
break;
default:
- for (int i = 0; i < descriptor_length; i++) {
+ for (int j = 0; j < descriptor_length; j++) {
gb.BitRead(8);
}
break;
diff --git a/src/filters/parser/OggSplitter/OggSplitter.cpp b/src/filters/parser/OggSplitter/OggSplitter.cpp index fdb005273..f01623939 100644 --- a/src/filters/parser/OggSplitter/OggSplitter.cpp +++ b/src/filters/parser/OggSplitter/OggSplitter.cpp @@ -205,13 +205,13 @@ HRESULT COggSplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader) CStringW name;
name.Format(L"Stream %d", i);
- HRESULT hr;
+ HRESULT hr2;
if (type >= 0x80 && type <= 0x82 && !memcmp(p, "theora", 6)) {
if (type == 0x80) {
name.Format(L"Theora %d", i);
CAutoPtr<CBaseSplitterOutputPin> pPinOut;
- pPinOut.Attach(DNew COggTheoraOutputPin(page.GetData(), name, this, this, &hr));
+ pPinOut.Attach(DNew COggTheoraOutputPin(page.GetData(), name, this, this, &hr2));
AddOutputPin(page.m_hdr.bitstream_serial_number, pPinOut);
nWaitForMore++;
}
@@ -220,20 +220,20 @@ HRESULT COggSplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader) if (!memcmp(p, "vorbis", 6)) {
name.Format(L"Vorbis %d", i);
- pPinOut.Attach(DNew COggVorbisOutputPin((OggVorbisIdHeader*)(p + 6), name, this, this, &hr));
+ pPinOut.Attach(DNew COggVorbisOutputPin((OggVorbisIdHeader*)(p + 6), name, this, this, &hr2));
nWaitForMore++;
} else if (!memcmp(p, "video", 5)) {
name.Format(L"Video %d", i);
- pPinOut.Attach(DNew COggVideoOutputPin((OggStreamHeader*)p, name, this, this, &hr));
+ pPinOut.Attach(DNew COggVideoOutputPin((OggStreamHeader*)p, name, this, this, &hr2));
} else if (!memcmp(p, "audio", 5)) {
name.Format(L"Audio %d", i);
- pPinOut.Attach(DNew COggAudioOutputPin((OggStreamHeader*)p, name, this, this, &hr));
+ pPinOut.Attach(DNew COggAudioOutputPin((OggStreamHeader*)p, name, this, this, &hr2));
} else if (!memcmp(p, "text", 4)) {
name.Format(L"Text %d", i);
- pPinOut.Attach(DNew COggTextOutputPin((OggStreamHeader*)p, name, this, this, &hr));
+ pPinOut.Attach(DNew COggTextOutputPin((OggStreamHeader*)p, name, this, this, &hr2));
} else if (!memcmp(p, "Direct Show Samples embedded in Ogg", 35)) {
name.Format(L"DirectShow %d", i);
- pPinOut.Attach(DNew COggDirectShowOutputPin((AM_MEDIA_TYPE*)(p + 35 + sizeof(GUID)), name, this, this, &hr));
+ pPinOut.Attach(DNew COggDirectShowOutputPin((AM_MEDIA_TYPE*)(p + 35 + sizeof(GUID)), name, this, this, &hr2));
}
AddOutputPin(page.m_hdr.bitstream_serial_number, pPinOut);
@@ -246,7 +246,7 @@ HRESULT COggSplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader) // Ogg Flac : method 1
CAutoPtr<CBaseSplitterOutputPin> pPinOut;
name.Format(L"FLAC %d", i);
- pPinOut.Attach(DNew COggFlacOutputPin(p + 12, page.GetCount() - 14, name, this, this, &hr));
+ pPinOut.Attach(DNew COggFlacOutputPin(p + 12, page.GetCount() - 14, name, this, this, &hr2));
AddOutputPin(page.m_hdr.bitstream_serial_number, pPinOut);
} else if (*(long*)(p - 1) == 0x43614C66) {
//bFlac = true;
@@ -255,7 +255,7 @@ HRESULT COggSplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader) CAutoPtr<CBaseSplitterOutputPin> pPinOut;
name.Format(L"FLAC %d", i);
p = page.GetData();
- pPinOut.Attach(DNew COggFlacOutputPin(p, page.GetCount(), name, this, this, &hr));
+ pPinOut.Attach(DNew COggFlacOutputPin(p, page.GetCount(), name, this, this, &hr2));
AddOutputPin(page.m_hdr.bitstream_serial_number, pPinOut);
}
} else if (!(type & 1) && nWaitForMore == 0) {
diff --git a/src/filters/parser/RealMediaSplitter/RealMediaSplitter.cpp b/src/filters/parser/RealMediaSplitter/RealMediaSplitter.cpp index 5a303d5be..92bd7638c 100644 --- a/src/filters/parser/RealMediaSplitter/RealMediaSplitter.cpp +++ b/src/filters/parser/RealMediaSplitter/RealMediaSplitter.cpp @@ -497,9 +497,9 @@ HRESULT CRealMediaSplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader) continue;
}
- HRESULT hr;
+ HRESULT hr2;
- CAutoPtr<CBaseSplitterOutputPin> pPinOut(DNew CRealMediaSplitterOutputPin(mts, name, this, this, &hr));
+ CAutoPtr<CBaseSplitterOutputPin> pPinOut(DNew CRealMediaSplitterOutputPin(mts, name, this, this, &hr2));
if (SUCCEEDED(AddOutputPin((DWORD)pmp->stream, pPinOut))) {
if (!m_rtStop) {
m_pFile->m_p.tDuration = max(m_pFile->m_p.tDuration, pmp->tDuration);
@@ -524,9 +524,9 @@ HRESULT CRealMediaSplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader) CAtlArray<CMediaType> mts;
mts.Add(mt);
- HRESULT hr;
+ HRESULT hr2;
- CAutoPtr<CBaseSplitterOutputPin> pPinOut(DNew CRealMediaSplitterOutputPin(mts, name, this, this, &hr));
+ CAutoPtr<CBaseSplitterOutputPin> pPinOut(DNew CRealMediaSplitterOutputPin(mts, name, this, this, &hr2));
AddOutputPin((DWORD)~stream, pPinOut);
}
@@ -1659,8 +1659,8 @@ HRESULT CRealVideoDecoder::InitRV(const CMediaType* pmt) UINT32* pWH = DNew UINT32[nWidthHeight * 2];
pWH[0] = rvi.w;
pWH[1] = rvi.h;
- for (int i = 2; i < nWidthHeight * 2; i++) {
- pWH[i] = rvi.morewh[i - 2] * 4;
+ for (int j = 2; j < nWidthHeight * 2; j++) {
+ pWH[j] = rvi.morewh[j - 2] * 4;
}
#pragma pack(push, 1)
struct {
diff --git a/src/filters/reader/CDXAReader/CDXAReader.cpp b/src/filters/reader/CDXAReader/CDXAReader.cpp index 868fa6b2f..1756d3526 100644 --- a/src/filters/reader/CDXAReader/CDXAReader.cpp +++ b/src/filters/reader/CDXAReader/CDXAReader.cpp @@ -510,8 +510,8 @@ bool CCDXAStream::LookForMediaSubType() }
}
- for (unsigned int i = 0; i < cb; i++) {
- pData[i] &= (BYTE)mask[i];
+ for (unsigned int ui = 0; ui < cb; ui++) {
+ pData[ui] &= (BYTE)mask[ui];
}
if (memcmp(pData, val.GetData(), cb) == 0) {
diff --git a/src/filters/switcher/AudioSwitcher/AudioSwitcher.cpp b/src/filters/switcher/AudioSwitcher/AudioSwitcher.cpp index 98740e5ae..40fd8e2a7 100644 --- a/src/filters/switcher/AudioSwitcher/AudioSwitcher.cpp +++ b/src/filters/switcher/AudioSwitcher/AudioSwitcher.cpp @@ -332,16 +332,16 @@ HRESULT CAudioSwitcherFilter::Transform(IMediaSample* pIn, IMediaSample* pOut) }
} else {
BYTE* pDataOut = NULL;
- HRESULT hr;
- if (FAILED(hr = pOut->GetPointer(&pDataOut)) || !pDataOut) {
- return hr;
+ HRESULT hr2;
+ if (FAILED(hr2 = pOut->GetPointer(&pDataOut)) || !pDataOut) {
+ return hr2;
}
memset(pDataOut, 0, pOut->GetSize());
}
} else {
- HRESULT hr;
- if (S_OK != (hr = __super::Transform(pIn, pOut))) {
- return hr;
+ HRESULT hr2;
+ if (S_OK != (hr2 = __super::Transform(pIn, pOut))) {
+ return hr2;
}
}
diff --git a/src/filters/transform/BaseVideoFilter/BaseVideoFilter.cpp b/src/filters/transform/BaseVideoFilter/BaseVideoFilter.cpp index 746055152..ed1e116bd 100644 --- a/src/filters/transform/BaseVideoFilter/BaseVideoFilter.cpp +++ b/src/filters/transform/BaseVideoFilter/BaseVideoFilter.cpp @@ -234,8 +234,8 @@ HRESULT CBaseVideoFilter::ReconnectOutput(int w, int h, bool bSendSample, int re if (SUCCEEDED(hr2 = m_pOutput->GetDeliveryBuffer(&pOut, NULL, NULL, 0))) {
AM_MEDIA_TYPE* pmt;
if (SUCCEEDED(pOut->GetMediaType(&pmt)) && pmt) {
- CMediaType mt = *pmt;
- m_pOutput->SetMediaType(&mt);
+ CMediaType mt2 = *pmt;
+ m_pOutput->SetMediaType(&mt2);
DeleteMediaType(pmt);
} else { // stupid overlay mixer won't let us know the new pitch...
long size = pOut->GetSize();
diff --git a/src/filters/transform/Mpeg2DecFilter/Mpeg2DecFilter.cpp b/src/filters/transform/Mpeg2DecFilter/Mpeg2DecFilter.cpp index 5758d6798..8b1b2eb15 100644 --- a/src/filters/transform/Mpeg2DecFilter/Mpeg2DecFilter.cpp +++ b/src/filters/transform/Mpeg2DecFilter/Mpeg2DecFilter.cpp @@ -597,10 +597,10 @@ HRESULT CMpeg2DecFilter::Transform(IMediaSample* pIn) }
m_fb.rtStop = m_fb.rtStart + m_AvgTimePerFrame * picture->nb_fields / (m_dec->m_info.m_display_picture_2nd ? 1 : 2);
- REFERENCE_TIME rtStart = m_fb.rtStart;
- REFERENCE_TIME rtStop = m_fb.rtStop;
- UNREFERENCED_PARAMETER(rtStart);
- UNREFERENCED_PARAMETER(rtStop);
+ REFERENCE_TIME rtStart2 = m_fb.rtStart;
+ REFERENCE_TIME rtStop2 = m_fb.rtStop;
+ UNREFERENCED_PARAMETER(rtStart2);
+ UNREFERENCED_PARAMETER(rtStop2);
//
diff --git a/src/filters/transform/Mpeg2DecFilter/Mpeg2DecFilter.h b/src/filters/transform/Mpeg2DecFilter/Mpeg2DecFilter.h index 51ebd50f6..8ec28ea05 100644 --- a/src/filters/transform/Mpeg2DecFilter/Mpeg2DecFilter.h +++ b/src/filters/transform/Mpeg2DecFilter/Mpeg2DecFilter.h @@ -304,16 +304,10 @@ public: HRESULT SetMediaType(const CMediaType* mtIn);
// we shouldn't pass these to the filter from this pin
- STDMETHODIMP EndOfStream() {
- return S_OK;
- }
- STDMETHODIMP BeginFlush() {
- return S_OK;
- }
+ STDMETHODIMP EndOfStream() { return S_OK; }
+ STDMETHODIMP BeginFlush() { return S_OK; }
STDMETHODIMP EndFlush();
- STDMETHODIMP NewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate) {
- return S_OK;
- }
+ STDMETHODIMP NewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate) { return S_OK; }
// IKsPropertySet
STDMETHODIMP Set(REFGUID PropSet, ULONG Id, LPVOID InstanceData, ULONG InstanceLength, LPVOID PropertyData, ULONG DataLength);
@@ -329,9 +323,7 @@ public: HRESULT GetMediaType(int iPosition, CMediaType* pmt);
HRESULT DecideBufferSize(IMemAllocator* pAllocator, ALLOCATOR_PROPERTIES* pProperties);
- CMediaType& CurrentMediaType() {
- return m_mt;
- }
+ CMediaType& CurrentMediaType() { return m_mt; }
HRESULT Deliver(const void* ptr, int len);
};
|