Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkinddragon <kinddragon@users.sourceforge.net>2010-05-16 23:28:57 +0400
committerkinddragon <kinddragon@users.sourceforge.net>2010-05-16 23:28:57 +0400
commite9e09d64fbc9c884e7e00f22bfa9de18b8748bb9 (patch)
tree1a147ec652bb6baef603d72fc6bb9129c416b38b /src/apps/mplayerc/PPageFormats.cpp
parent3a990e7f323a3f68c286ad8b3395c681368ff46b (diff)
Some warnings fixed (uninitialized local variable, unused local variable, comparison signed/unsigned type, assignment in if)
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@1886 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/apps/mplayerc/PPageFormats.cpp')
-rw-r--r--src/apps/mplayerc/PPageFormats.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/apps/mplayerc/PPageFormats.cpp b/src/apps/mplayerc/PPageFormats.cpp
index e555074a0..9da4a0fa8 100644
--- a/src/apps/mplayerc/PPageFormats.cpp
+++ b/src/apps/mplayerc/PPageFormats.cpp
@@ -58,7 +58,8 @@ CPPageFormats::CPPageFormats()
NULL,
CLSCTX_INPROC,
__uuidof(IApplicationAssociationRegistration),
- (void**)&m_pAAR);
+ (void**)&m_pAAR);
+ UNUSED_ALWAYS(hr);
}
}
@@ -130,13 +131,14 @@ CString CPPageFormats::GetOpenCommand()
bool CPPageFormats::IsRegistered(CString ext)
{
+ HRESULT hr;
BOOL bIsDefault = FALSE;
CString strProgID = _T("mplayerc") + ext;
if (m_pAAR == NULL)
{
// Default manager (requires at least Vista)
- HRESULT hr = CoCreateInstance(CLSID_ApplicationAssociationRegistration,
+ hr = CoCreateInstance(CLSID_ApplicationAssociationRegistration,
NULL,
CLSCTX_INPROC,
__uuidof(IApplicationAssociationRegistration),
@@ -146,7 +148,6 @@ bool CPPageFormats::IsRegistered(CString ext)
if (m_pAAR)
{
// The Vista way
- HRESULT hr;
hr = m_pAAR->QueryAppIsDefault(ext, AT_FILEEXTENSION, AL_EFFECTIVE, g_strRegisteredAppName, &bIsDefault);
}
else
@@ -440,7 +441,9 @@ void CPPageFormats::SetListItemState(int nItem)
POSITION pos = exts.GetHeadPosition();
while(pos) if(IsRegistered(exts.GetNext(pos))) cnt++;
- SetChecked(nItem, cnt == 0 ? 0 : cnt == exts.GetCount() ? 1 : 2);
+ if (cnt != 0)
+ cnt = (cnt == (int)exts.GetCount() ? 1 : 2);
+ SetChecked(nItem, cnt);
}
BEGIN_MESSAGE_MAP(CPPageFormats, CPPageBase)
@@ -591,7 +594,8 @@ BOOL CPPageFormats::SetFileAssociation(CString strExt, CString strProgID, bool f
NULL,
CLSCTX_INPROC,
__uuidof(IApplicationAssociationRegistration),
- (void**)&m_pAAR);
+ (void**)&m_pAAR);
+ UNUSED_ALWAYS(hr);
}
if (m_pAAR)
@@ -987,11 +991,8 @@ void CPPageFormats::OnBnVistaModify()
AfxGetMyApp()->RunAsAdministrator (strApp, strCmd, true);
- CMediaFormats& mf = AfxGetAppSettings().Formats;
for(int i = 0; i < m_list.GetItemCount(); i++)
- {
SetListItemState(i);
- }
}
void CPPageFormats::OnBnClickedButton12()