Skip to content

Commit 190782c

Browse files
authored
[SHELL32] Fix some clang warnings (reactos#7845)
1 parent aa4fac6 commit 190782c

File tree

14 files changed

+22
-18
lines changed

14 files changed

+22
-18
lines changed

dll/win32/shell32/CDefView.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ class CDefView :
518518
return wc;
519519
}
520520

521-
virtual WNDPROC GetWindowProc()
521+
virtual WNDPROC GetWindowProc() override
522522
{
523523
return WindowProc;
524524
}
@@ -1059,7 +1059,7 @@ HRESULT CDefView::GetDetailsByFolderColumn(PCUITEMID_CHILD pidl, UINT FoldCol, S
10591059
{
10601060
// According to learn.microsoft.com/en-us/windows/win32/shell/sfvm-getdetailsof
10611061
// the query order is IShellFolder2, IShellDetails, SFVM_GETDETAILSOF.
1062-
HRESULT hr;
1062+
HRESULT hr = E_FAIL;
10631063
if (m_pSF2Parent)
10641064
{
10651065
hr = m_pSF2Parent->GetDetailsOf(pidl, FoldCol, &sd);
@@ -1230,6 +1230,7 @@ void CDefView::ColumnListChanged()
12301230
break;
12311231
HRESULT foldCol = MapListColumnToFolderColumn(listCol);
12321232
assert(SUCCEEDED(foldCol));
1233+
DBG_UNREFERENCED_LOCAL_VARIABLE(foldCol);
12331234
AppendMenuItem(m_hMenuArrangeModes, MF_STRING,
12341235
DVIDM_ARRANGESORT_FIRST + listCol, lvc.pszText, listCol);
12351236
}
@@ -3373,7 +3374,7 @@ HRESULT CDefView::LoadViewState()
33733374
m_LoadColumnsList = NULL;
33743375
}
33753376
}
3376-
m_sortInfo.bLoadedFromViewState = !fallback && m_LoadColumnsList && cvs.SortColId != LISTVIEW_SORT_INFO::UNSPECIFIEDCOLUMN;
3377+
m_sortInfo.bLoadedFromViewState = !fallback && m_LoadColumnsList && (int)cvs.SortColId != LISTVIEW_SORT_INFO::UNSPECIFIEDCOLUMN;
33773378
m_sortInfo.bColumnIsFolderColumn = TRUE;
33783379
m_sortInfo.Direction = cvs.SortDir > 0 ? 1 : -1;
33793380
m_sortInfo.ListColumn = cvs.SortColId;

dll/win32/shell32/CDefaultContextMenu.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ class CDefaultContextMenu :
219219
STDMETHOD(GetSite)(REFIID riid, void **ppvSite) override;
220220

221221
// IServiceProvider
222-
virtual HRESULT STDMETHODCALLTYPE QueryService(REFGUID svc, REFIID riid, void**ppv)
222+
STDMETHOD(QueryService)(REFGUID svc, REFIID riid, void**ppv) override
223223
{
224224
return IUnknown_QueryService(m_site, svc, riid, ppv);
225225
}

dll/win32/shell32/CRecycleBinCleaner.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
WINE_DEFAULT_DEBUG_CHANNEL(shell);
1111

1212

13-
CLSID CLSID_RecycleBinCleaner = { 0x5ef4af3a, 0xf726, 0x11d0, 0xb8, 0xa2, 0x00, 0xc0, 0x4f, 0xc3, 0x09, 0xa4 };
13+
CLSID CLSID_RecycleBinCleaner = { 0x5ef4af3a, 0xf726, 0x11d0, { 0xb8, 0xa2, 0x00, 0xc0, 0x4f, 0xc3, 0x09, 0xa4 } };
1414

1515
struct CRecycleBinCleaner :
1616
public CComObjectRootEx<CComSingleThreadModel>,

dll/win32/shell32/debughlp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ const char * shdebugstr_guid( const struct _GUID *id )
452452
}
453453

454454
return wine_dbg_sprintf( "\n\t{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x} (%s)",
455-
id->Data1, id->Data2, id->Data3,
455+
(UINT)id->Data1, id->Data2, id->Data3,
456456
id->Data4[0], id->Data4[1], id->Data4[2], id->Data4[3],
457457
id->Data4[4], id->Data4[5], id->Data4[6], id->Data4[7], name ? name : "unknown" );
458458
}

