Skip to content

Commit 16de25a

Browse files
committed
Use C++17 by default
Plus C++ standard conformance fixes.
1 parent 07a5a7b commit 16de25a

33 files changed

+203
-97
lines changed

Src/ClassicExplorer/ClassicExplorer.vcxproj

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,8 @@
165165
<WarningLevel>Level3</WarningLevel>
166166
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
167167
<MultiProcessorCompilation>true</MultiProcessorCompilation>
168+
<ConformanceMode>true</ConformanceMode>
169+
<LanguageStandard>stdcpp17</LanguageStandard>
168170
</ClCompile>
169171
<ResourceCompile>
170172
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -199,6 +201,8 @@
199201
<WarningLevel>Level3</WarningLevel>
200202
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
201203
<MultiProcessorCompilation>true</MultiProcessorCompilation>
204+
<ConformanceMode>true</ConformanceMode>
205+
<LanguageStandard>stdcpp17</LanguageStandard>
202206
</ClCompile>
203207
<ResourceCompile>
204208
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -232,6 +236,8 @@
232236
<WarningLevel>Level3</WarningLevel>
233237
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
234238
<MultiProcessorCompilation>true</MultiProcessorCompilation>
239+
<ConformanceMode>true</ConformanceMode>
240+
<LanguageStandard>stdcpp17</LanguageStandard>
235241
</ClCompile>
236242
<ResourceCompile>
237243
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -266,6 +272,8 @@
266272
<WarningLevel>Level3</WarningLevel>
267273
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
268274
<MultiProcessorCompilation>true</MultiProcessorCompilation>
275+
<ConformanceMode>true</ConformanceMode>
276+
<LanguageStandard>stdcpp17</LanguageStandard>
269277
</ClCompile>
270278
<ResourceCompile>
271279
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -302,6 +310,8 @@
302310
<TreatWarningAsError>true</TreatWarningAsError>
303311
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
304312
<MultiProcessorCompilation>true</MultiProcessorCompilation>
313+
<ConformanceMode>true</ConformanceMode>
314+
<LanguageStandard>stdcpp17</LanguageStandard>
305315
</ClCompile>
306316
<ResourceCompile>
307317
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -336,6 +346,8 @@
336346
<TreatWarningAsError>true</TreatWarningAsError>
337347
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
338348
<MultiProcessorCompilation>true</MultiProcessorCompilation>
349+
<ConformanceMode>true</ConformanceMode>
350+
<LanguageStandard>stdcpp17</LanguageStandard>
339351
</ClCompile>
340352
<ResourceCompile>
341353
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>

Src/ClassicExplorer/ClassicExplorerSettings/ClassicExplorerSettings.vcxproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@
8484
<TreatWarningAsError>true</TreatWarningAsError>
8585
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
8686
<MultiProcessorCompilation>true</MultiProcessorCompilation>
87+
<ConformanceMode>true</ConformanceMode>
88+
<LanguageStandard>stdcpp17</LanguageStandard>
8789
</ClCompile>
8890
<ResourceCompile>
8991
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -105,6 +107,8 @@
105107
<TreatWarningAsError>true</TreatWarningAsError>
106108
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
107109
<MultiProcessorCompilation>true</MultiProcessorCompilation>
110+
<ConformanceMode>true</ConformanceMode>
111+
<LanguageStandard>stdcpp17</LanguageStandard>
108112
</ClCompile>
109113
<ResourceCompile>
110114
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -128,6 +132,8 @@
128132
<TreatWarningAsError>true</TreatWarningAsError>
129133
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
130134
<MultiProcessorCompilation>true</MultiProcessorCompilation>
135+
<ConformanceMode>true</ConformanceMode>
136+
<LanguageStandard>stdcpp17</LanguageStandard>
131137
</ClCompile>
132138
<ResourceCompile>
133139
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>

