Use C++17 by default

Plus C++ standard conformance fixes.
This commit is contained in:
ge0rdi
2018-07-29 21:39:35 +02:00
committed by ge0rdi
parent 07a5a7ba72
commit 16de25a8b0
33 changed files with 203 additions and 97 deletions

View File

@@ -320,7 +320,7 @@ bool CMenuContainer::DragOut( int index, bool bApp )
// force synchronous operation
{
CComQIPtr<IDataObjectAsyncCapability> pAsync=pDataObj;
CComQIPtr<IDataObjectAsyncCapability> pAsync(pDataObj);
if (pAsync)
pAsync->SetAsyncMode(FALSE);
}

View File

@@ -270,7 +270,7 @@ static void AddJumpItem( CJumpGroup &group, IUnknown *pUnknown, std::vector<CCom
return;
}
item.type=CJumpItem::TYPE_LINK;
CComQIPtr<IPropertyStore> pStore=pLink;
CComQIPtr<IPropertyStore> pStore(pLink);
if (pStore)
{
PROPVARIANT val;
@@ -309,7 +309,7 @@ static void AddJumpItem( CJumpGroup &group, IUnknown *pUnknown, std::vector<CCom
pName.MakeUpper();
item.hash=CalcFNVHash(pName);
}
CComQIPtr<IPropertyStore> pStore=pLink;
CComQIPtr<IPropertyStore> pStore(pLink);
if (pStore)
{
CString args=GetPropertyStoreString(pStore,PKEY_Link_Arguments);
@@ -374,12 +374,12 @@ bool GetJumplist( const wchar_t *appid, CJumpList &list, int maxCount, int maxHe
AddJumpCollection(group,pPinnedList,ignoreItems,ignoreLinks);
for (std::vector<CJumpItem>::const_iterator it=group.items.begin();it!=group.items.end();++it)
{
CComQIPtr<IShellItem> pShellItem=it->pItem;
CComQIPtr<IShellItem> pShellItem(it->pItem);
if (pShellItem)
ignoreItems.push_back(pShellItem);
else
{
CComQIPtr<IShellLink> pLink=it->pItem;
CComQIPtr<IShellLink> pLink(it->pItem);
if (pLink)
{
unsigned int hash=CalcLinkHash(pLink);
@@ -528,7 +528,7 @@ bool ExecuteJumpItem( const CItemManager::ItemInfo *pAppInfo, const CJumpItem &i
appid=pAppInfo->GetAppid();
}
LOG_MENU(LOG_OPEN,L"Execute Item: name=%s, appid=%s",item.name,appid);*/
CComQIPtr<IShellItem> pItem=item.pItem;
CComQIPtr<IShellItem> pItem(item.pItem);
if (!pItem)
return false;
/* CComString pName;
@@ -618,7 +618,7 @@ bool ExecuteJumpItem( const CItemManager::ItemInfo *pAppInfo, const CJumpItem &i
if (item.type==CJumpItem::TYPE_LINK)
{
// invoke the link through its context menu
CComQIPtr<IContextMenu> pMenu=item.pItem;
CComQIPtr<IContextMenu> pMenu(item.pItem);
if (!pMenu) return false;
HRESULT hr;
HMENU menu=CreatePopupMenu();

View File

@@ -814,7 +814,7 @@ static bool ExecuteSysCommand( TMenuID menuCommand )
memset(&processInfo,0,sizeof(processInfo));
wchar_t exe[_MAX_PATH]=L"%windir%\\system32\\shutdown.exe";
DoEnvironmentSubst(exe,_countof(exe));
if (CreateProcess(exe,L"shutdown.exe /r /o /t 0",NULL,NULL,FALSE,CREATE_NO_WINDOW,NULL,NULL,&startupInfo,&processInfo))
if (CreateProcess(exe,(LPWSTR)L"shutdown.exe /r /o /t 0",NULL,NULL,FALSE,CREATE_NO_WINDOW,NULL,NULL,&startupInfo,&processInfo))
{
CloseHandle(processInfo.hThread);
CloseHandle(processInfo.hProcess);
@@ -1072,7 +1072,7 @@ static HRESULT CreatePinLink( PCIDLIST_ABSOLUTE sourcePidl, const wchar_t *name,
if (FAILED(hr)) return hr;
}
CComQIPtr<IPersistFile> pFile=pLink;
CComQIPtr<IPersistFile> pFile(pLink);
if (!pFile) return E_FAIL;
hr=pFile->Save(finalPath,TRUE);
}
@@ -1080,9 +1080,9 @@ static HRESULT CreatePinLink( PCIDLIST_ABSOLUTE sourcePidl, const wchar_t *name,
// reopen the link and set the "no new" property. without reopening the original properties are lost
CComPtr<IShellLink> pLink;
hr=pLink.CoCreateInstance(CLSID_ShellLink);
CComQIPtr<IPersistFile> pFile=pLink;
CComQIPtr<IPersistFile> pFile(pLink);
hr=pFile->Load(finalPath,STGM_READWRITE);
CComQIPtr<IPropertyStore> pStore=pLink;
CComQIPtr<IPropertyStore> pStore(pLink);
if (pStore)
{
PROPVARIANT val;
@@ -1559,7 +1559,7 @@ void CMenuContainer::ActivateItem( int index, TActivateType type, const POINT *p
if (bQueryMenu)
{
SHCreateItemFromIDList(pItemPidl1,IID_IShellItem,(void**)&pItem);
CComQIPtr<IShellItem2> pItem2=pItem;
CComQIPtr<IShellItem2> pItem2(pItem);
if (pItem2 &&
((item.categoryHash&CSearchManager::CATEGORY_MASK)!=CSearchManager::CATEGORY_ITEM ||
(GetSettingInt(L"CompatibilityFixes")&COMPATIBILITY_UPDATE_ITEMS))) // don't update search items because we don't have the right bind context for them
@@ -2698,10 +2698,10 @@ void CMenuContainer::ActivateItem( int index, TActivateType type, const POINT *p
StrRetToStr(&str,newPidl,&pPath);
CComPtr<IShellLink> pLink;
pLink.CoCreateInstance(CLSID_ShellLink);
CComQIPtr<IPersistFile> pFile=pLink;
CComQIPtr<IPersistFile> pFile(pLink);
if (pFile && SUCCEEDED(pFile->Load(pPath,STGM_READWRITE)))
{
CComQIPtr<IPropertyStore> pStore=pLink;
CComQIPtr<IPropertyStore> pStore(pLink);
if (pStore)
{
PROPVARIANT val;

View File

@@ -2202,7 +2202,7 @@ void CMenuContainer::AddJumpListItems( std::vector<MenuItem> &items )
if (jumpItem.type==CJumpItem::TYPE_LINK)
{
item.SetName(jumpItem.name,false);
CComQIPtr<IShellLink> pLink=jumpItem.pItem;
CComQIPtr<IShellLink> pLink(jumpItem.pItem);
if (pLink)
{
pLink->GetIDList(&item.pItem1);
@@ -2215,7 +2215,7 @@ void CMenuContainer::AddJumpListItems( std::vector<MenuItem> &items )
else if (jumpItem.type==CJumpItem::TYPE_ITEM)
{
item.SetName(jumpItem.name,false);
CComQIPtr<IShellItem> pItem=jumpItem.pItem;
CComQIPtr<IShellItem> pItem(jumpItem.pItem);
if (pItem)
SHGetIDListFromObject(pItem,&item.pItem1);
}
@@ -2335,7 +2335,7 @@ void CMenuContainer::InitItems( void )
CComPtr<IShellLink> pLink;
if (SUCCEEDED(pLink.CoCreateInstance(CLSID_ShellLink)))
{
CComQIPtr<IPersistFile> pFile=pLink;
CComQIPtr<IPersistFile> pFile(pLink);
if (pFile)
{
// go through the items until we find s_MaxRecentDocuments documents
@@ -6640,7 +6640,7 @@ bool CMenuContainer::GetDescription( int index, wchar_t *text, int size )
}
if (jumpItem.type==CJumpItem::TYPE_ITEM)
{
CComQIPtr<IShellItem> pItem=jumpItem.pItem;
CComQIPtr<IShellItem> pItem(jumpItem.pItem);
if (pItem)
{
{
@@ -6665,7 +6665,7 @@ bool CMenuContainer::GetDescription( int index, wchar_t *text, int size )
}
else if (jumpItem.type==CJumpItem::TYPE_LINK)
{
CComQIPtr<IShellLink> pLink=jumpItem.pItem;
CComQIPtr<IShellLink> pLink(jumpItem.pItem);
if (pLink)
{
if (SUCCEEDED(pLink->GetDescription(text,size)) && text[0])

View File

@@ -543,7 +543,7 @@ bool CSearchManager::SearchScope::ParseSearchConnector( const wchar_t *fname )
return false;
if (_wcsnicmp(url,L"file:",5)==0)
return false; // ignore files
CString url2=url;
CString url2(url);
StringUpper(url2);
roots.push_back(url2);
return true;
@@ -1003,7 +1003,7 @@ void CSearchManager::SearchThread( void )
CComPtr<IBindCtx> pBindCtx0;
CreateBindCtx(0,&pBindCtx0);
if (!pBindCtx0) continue;
pBindCtx0->RegisterObjectParam(STR_PARSE_WITH_PROPERTIES,pStore);
pBindCtx0->RegisterObjectParam((LPOLESTR)STR_PARSE_WITH_PROPERTIES,pStore);
#ifdef LAUNDER_SEARCH_RESULTS
CComPtr<ISearchFolderItemFactory> pSearchFactory;

View File

@@ -849,7 +849,7 @@ LRESULT CSkinSettingsDlg::OnSelEndOK( WORD wNotifyCode, WORD wID, HWND hWndCtl,
m_SkinIndex=(int)SendDlgItemMessage(IDC_COMBOSKIN,CB_GETCURSEL);
{
CSettingsLockWrite lock;
const wchar_t *strNew=m_SkinIndex==0?L"":m_SkinNames[m_SkinIndex];
const wchar_t *strNew=m_SkinIndex==0?L"":m_SkinNames[m_SkinIndex].GetString();
const wchar_t *strOld=m_pSetting[0].value.vt==VT_BSTR?m_pSetting[0].value.bstrVal:L"???";
if (wcscmp(strNew,strOld)!=0)
SetSettingsDirty();
@@ -3340,7 +3340,7 @@ LRESULT CCustomMenuDlg7::OnInitDialog( UINT uMsg, WPARAM wParam, LPARAM lParam,
TOOLINFO tool={sizeof(tool),TTF_SUBCLASS|TTF_IDISHWND,m_hWnd,'CLSH'};
tool.uId=(UINT_PTR)m_List.m_hWnd;
tool.lpszText=L"";
tool.lpszText=(LPWSTR)L"";
::SendMessage(ListView_GetToolTips(m_List),TTM_ADDTOOL,0,(LPARAM)&tool);
return TRUE;

View File

@@ -588,7 +588,7 @@ void EnableStartTooltip( bool bEnable )
else
{
TOOLINFO info=g_StartButtonTool;
info.lpszText=L"";
info.lpszText=(LPWSTR)L"";
SendMessage(g_Tooltip,TTM_UPDATETIPTEXT,0,(LPARAM)&info);
}
}

View File

@@ -143,6 +143,8 @@
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -166,6 +168,8 @@
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -188,6 +192,8 @@
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -212,6 +218,8 @@
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -237,6 +245,8 @@
<TreatWarningAsError>true</TreatWarningAsError>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -262,6 +272,8 @@
<TreatWarningAsError>true</TreatWarningAsError>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -356,4 +368,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>