dll/win32/shell32/dialogs/drive.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ InitializeFormatDriveDlg(HWND hwndDlg, PFORMAT_DRIVE_CONTEXT pContext)
374374
{
375375
WCHAR szDrive[] = { WCHAR(pContext->Drive + 'A'), ':', '\\', '\0' };
376376
WCHAR szText[120], szFs[30];
377-
INT cchText;
377+
SIZE_T cchText;
378378
ULARGE_INTEGER TotalNumberOfBytes;
379379
DWORD dwIndex, dwDefault;
380380
UCHAR uMinor, uMajor;
@@ -398,8 +398,6 @@ InitializeFormatDriveDlg(HWND hwndDlg, PFORMAT_DRIVE_CONTEXT pContext)
398398
SendMessageW(pContext->hWndTipTrigger, STM_SETICON, (WPARAM)hIco, 0);
399399

400400
cchText = GetWindowTextW(hwndDlg, szText, _countof(szText) - 1);
401-
if (cchText < 0)
402-
cchText = 0;
403401
szText[cchText++] = L' ';
404402
szFs[0] = UNICODE_NULL;
405403
if (GetVolumeInformationW(szDrive, &szText[cchText], _countof(szText) - cchText, NULL, NULL, NULL, szFs, _countof(szFs)))

dll/win32/shell32/dialogs/filetypes.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@ InitializeDefaultIcons(PFILE_TYPE_GLOBALS pG)
334334
{
335335
int idx = ImageList_AddIcon(pG->himlSmall, pG->hDefExtIconSmall);
336336
ASSERT(idx == 0);
337+
DBG_UNREFERENCED_LOCAL_VARIABLE(idx);
337338
}
338339
}
339340

dll/win32/shell32/dialogs/view.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ ViewTree_InsertAll(HWND hwndTreeView)
249249
static BOOL
250250
ViewTree_LoadTree(HKEY hKey, LPCWSTR pszKeyName, DWORD dwParentID)
251251
{
252-
DWORD dwIndex;
252+
DWORD dwIndex = ~0UL;
253253
WCHAR szKeyName[64], szText[MAX_PATH], *pch;
254254
DWORD Size, Value;
255255
PVIEWTREE_ENTRY pAllocated;

dll/win32/shell32/droptargets/CFSDropTarget.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ HRESULT CFSDropTarget::_DoDrop(IDataObject *pDataObject,
544544
bLinking = TRUE;
545545
}
546546

547-
if (SUCCEEDED(pDataObject->QueryGetData(&fmt)))
547+
if (SUCCEEDED(hr = pDataObject->QueryGetData(&fmt)))
548548
{
549549
hr = pDataObject->GetData(&fmt, &medium);
550550
TRACE("CFSTR_SHELLIDLIST\n");
@@ -698,11 +698,11 @@ HRESULT CFSDropTarget::_DoDrop(IDataObject *pDataObject,
698698
_ILFreeaPidl(apidl, lpcida->cidl);
699699
ReleaseStgMedium(&medium);
700700
}
701-
else if (SUCCEEDED(pDataObject->QueryGetData(&fmt2)))
701+
else if (SUCCEEDED(hr = pDataObject->QueryGetData(&fmt2)))
702702
{
703703
FORMATETC fmt2;
704704
InitFormatEtc (fmt2, CF_HDROP, TYMED_HGLOBAL);
705-
if (SUCCEEDED(pDataObject->GetData(&fmt2, &medium)) /* && SUCCEEDED(pDataObject->GetData(&fmt2, &medium))*/)
705+
if (SUCCEEDED(hr = pDataObject->GetData(&fmt2, &medium)) /* && SUCCEEDED(pDataObject->GetData(&fmt2, &medium))*/)
706706
{
707707
WCHAR wszTargetPath[MAX_PATH + 1];
708708
LPWSTR pszSrcList;

dll/win32/shell32/folders/CRecycleBin.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,11 +186,13 @@ static inline LPCWSTR GetItemRecycledFullPath(const BBITEMDATA &Data)
186186
return (LPCWSTR)((BYTE*)&Data + Data.RecycledPathOffset);
187187
}
188188

189+
#if 0 // Unused
189190
static inline LPCWSTR GetItemRecycledFileName(LPCITEMIDLIST pidl, const BBITEMDATA &Data)
190191
{
191192
C_ASSERT(BBITEMFILETYPE & PT_FS_UNICODE_FLAG);
192193
return (LPCWSTR)((LPPIDLDATA)pidl->mkid.abID)->u.file.szNames;
193194
}
195+
#endif
194196

195197
static int GetItemDriveNumber(LPCITEMIDLIST pidl)
196198
{

dll/win32/shell32/shellmenu/CMenuSite.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ HRESULT STDMETHODCALLTYPE CMenuSite::AddBand(IUnknown * punk)
8585

8686
HRESULT STDMETHODCALLTYPE CMenuSite::EnumBands(UINT uBand, DWORD* pdwBandID)
8787
{
88-
if (uBand == -1ul)
88+
if (uBand == UINT(-1))
8989
return GetBandCount();
9090

9191
if (uBand != 0)

0 commit comments

Comments
 (0)