Src/ClassicExplorer/ExplorerBHO.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ LRESULT CALLBACK CExplorerBHO::SubclassTreeProc( HWND hWnd, UINT uMsg, WPARAM wP
8888
CComPtr<IShellView> pView;
8989
if (pThis->m_pBrowser && SUCCEEDED(pThis->m_pBrowser->QueryActiveShellView(&pView)))
9090
{
91-
CComQIPtr<IFolderView> pView2=pView;
91+
CComQIPtr<IFolderView> pView2(pView);
9292

9393
CComPtr<IPersistFolder2> pFolder;
9494
CAbsolutePidl pidl2;
@@ -319,7 +319,7 @@ bool CExplorerBHO::GetStatusText( wchar_t *buf, int size, const wchar_t *oldText
319319
CComPtr<IShellView> pView;
320320
if (m_pBrowser && SUCCEEDED(m_pBrowser->QueryActiveShellView(&pView)))
321321
{
322-
CComQIPtr<IFolderView> pView2=pView;
322+
CComQIPtr<IFolderView> pView2(pView);
323323

324324
CComPtr<IPersistFolder2> pFolder;
325325
if (pView2 && SUCCEEDED(pView2->GetFolder(IID_IPersistFolder2,(void**)&pFolder)))
@@ -332,7 +332,7 @@ bool CExplorerBHO::GetStatusText( wchar_t *buf, int size, const wchar_t *oldText
332332
PITEMID_CHILD child;
333333
if (SUCCEEDED(pView2->Items(SVGIO_SELECTION,IID_IEnumIDList,(void**)&pEnum)) && pEnum && pEnum->Next(1,&child,NULL)==S_OK)
334334
{
335-
CComQIPtr<IShellFolder> pFolder2=pFolder;
335+
CComQIPtr<IShellFolder> pFolder2(pFolder);
336336
if (pFolder2)
337337
{
338338
CComPtr<IQueryInfo> pQueryInfo;
@@ -431,12 +431,12 @@ void CExplorerBHO::GetFileSize( wchar_t *buf, int size )
431431
int time0=GetTickCount();
432432
if (m_pBrowser && SUCCEEDED(m_pBrowser->QueryActiveShellView(&pView)))
433433
{
434-
CComQIPtr<IFolderView> pView2=pView;
434+
CComQIPtr<IFolderView> pView2(pView);
435435
CComPtr<IPersistFolder2> pFolder;
436436
CAbsolutePidl pidl;
437437
if (pView2 && SUCCEEDED(pView2->GetFolder(IID_IPersistFolder2,(void**)&pFolder)) && SUCCEEDED(pFolder->GetCurFolder(&pidl)))
438438
{
439-
CComQIPtr<IShellFolder2> pFolder2=pFolder;
439+
CComQIPtr<IShellFolder2> pFolder2(pFolder);
440440
UINT type=SVGIO_SELECTION;
441441
int count, selCount;
442442
if (SUCCEEDED(pView2->ItemCount(SVGIO_ALLVIEW,&count)))
@@ -1414,7 +1414,7 @@ STDMETHODIMP CExplorerBHO::OnDocumentComplete( IDispatch *pDisp, VARIANT *URL )
14141414
m_pBrowser->QueryActiveShellView(&pView);
14151415
if (pView)
14161416
{
1417-
CComQIPtr<IFolderView> pFolderView=pView;
1417+
CComQIPtr<IFolderView> pFolderView(pView);
14181418
if (pFolderView)
14191419
{
14201420
if (GetSettingBool(L"ShowHeaders"))
@@ -1425,7 +1425,7 @@ STDMETHODIMP CExplorerBHO::OnDocumentComplete( IDispatch *pDisp, VARIANT *URL )
14251425
// The code to turn on the headers is borrowed from the Explorer7Fixes project under the terms of the MIT license:
14261426
// http://github.com/ijprest/Explorer7Fixes - Copyright (c) 2010 Ian Prest
14271427

1428-
CComQIPtr<IFolderView2> pView2=pFolderView;
1428+
CComQIPtr<IFolderView2> pView2(pFolderView);
14291429
if (pView2)
14301430
{
14311431
// Turn on the sort header!
@@ -1474,7 +1474,7 @@ STDMETHODIMP CExplorerBHO::OnDocumentComplete( IDispatch *pDisp, VARIANT *URL )
14741474
}
14751475
if (GetSettingBool(L"HideScrollTip"))
14761476
{
1477-
CComQIPtr<IFolderViewOptions> pOptions=m_pBrowser;
1477+
CComQIPtr<IFolderViewOptions> pOptions(m_pBrowser);
14781478
if (pOptions)
14791479
pOptions->SetFolderViewOptions(FVO_NOSCROLLTIPS,FVO_NOSCROLLTIPS);
14801480
}

Src/ClassicExplorer/ExplorerBand.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ void CBandWindow::SendEmail( void )
440440
if (FAILED(m_pBrowser->QueryActiveShellView(&pView))) return;
441441

442442
// check if there is anything selected
443-
CComQIPtr<IFolderView> pView2=pView;
443+
CComQIPtr<IFolderView> pView2(pView);
444444
int count;
445445
if (pView2 && SUCCEEDED(pView2->ItemCount(SVGIO_SELECTION,&count)) && count==0)
446446
return;
@@ -449,7 +449,7 @@ void CBandWindow::SendEmail( void )
449449
CComPtr<IDataObject> pDataObj;
450450
if (FAILED(pView->GetItemObject(SVGIO_SELECTION,IID_IDataObject,(void**)&pDataObj)))
451451
return;
452-
CComQIPtr<IDataObjectAsyncCapability> pAsync=pDataObj;
452+
CComQIPtr<IDataObjectAsyncCapability> pAsync(pDataObj);
453453
if (pAsync)
454454
pAsync->SetAsyncMode(FALSE);
455455

@@ -494,7 +494,7 @@ void CBandWindow::SendToZip( void )
494494
if (FAILED(m_pBrowser->QueryActiveShellView(&pView))) return;
495495

496496
// check if there is anything selected
497-
CComQIPtr<IFolderView> pView2=pView;
497+
CComQIPtr<IFolderView> pView2(pView);
498498

499499
CComPtr<IShellFolder> pFolder;
500500
if (FAILED(pView2->GetFolder(IID_IShellFolder,(void**)&pFolder)) || !pFolder) return;
@@ -507,15 +507,15 @@ void CBandWindow::SendToZip( void )
507507
CComPtr<IDataObject> pDataObj;
508508
if (FAILED(pView->GetItemObject(SVGIO_SELECTION,IID_IDataObject,(void**)&pDataObj)))
509509
return;
510-
CComQIPtr<IDataObjectAsyncCapability> pAsync=pDataObj;
510+
CComQIPtr<IDataObjectAsyncCapability> pAsync(pDataObj);
511511
if (pAsync)
512512
pAsync->SetAsyncMode(FALSE);
513513

514514
// drop into the SendMail handler
515515
CComPtr<IDropTarget> pDropTarget;
516516
if (SUCCEEDED(CoCreateInstance(CLSID_SendToZip,NULL,CLSCTX_ALL,IID_IDropTarget,(void **)&pDropTarget)))
517517
{
518-
CComQIPtr<IObjectWithSite> pDropWithSite=pDropTarget;
518+
CComQIPtr<IObjectWithSite> pDropWithSite(pDropTarget);
519519
if (pDropWithSite)
520520
{
521521
CComObject<CSendToZipHelper> *pHelper;
@@ -568,7 +568,7 @@ void CBandWindow::NewFolder( void )
568568
{
569569
CComPtr<IShellView> pView;
570570
if (FAILED(m_pBrowser->QueryActiveShellView(&pView))) return;
571-
CComQIPtr<IFolderView> pView2=pView;
571+
CComQIPtr<IFolderView> pView2(pView);
572572
if (!pView2) return;
573573

574574
{
@@ -705,7 +705,7 @@ void CBandWindow::ExecuteCommandFile( const wchar_t *pText )
705705
CComPtr<IShellView> pView;
706706
if (SUCCEEDED(m_pBrowser->QueryActiveShellView(&pView)))
707707
{
708-
CComQIPtr<IFolderView> pView2=pView;
708+
CComQIPtr<IFolderView> pView2(pView);
709709
if (!pView2) return;
710710
CComPtr<IShellFolder> pFolder;
711711
if (FAILED(pView2->GetFolder(IID_IShellFolder,(void**)&pFolder)) || !pFolder) return;
@@ -785,7 +785,7 @@ void CBandWindow::ExecuteCustomCommand( const wchar_t *pCommand )
785785
{
786786
CComPtr<IPersistFolder2> pFolder;
787787
CAbsolutePidl pidl;
788-
CComQIPtr<IFolderView> pView2=pView;
788+
CComQIPtr<IFolderView> pView2(pView);
789789
if (pView2 && SUCCEEDED(pView2->GetFolder(IID_IPersistFolder2,(void**)&pFolder)) && SUCCEEDED(pFolder->GetCurFolder(&pidl)))
790790
{
791791
// get current path
@@ -900,13 +900,13 @@ void CBandWindow::ExecuteCustomCommand( const wchar_t *pCommand )
900900
}
901901
else if (_wcsicmp(exe,L"sortby")==0)
902902
{
903-
CComQIPtr<IFolderView2> pView2=pView;
903+
CComQIPtr<IFolderView2> pView2(pView);
904904
if (pView2)
905905
ViewByProperty(pView2,params,false);
906906
}
907907
else if (_wcsicmp(exe,L"groupby")==0)
908908
{
909-
CComQIPtr<IFolderView2> pView2=pView;
909+
CComQIPtr<IFolderView2> pView2(pView);
910910
if (pView2)
911911
ViewByProperty(pView2,params,true);
912912
}
@@ -1128,7 +1128,7 @@ LRESULT CBandWindow::OnCommand( UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& b
11281128
CComPtr<IShellView> pView;
11291129
if (SUCCEEDED(m_pBrowser->QueryActiveShellView(&pView)))
11301130
{
1131-
CComQIPtr<IFolderView2> pView2=pView;
1131+
CComQIPtr<IFolderView2> pView2(pView);
11321132
if (pView2) pView2->DoRename();
11331133
}
11341134
return TRUE;
@@ -1283,7 +1283,7 @@ LRESULT CBandWindow::OnCommand( UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& b
12831283
if (FAILED(m_pBrowser->QueryActiveShellView(&pView)))
12841284
return TRUE;
12851285

1286-
CComQIPtr<IFolderView2> pView2=pView;
1286+
CComQIPtr<IFolderView2> pView2(pView);
12871287
if (!pView2) return TRUE;
12881288

12891289
// ID_DESELECT
@@ -1730,7 +1730,7 @@ void CBandWindow::UpdateToolbar( void )
17301730
m_pBrowser->QueryActiveShellView(&pView);
17311731
if (pView)
17321732
{
1733-
CComQIPtr<IFolderView> pView2=pView;
1733+
CComQIPtr<IFolderView> pView2(pView);
17341734
if (pView2)
17351735
{
17361736
CComPtr<IPersistFolder2> pFolder;

Src/ClassicIE/ClassicIE.vcxproj

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@
149149
<WarningLevel>Level3</WarningLevel>
150150
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
151151
<MultiProcessorCompilation>true</MultiProcessorCompilation>
152+
<ConformanceMode>true</ConformanceMode>
153+
<LanguageStandard>stdcpp17</LanguageStandard>
152154
</ClCompile>
153155
<Link>
154156
<AdditionalDependencies>shlwapi.lib;comctl32.lib;psapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
@@ -168,6 +170,8 @@
168170
<WarningLevel>Level3</WarningLevel>
169171
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
170172
<MultiProcessorCompilation>true</MultiProcessorCompilation>
173+
<ConformanceMode>true</ConformanceMode>
174+
<LanguageStandard>stdcpp17</LanguageStandard>
171175
</ClCompile>
172176
<Link>
173177
<AdditionalDependencies>shlwapi.lib;comctl32.lib;psapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
@@ -186,6 +190,8 @@
186190
<WarningLevel>Level3</WarningLevel>
187191
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
188192
<MultiProcessorCompilation>true</MultiProcessorCompilation>
193+
<ConformanceMode>true</ConformanceMode>
194+
<LanguageStandard>stdcpp17</LanguageStandard>
189195
</ClCompile>
190196
<Link>
191197
<AdditionalDependencies>shlwapi.lib;comctl32.lib;psapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
@@ -206,6 +212,8 @@
206212
<WarningLevel>Level3</WarningLevel>
207213
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
208214
<MultiProcessorCompilation>true</MultiProcessorCompilation>
215+
<ConformanceMode>true</ConformanceMode>
216+
<LanguageStandard>stdcpp17</LanguageStandard>
209217
</ClCompile>
210218
<Link>
211219
<AdditionalDependencies>shlwapi.lib;comctl32.lib;psapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
@@ -226,6 +234,8 @@
226234
<WarningLevel>Level3</WarningLevel>
227235
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
228236
<MultiProcessorCompilation>true</MultiProcessorCompilation>
237+
<ConformanceMode>true</ConformanceMode>
238+
<LanguageStandard>stdcpp17</LanguageStandard>
229239
</ClCompile>
230240
<Link>
231241
<AdditionalDependencies>shlwapi.lib;comctl32.lib;psapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
@@ -246,6 +256,8 @@
246256
<WarningLevel>Level3</WarningLevel>
247257
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
248258
<MultiProcessorCompilation>true</MultiProcessorCompilation>
259+
<ConformanceMode>true</ConformanceMode>
260+
<LanguageStandard>stdcpp17</LanguageStandard>
249261
</ClCompile>
250262
<Link>
251263
<AdditionalDependencies>shlwapi.lib;comctl32.lib;psapi.lib;%(AdditionalDependencies)</AdditionalDependencies>

Src/ClassicIE/ClassicIEDLL/ClassicIEDLL.vcxproj

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,8 @@
158158
<PrecompiledHeader>Use</PrecompiledHeader>
159159
<WarningLevel>Level3</WarningLevel>
160160
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
161+
<ConformanceMode>true</ConformanceMode>
162+
<LanguageStandard>stdcpp17</LanguageStandard>
161163
</ClCompile>
162164
<ResourceCompile>
163165
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -191,6 +193,8 @@
191193
<PrecompiledHeader>Use</PrecompiledHeader>
192194
<WarningLevel>Level3</WarningLevel>
193195
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
196+
<ConformanceMode>true</ConformanceMode>
197+
<LanguageStandard>stdcpp17</LanguageStandard>
194198
</ClCompile>
195199
<ResourceCompile>
196200
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -223,6 +227,8 @@
223227
<PrecompiledHeader>Use</PrecompiledHeader>
224228
<WarningLevel>Level3</WarningLevel>
225229
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
230+
<ConformanceMode>true</ConformanceMode>
231+
<LanguageStandard>stdcpp17</LanguageStandard>
226232
</ClCompile>
227233
<ResourceCompile>
228234
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -256,6 +262,8 @@
256262
<PrecompiledHeader>Use</PrecompiledHeader>
257263
<WarningLevel>Level3</WarningLevel>
258264
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
265+
<ConformanceMode>true</ConformanceMode>
266+
<LanguageStandard>stdcpp17</LanguageStandard>
259267
</ClCompile>
260268
<ResourceCompile>
261269
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -290,6 +298,8 @@
290298
<PrecompiledHeader>Use</PrecompiledHeader>
291299
<WarningLevel>Level3</WarningLevel>
292300
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
301+
<ConformanceMode>true</ConformanceMode>
302+
<LanguageStandard>stdcpp17</LanguageStandard>
293303
</ClCompile>
294304
<ResourceCompile>
295305
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -322,6 +332,8 @@
322332
<PrecompiledHeader>Use</PrecompiledHeader>
323333
<WarningLevel>Level3</WarningLevel>
324334
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
335+
<ConformanceMode>true</ConformanceMode>
336+
<LanguageStandard>stdcpp17</LanguageStandard>
325337
</ClCompile>
326338
<ResourceCompile>
327339
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>

Src/Lib/FileHelper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ bool CreateFakeFolder( const wchar_t *source, const wchar_t *fname )
1616
HRESULT hr=pLink.CoCreateInstance(CLSID_ShellLink);
1717
if (FAILED(hr)) return false;
1818
pLink->SetPath(source);
19-
CComQIPtr<IPersistFile> pFile=pLink;
19+
CComQIPtr<IPersistFile> pFile(pLink);
2020
if (!pFile) return false;
2121
hr=pFile->Save(path,TRUE);
2222
if (FAILED(hr)) return false;

0 commit comments

Comments
 (0)