diff options
author | Underground78 <underground78@users.sourceforge.net> | 2012-06-19 21:18:53 +0400 |
---|---|---|
committer | Underground78 <underground78@users.sourceforge.net> | 2012-06-19 21:18:53 +0400 |
commit | 2e6ae214b87393a7f04c582e87ce07cb5b8e31d6 (patch) | |
tree | 47bf433c555e15fbfb5efd4ed6fcf9d6bfd26a1d | |
parent | df8b04b32de45136f5aa79d8bc0a1f810df9c028 (diff) |
Avoid variable shadowing (/analyze warning C6246).
Patch by XhmikosR.
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@5199 10f7b99b-c216-0410-bff0-8a66a9350fd8
-rw-r--r-- | src/DSUtil/DSUtil.cpp | 16 | ||||
-rw-r--r-- | src/DSUtil/MediaTypeEx.cpp | 16 | ||||
-rw-r--r-- | src/Subtitles/GFN.cpp | 12 | ||||
-rw-r--r-- | src/Subtitles/RTS.cpp | 22 | ||||
-rw-r--r-- | src/Subtitles/STS.cpp | 4 | ||||
-rw-r--r-- | src/Subtitles/USFSubtitles.cpp | 6 | ||||
-rw-r--r-- | src/filters/transform/VSFilter/DirectVobSubFilter.cpp | 6 |
7 files changed, 41 insertions, 41 deletions
diff --git a/src/DSUtil/DSUtil.cpp b/src/DSUtil/DSUtil.cpp index ea5b6f358..b054fb7ba 100644 --- a/src/DSUtil/DSUtil.cpp +++ b/src/DSUtil/DSUtil.cpp @@ -1303,8 +1303,8 @@ IBaseFilter* AppendFilter(IPin* pPin, IMoniker* pMoniker, IGraphBuilder* pGB) }
BeginEnumPins(pBF, pEP, pPinTo) {
- PIN_DIRECTION dir;
- if (FAILED(pPinTo->QueryDirection(&dir)) || dir != PINDIR_INPUT) {
+ PIN_DIRECTION dir2;
+ if (FAILED(pPinTo->QueryDirection(&dir2)) || dir2 != PINDIR_INPUT) {
continue;
}
@@ -2138,9 +2138,9 @@ CString ISO6391ToLanguage(LPCSTR code) for (ptrdiff_t i = 0, j = _countof(s_isolangs); i < j; i++)
if (!strcmp(s_isolangs[i].iso6391, tmp)) {
CString ret = CString(CStringA(s_isolangs[i].name));
- int i = ret.Find(';');
- if (i > 0) {
- ret = ret.Left(i);
+ int k = ret.Find(';');
+ if (k > 0) {
+ ret = ret.Left(k);
}
return ret;
}
@@ -2156,9 +2156,9 @@ CString ISO6392ToLanguage(LPCSTR code) for (ptrdiff_t i = 0, j = _countof(s_isolangs); i < j; i++) {
if (!strcmp(s_isolangs[i].iso6392, tmp)) {
CString ret = CString(CStringA(s_isolangs[i].name));
- int i = ret.Find(';');
- if (i > 0) {
- ret = ret.Left(i);
+ int k = ret.Find(';');
+ if (k > 0) {
+ ret = ret.Left(k);
}
return ret;
}
diff --git a/src/DSUtil/MediaTypeEx.cpp b/src/DSUtil/MediaTypeEx.cpp index 19965eafc..d2e9c5f06 100644 --- a/src/DSUtil/MediaTypeEx.cpp +++ b/src/DSUtil/MediaTypeEx.cpp @@ -488,21 +488,21 @@ void CMediaTypeEx::Dump(CAtlList<CString>& sl) sl.AddTail(_T(""));
if (formattype == FORMAT_VideoInfo2 || formattype == FORMAT_MPEG2_VIDEO) {
- VIDEOINFOHEADER2& vih = *(VIDEOINFOHEADER2*)pbFormat;
- bih = &vih.bmiHeader;
+ VIDEOINFOHEADER2& vih2 = *(VIDEOINFOHEADER2*)pbFormat;
+ bih = &vih2.bmiHeader;
sl.AddTail(_T("VIDEOINFOHEADER2:"));
- str.Format(_T("dwInterlaceFlags: 0x%08x"), vih.dwInterlaceFlags);
+ str.Format(_T("dwInterlaceFlags: 0x%08x"), vih2.dwInterlaceFlags);
sl.AddTail(str);
- str.Format(_T("dwCopyProtectFlags: 0x%08x"), vih.dwCopyProtectFlags);
+ str.Format(_T("dwCopyProtectFlags: 0x%08x"), vih2.dwCopyProtectFlags);
sl.AddTail(str);
- str.Format(_T("dwPictAspectRatioX: %d"), vih.dwPictAspectRatioX);
+ str.Format(_T("dwPictAspectRatioX: %d"), vih2.dwPictAspectRatioX);
sl.AddTail(str);
- str.Format(_T("dwPictAspectRatioY: %d"), vih.dwPictAspectRatioY);
+ str.Format(_T("dwPictAspectRatioY: %d"), vih2.dwPictAspectRatioY);
sl.AddTail(str);
- str.Format(_T("dwControlFlags: 0x%08x"), vih.dwControlFlags);
+ str.Format(_T("dwControlFlags: 0x%08x"), vih2.dwControlFlags);
sl.AddTail(str);
- str.Format(_T("dwReserved2: 0x%08x"), vih.dwReserved2);
+ str.Format(_T("dwReserved2: 0x%08x"), vih2.dwReserved2);
sl.AddTail(str);
sl.AddTail(_T(""));
diff --git a/src/Subtitles/GFN.cpp b/src/Subtitles/GFN.cpp index df3254e4a..535d0cad8 100644 --- a/src/Subtitles/GFN.cpp +++ b/src/Subtitles/GFN.cpp @@ -132,13 +132,13 @@ void GetSubFileNames(CString fn, CAtlArray<CString>& paths, CAtlArray<SubFile>& for (ptrdiff_t i = 0; i < extsubnum; i++) {
if ((hFile = FindFirstFile(path + title + ext[j][i], &wfd)) != INVALID_HANDLE_VALUE) {
do {
- CString fn = path + wfd.cFileName;
+ CString fn2 = path + wfd.cFileName;
hFile2 = INVALID_HANDLE_VALUE;
- if (j == 0 || (hFile2 = FindFirstFile(fn.Left(fn.ReverseFind('.')) + _T(".avi"), &wfd2)) == INVALID_HANDLE_VALUE) {
+ if (j == 0 || (hFile2 = FindFirstFile(fn2.Left(fn2.ReverseFind('.')) + _T(".avi"), &wfd2)) == INVALID_HANDLE_VALUE) {
SubFile f;
- f.fn = fn;
+ f.fn = fn2;
ret.Add(f);
}
@@ -155,10 +155,10 @@ void GetSubFileNames(CString fn, CAtlArray<CString>& paths, CAtlArray<SubFile>& } else if (l > 7) {
CWebTextFile wtf; // :)
if (wtf.Open(orgpath + title + _T(".wse"))) {
- CString fn;
- while (wtf.ReadString(fn) && fn.Find(_T("://")) >= 0) {
+ CString fn2;
+ while (wtf.ReadString(fn2) && fn2.Find(_T("://")) >= 0) {
SubFile f;
- f.fn = fn;
+ f.fn = fn2;
ret.Add(f);
}
}
diff --git a/src/Subtitles/RTS.cpp b/src/Subtitles/RTS.cpp index 3cf87a6e4..5fc9ced7f 100644 --- a/src/Subtitles/RTS.cpp +++ b/src/Subtitles/RTS.cpp @@ -649,20 +649,20 @@ bool CPolygon::ParseStr() int minx = INT_MAX, miny = INT_MAX, maxx = -INT_MAX, maxy = -INT_MAX;
- for (size_t k = 0; k < m_pathTypesOrg.GetCount(); k++) {
- m_pathPointsOrg[k].x = (int)(64 * m_scalex * m_pathPointsOrg[k].x);
- m_pathPointsOrg[k].y = (int)(64 * m_scaley * m_pathPointsOrg[k].y);
- if (minx > m_pathPointsOrg[k].x) {
- minx = m_pathPointsOrg[k].x;
+ for (size_t p = 0; p < m_pathTypesOrg.GetCount(); p++) {
+ m_pathPointsOrg[p].x = (int)(64 * m_scalex * m_pathPointsOrg[p].x);
+ m_pathPointsOrg[p].y = (int)(64 * m_scaley * m_pathPointsOrg[p].y);
+ if (minx > m_pathPointsOrg[p].x) {
+ minx = m_pathPointsOrg[p].x;
}
- if (miny > m_pathPointsOrg[k].y) {
- miny = m_pathPointsOrg[k].y;
+ if (miny > m_pathPointsOrg[p].y) {
+ miny = m_pathPointsOrg[p].y;
}
- if (maxx < m_pathPointsOrg[k].x) {
- maxx = m_pathPointsOrg[k].x;
+ if (maxx < m_pathPointsOrg[p].x) {
+ maxx = m_pathPointsOrg[p].x;
}
- if (maxy < m_pathPointsOrg[k].y) {
- maxy = m_pathPointsOrg[k].y;
+ if (maxy < m_pathPointsOrg[p].y) {
+ maxy = m_pathPointsOrg[p].y;
}
}
diff --git a/src/Subtitles/STS.cpp b/src/Subtitles/STS.cpp index fb53b7259..0575a70a3 100644 --- a/src/Subtitles/STS.cpp +++ b/src/Subtitles/STS.cpp @@ -2907,8 +2907,8 @@ bool CSimpleTextSubtitle::SaveAs(CString fn, exttype et, double fps, CTextFile:: STSStyle* s;
if (!m_fUsingAutoGeneratedDefaultStyle && m_styles.Lookup(_T("Default"), s) && et != EXTSSA && et != EXTASS) {
- CTextFile f;
- if (!f.Save(fn + _T(".style"), e)) {
+ CTextFile file;
+ if (!file.Save(fn + _T(".style"), e)) {
return false;
}
diff --git a/src/Subtitles/USFSubtitles.cpp b/src/Subtitles/USFSubtitles.cpp index 497bb6498..6711de4c9 100644 --- a/src/Subtitles/USFSubtitles.cpp +++ b/src/Subtitles/USFSubtitles.cpp @@ -423,9 +423,9 @@ bool CUSFSubtitles::ConvertToSTS(CSimpleTextSubtitle& sts) }
if (t->style.CompareNoCase(L"Default") != 0) {
- POSITION pos = styles.GetHeadPosition();
- while (pos) {
- style_t* s = styles.GetNext(pos);
+ POSITION pos2 = styles.GetHeadPosition();
+ while (pos2) {
+ style_t* s = styles.GetNext(pos2);
if (s->name == t->style && !s->fontstyle.wrap.IsEmpty()) {
int WrapStyle =
!s->fontstyle.wrap.CompareNoCase(L"no") ? 2 :
diff --git a/src/filters/transform/VSFilter/DirectVobSubFilter.cpp b/src/filters/transform/VSFilter/DirectVobSubFilter.cpp index 3ccabf5e3..8c3951af2 100644 --- a/src/filters/transform/VSFilter/DirectVobSubFilter.cpp +++ b/src/filters/transform/VSFilter/DirectVobSubFilter.cpp @@ -1767,10 +1767,10 @@ DWORD CDirectVobSubFilter::ThreadProc() } else {
Sleep(500);
- POSITION pos = m_frd.files.GetHeadPosition();
- for (ptrdiff_t i = 0; pos; i++) {
+ POSITION pos2 = m_frd.files.GetHeadPosition();
+ for (ptrdiff_t i = 0; pos2; i++) {
CFileStatus status;
- if (CFileGetStatus(m_frd.files.GetNext(pos), status)
+ if (CFileGetStatus(m_frd.files.GetNext(pos2), status)
&& m_frd.mtime[i] != status.m_mtime) {
Open();
SetupFRD(paths, handles);
|