From 5a11fe87a6f1507149a0965aa740dcdf4ccef3c3 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 19 Nov 2019 15:15:50 +0100 Subject: loplugin:fakebool (clang-cl) ...plus follow-up loplugin:implicitboolconversion and loplugin:redundantcast Change-Id: I9fc9c5cb46fbb50da87ff80af64cb0dfda3e5f90 Reviewed-on: https://gerrit.libreoffice.org/83207 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- .../customactions/reg4allmsdoc/reg4allmsi.cxx | 8 +++---- .../win32/customactions/regactivex/regactivex.cxx | 28 +++++++++++----------- .../source/win32/customactions/sellang/sellang.cxx | 4 ++-- .../customactions/shellextensions/vistaspecial.cxx | 2 +- .../win32/customactions/tools/checkversion.cxx | 2 +- 5 files changed, 22 insertions(+), 22 deletions(-) (limited to 'setup_native/source') diff --git a/setup_native/source/win32/customactions/reg4allmsdoc/reg4allmsi.cxx b/setup_native/source/win32/customactions/reg4allmsdoc/reg4allmsi.cxx index b1ffb6976c87..1a2e82eb7c54 100644 --- a/setup_native/source/win32/customactions/reg4allmsdoc/reg4allmsi.cxx +++ b/setup_native/source/win32/customactions/reg4allmsdoc/reg4allmsi.cxx @@ -89,9 +89,9 @@ static void OutputDebugStringFormatW( LPCWSTR, ... ) } #endif -static BOOL CheckExtensionInRegistry( LPCWSTR lpSubKey ) +static bool CheckExtensionInRegistry( LPCWSTR lpSubKey ) { - BOOL bRet = false; + bool bRet = false; HKEY hKey = nullptr; LONG lResult = RegOpenKeyExW( HKEY_CLASSES_ROOT, lpSubKey, 0, KEY_QUERY_VALUE, &hKey ); @@ -216,14 +216,14 @@ static void saveOldRegistration( LPCWSTR lpSubKey ) } } -static void registerForExtensions( MSIHANDLE handle, BOOL bRegisterAll ) +static void registerForExtensions( MSIHANDLE handle, bool bRegisterAll ) { // Check all file extensions int nIndex = 0; while ( g_Extensions[nIndex] != nullptr ) { saveOldRegistration( g_Extensions[nIndex] ); - BOOL bRegister = bRegisterAll || CheckExtensionInRegistry( g_Extensions[nIndex] ); + bool bRegister = bRegisterAll || CheckExtensionInRegistry( g_Extensions[nIndex] ); if ( bRegister ) registerForExtension( handle, nIndex, true ); ++nIndex; diff --git a/setup_native/source/win32/customactions/regactivex/regactivex.cxx b/setup_native/source/win32/customactions/regactivex/regactivex.cxx index f7234a4725c8..2815d1d85f03 100644 --- a/setup_native/source/win32/customactions/regactivex/regactivex.cxx +++ b/setup_native/source/win32/customactions/regactivex/regactivex.cxx @@ -37,7 +37,7 @@ typedef int ( __stdcall * DllNativeRegProc ) ( int, BOOL, BOOL, const wchar_t* ); typedef int ( __stdcall * DllNativeUnregProc ) ( int, BOOL, BOOL ); -static BOOL UnicodeEquals( wchar_t const * pStr1, wchar_t const * pStr2 ) +static bool UnicodeEquals( wchar_t const * pStr1, wchar_t const * pStr2 ) { if ( pStr1 == nullptr && pStr2 == nullptr ) return TRUE; @@ -54,7 +54,7 @@ static BOOL UnicodeEquals( wchar_t const * pStr1, wchar_t const * pStr2 ) } -static void RegisterActiveXNative( const wchar_t* pActiveXPath, int nMode, BOOL InstallForAllUser, BOOL InstallFor64Bit ) +static void RegisterActiveXNative( const wchar_t* pActiveXPath, int nMode, bool InstallForAllUser, bool InstallFor64Bit ) { HINSTANCE hModule = LoadLibraryExW( pActiveXPath, nullptr, LOAD_WITH_ALTERED_SEARCH_PATH ); if( hModule ) @@ -82,7 +82,7 @@ static void RegisterActiveXNative( const wchar_t* pActiveXPath, int nMode, BOOL } -static void UnregisterActiveXNative( const wchar_t* pActiveXPath, int nMode, BOOL InstallForAllUser, BOOL InstallFor64Bit ) +static void UnregisterActiveXNative( const wchar_t* pActiveXPath, int nMode, bool InstallForAllUser, bool InstallFor64Bit ) { HINSTANCE hModule = LoadLibraryExW( pActiveXPath, nullptr, LOAD_WITH_ALTERED_SEARCH_PATH ); if( hModule ) @@ -96,7 +96,7 @@ static void UnregisterActiveXNative( const wchar_t* pActiveXPath, int nMode, BOO } -static BOOL GetMsiPropW( MSIHANDLE hMSI, const wchar_t* pPropName, wchar_t** ppValue ) +static bool GetMsiPropW( MSIHANDLE hMSI, const wchar_t* pPropName, wchar_t** ppValue ) { DWORD sz = 0; if ( MsiGetPropertyW( hMSI, pPropName, const_cast(L""), &sz ) == ERROR_MORE_DATA ) @@ -116,7 +116,7 @@ static BOOL GetMsiPropW( MSIHANDLE hMSI, const wchar_t* pPropName, wchar_t** ppV } -static BOOL GetActiveXControlPath( MSIHANDLE hMSI, wchar_t** ppActiveXPath ) +static bool GetActiveXControlPath( MSIHANDLE hMSI, wchar_t** ppActiveXPath ) { wchar_t* pProgPath = nullptr; if ( GetMsiPropW( hMSI, L"INSTALLLOCATION", &pProgPath ) && pProgPath ) @@ -136,7 +136,7 @@ static BOOL GetActiveXControlPath( MSIHANDLE hMSI, wchar_t** ppActiveXPath ) } -static BOOL GetDelta( MSIHANDLE hMSI, int& nOldInstallMode, int& nInstallMode, int& nDeinstallMode ) +static bool GetDelta( MSIHANDLE hMSI, int& nOldInstallMode, int& nInstallMode, int& nDeinstallMode ) { // for now the chart is always installed nOldInstallMode = CHART_COMPONENT; @@ -235,9 +235,9 @@ static BOOL GetDelta( MSIHANDLE hMSI, int& nOldInstallMode, int& nInstallMode, i } -static BOOL MakeInstallForAllUsers( MSIHANDLE hMSI ) +static bool MakeInstallForAllUsers( MSIHANDLE hMSI ) { - BOOL bResult = FALSE; + bool bResult = FALSE; wchar_t* pVal = nullptr; if ( GetMsiPropW( hMSI, L"ALLUSERS", &pVal ) && pVal ) { @@ -249,9 +249,9 @@ static BOOL MakeInstallForAllUsers( MSIHANDLE hMSI ) } -static BOOL MakeInstallFor64Bit( MSIHANDLE hMSI ) +static bool MakeInstallFor64Bit( MSIHANDLE hMSI ) { - BOOL bResult = FALSE; + bool bResult = FALSE; wchar_t* pVal = nullptr; if ( GetMsiPropW( hMSI, L"VersionNT64", &pVal ) && pVal ) { @@ -272,8 +272,8 @@ extern "C" __declspec(dllexport) UINT __stdcall InstallActiveXControl( MSIHANDLE int nOldInstallMode = 0; int nInstallMode = 0; int nDeinstallMode = 0; - BOOL bInstallForAllUser = MakeInstallForAllUsers( hMSI ); - BOOL bInstallFor64Bit = MakeInstallFor64Bit( hMSI ); + bool bInstallForAllUser = MakeInstallForAllUsers( hMSI ); + bool bInstallFor64Bit = MakeInstallFor64Bit( hMSI ); wchar_t* pActiveXPath = nullptr; if ( GetActiveXControlPath( hMSI, &pActiveXPath ) && pActiveXPath @@ -319,8 +319,8 @@ extern "C" __declspec(dllexport) UINT __stdcall DeinstallActiveXControl( MSIHAND wchar_t* pActiveXPath = nullptr; if ( current_state == INSTALLSTATE_LOCAL && GetActiveXControlPath( hMSI, &pActiveXPath ) && pActiveXPath ) { - BOOL bInstallForAllUser = MakeInstallForAllUsers( hMSI ); - BOOL bInstallFor64Bit = MakeInstallFor64Bit( hMSI ); + bool bInstallForAllUser = MakeInstallForAllUsers( hMSI ); + bool bInstallFor64Bit = MakeInstallFor64Bit( hMSI ); { UnregisterActiveXNative( pActiveXPath, diff --git a/setup_native/source/win32/customactions/sellang/sellang.cxx b/setup_native/source/win32/customactions/sellang/sellang.cxx index e82560f4239a..2610da36003e 100644 --- a/setup_native/source/win32/customactions/sellang/sellang.cxx +++ b/setup_native/source/win32/customactions/sellang/sellang.cxx @@ -38,7 +38,7 @@ #include -static BOOL GetMsiPropA( MSIHANDLE hMSI, const char* pPropName, char** ppValue ) +static bool GetMsiPropA( MSIHANDLE hMSI, const char* pPropName, char** ppValue ) { DWORD sz = 0; if ( MsiGetPropertyA( hMSI, pPropName, const_cast(""), &sz ) == ERROR_MORE_DATA ) { @@ -183,7 +183,7 @@ enum_ui_lang_proc (LPTSTR language, LONG_PTR /* unused_lParam */) return TRUE; } -static BOOL +static bool present_in_ui_langs(const char *lang) { for (int i = 0; i < num_ui_langs; i++) diff --git a/setup_native/source/win32/customactions/shellextensions/vistaspecial.cxx b/setup_native/source/win32/customactions/shellextensions/vistaspecial.cxx index ee4f7dc0df87..e61f4a43f38e 100644 --- a/setup_native/source/win32/customactions/shellextensions/vistaspecial.cxx +++ b/setup_native/source/win32/customactions/shellextensions/vistaspecial.cxx @@ -24,7 +24,7 @@ #include #include "../tools/seterror.hxx" -static BOOL RemoveCompleteDirectoryW(const std::wstring& rPath) +static bool RemoveCompleteDirectoryW(const std::wstring& rPath) { bool bDirectoryRemoved = true; diff --git a/setup_native/source/win32/customactions/tools/checkversion.cxx b/setup_native/source/win32/customactions/tools/checkversion.cxx index daf20963673b..c5355008d13d 100644 --- a/setup_native/source/win32/customactions/tools/checkversion.cxx +++ b/setup_native/source/win32/customactions/tools/checkversion.cxx @@ -30,7 +30,7 @@ #include "seterror.hxx" -static BOOL GetMsiPropW( MSIHANDLE hMSI, const wchar_t* pPropName, wchar_t** ppValue ) +static bool GetMsiPropW( MSIHANDLE hMSI, const wchar_t* pPropName, wchar_t** ppValue ) { DWORD sz = 0; if ( MsiGetPropertyW( hMSI, pPropName, const_cast(L""), &sz ) == ERROR_MORE_DATA ) -- cgit