summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-11-19 15:15:50 +0100
committerStephan Bergmann <sbergman@redhat.com>2019-11-19 21:34:30 +0100
commit5a11fe87a6f1507149a0965aa740dcdf4ccef3c3 (patch)
tree3f3e788a0e54c94e980bd61e4466d4d6e2c34415 /sal
parent77d301f5e40e4f0fb4a127b8b6361a0fb1b1dbd9 (diff)
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 <sbergman@redhat.com>
Diffstat (limited to 'sal')
-rw-r--r--sal/osl/w32/dllentry.cxx2
-rw-r--r--sal/osl/w32/file_dirvol.cxx36
-rw-r--r--sal/osl/w32/pipe.cxx2
-rw-r--r--sal/osl/w32/process.cxx2
-rw-r--r--sal/osl/w32/procimpl.cxx4
-rw-r--r--sal/osl/w32/profile.cxx8
-rw-r--r--sal/osl/w32/security.cxx10
7 files changed, 32 insertions, 32 deletions
diff --git a/sal/osl/w32/dllentry.cxx b/sal/osl/w32/dllentry.cxx
index 300d43ac1631..9493e59bc982 100644
--- a/sal/osl/w32/dllentry.cxx
+++ b/sal/osl/w32/dllentry.cxx
@@ -153,7 +153,7 @@ static DWORD GetParentProcessId()
if ( IsValidHandle( hSnapshot ) )
{
PROCESSENTRY32 pe;
- BOOL fSuccess;
+ bool fSuccess;
ZeroMemory( &pe, sizeof(pe) );
pe.dwSize = sizeof(pe);
diff --git a/sal/osl/w32/file_dirvol.cxx b/sal/osl/w32/file_dirvol.cxx
index c8ccd4001126..70e9b9ccc444 100644
--- a/sal/osl/w32/file_dirvol.cxx
+++ b/sal/osl/w32/file_dirvol.cxx
@@ -40,7 +40,7 @@ BOOL TimeValueToFileTime(const TimeValue *cpTimeVal, FILETIME *pFTime)
SYSTEMTIME BaseSysTime;
FILETIME BaseFileTime;
FILETIME FTime;
- BOOL fSuccess = FALSE;
+ bool fSuccess = FALSE;
BaseSysTime.wYear = 1970;
BaseSysTime.wMonth = 1;
@@ -71,7 +71,7 @@ BOOL FileTimeToTimeValue(const FILETIME *cpFTime, TimeValue *pTimeVal)
{
SYSTEMTIME BaseSysTime;
FILETIME BaseFileTime;
- BOOL fSuccess = FALSE; /* Assume failure */
+ bool fSuccess = FALSE; /* Assume failure */
BaseSysTime.wYear = 1970;
BaseSysTime.wMonth = 1;
@@ -275,9 +275,9 @@ static HANDLE WINAPI OpenLogicalDrivesEnum()
return pEnum ? static_cast<HANDLE>(pEnum) : INVALID_HANDLE_VALUE;
}
-static BOOL WINAPI EnumLogicalDrives(HANDLE hEnum, LPWSTR lpBuffer)
+static bool WINAPI EnumLogicalDrives(HANDLE hEnum, LPWSTR lpBuffer)
{
- BOOL fSuccess = FALSE;
+ bool fSuccess = FALSE;
LPDRIVEENUM pEnum = static_cast<LPDRIVEENUM>(hEnum);
if ( pEnum )
@@ -299,9 +299,9 @@ static BOOL WINAPI EnumLogicalDrives(HANDLE hEnum, LPWSTR lpBuffer)
return fSuccess;
}
-static BOOL WINAPI CloseLogicalDrivesEnum(HANDLE hEnum)
+static bool WINAPI CloseLogicalDrivesEnum(HANDLE hEnum)
{
- BOOL fSuccess = FALSE;
+ bool fSuccess = FALSE;
LPDRIVEENUM pEnum = static_cast<LPDRIVEENUM>(hEnum);
if ( pEnum )
@@ -368,14 +368,14 @@ static HANDLE WINAPI OpenDirectory( rtl_uString* pPath)
return static_cast<HANDLE>(pDirectory);
}
-static BOOL WINAPI EnumDirectory(HANDLE hDirectory, LPWIN32_FIND_DATAW pFindData)
+static bool WINAPI EnumDirectory(HANDLE hDirectory, LPWIN32_FIND_DATAW pFindData)
{
- BOOL fSuccess = FALSE;
+ bool fSuccess = FALSE;
LPDIRECTORY pDirectory = static_cast<LPDIRECTORY>(hDirectory);
if ( pDirectory )
{
- BOOL fValid;
+ bool fValid;
do
{
@@ -403,9 +403,9 @@ static BOOL WINAPI EnumDirectory(HANDLE hDirectory, LPWIN32_FIND_DATAW pFindData
return fSuccess;
}
-static BOOL WINAPI CloseDirectory(HANDLE hDirectory)
+static bool WINAPI CloseDirectory(HANDLE hDirectory)
{
- BOOL fSuccess = FALSE;
+ bool fSuccess = FALSE;
LPDIRECTORY pDirectory = static_cast<LPDIRECTORY>(hDirectory);
if (pDirectory)
@@ -587,7 +587,7 @@ static DWORD create_dir_with_callback(
// user specified callback function. On success
// the function returns ERROR_SUCCESS else a Win32 error code.
- BOOL bCreated = CreateDirectoryW( o3tl::toW(rtl_uString_getStr( dir_path )), nullptr );
+ bool bCreated = CreateDirectoryW( o3tl::toW(rtl_uString_getStr( dir_path )), nullptr );
if ( bCreated )
{
@@ -687,7 +687,7 @@ oslFileError osl_createDirectoryWithFlags(rtl_uString * strPath, sal_uInt32)
if ( osl_File_E_None == error )
{
- BOOL bCreated = CreateDirectoryW( o3tl::toW(rtl_uString_getStr( strSysPath )), nullptr );
+ bool bCreated = CreateDirectoryW( o3tl::toW(rtl_uString_getStr( strSysPath )), nullptr );
if ( !bCreated )
{
@@ -812,7 +812,7 @@ static oslFileError osl_getNextDrive(
{
Directory_Impl *pDirImpl = static_cast<Directory_Impl *>(Directory);
DirectoryItem_Impl *pItemImpl = nullptr;
- BOOL fSuccess;
+ bool fSuccess;
if ( !pItem )
return osl_File_E_INVAL;
@@ -853,7 +853,7 @@ static oslFileError osl_getNextFileItem(
{
Directory_Impl *pDirImpl = static_cast<Directory_Impl *>(Directory);
DirectoryItem_Impl *pItemImpl = nullptr;
- BOOL fFound;
+ bool fFound;
if ( !pItem )
return osl_File_E_INVAL;
@@ -1306,7 +1306,7 @@ static bool is_volume_space_info_request(sal_uInt32 field_mask)
static void get_volume_space_information(
const OUString& path, oslVolumeInfo *pInfo)
{
- BOOL ret = GetDiskFreeSpaceExW(
+ bool ret = GetDiskFreeSpaceExW(
o3tl::toW(path.getStr()),
reinterpret_cast<PULARGE_INTEGER>(&pInfo->uFreeSpace),
reinterpret_cast<PULARGE_INTEGER>(&pInfo->uTotalSpace),
@@ -1693,7 +1693,7 @@ oslFileError SAL_CALL osl_setFileAttributes(
oslFileError error;
rtl_uString *ustrSysPath = nullptr;
DWORD dwFileAttributes;
- BOOL fSuccess;
+ bool fSuccess;
// Converts the normalized path into a systempath
error = osl_getSystemPathFromFileURL_( ustrFileURL, &ustrSysPath, false );
@@ -1743,7 +1743,7 @@ oslFileError SAL_CALL osl_setFileTime(
FILETIME ftLastAccessTime;
FILETIME ftLastWriteTime;
HANDLE hFile;
- BOOL fSuccess;
+ bool fSuccess;
error=osl_getSystemPathFromFileURL_(filePath, &sysPath, false);
diff --git a/sal/osl/w32/pipe.cxx b/sal/osl/w32/pipe.cxx
index 7c3471888527..89463b899d72 100644
--- a/sal/osl/w32/pipe.cxx
+++ b/sal/osl/w32/pipe.cxx
@@ -206,7 +206,7 @@ oslPipe SAL_CALL osl_createPipe(rtl_uString *strPipeName, oslPipeOptions Options
}
else
{
- BOOL bPipeAvailable;
+ bool bPipeAvailable;
do
{
diff --git a/sal/osl/w32/process.cxx b/sal/osl/w32/process.cxx
index cc5c1568f2f4..f235fc5a572c 100644
--- a/sal/osl/w32/process.cxx
+++ b/sal/osl/w32/process.cxx
@@ -69,7 +69,7 @@ oslProcessError SAL_CALL osl_terminateProcess(oslProcess Process)
DWORD const dwAccessFlags = (PROCESS_CREATE_THREAD | PROCESS_QUERY_INFORMATION | PROCESS_VM_OPERATION
| PROCESS_VM_WRITE | PROCESS_VM_READ);
- BOOL bHaveDuplHdl = DuplicateHandle(GetCurrentProcess(), // handle to process that has handle
+ bool bHaveDuplHdl = DuplicateHandle(GetCurrentProcess(), // handle to process that has handle
hProcess, // handle to be duplicated
GetCurrentProcess(), // process that will get the dup handle
&hDupProcess, // store duplicate process handle here
diff --git a/sal/osl/w32/procimpl.cxx b/sal/osl/w32/procimpl.cxx
index fa490a7c29bf..814359647575 100644
--- a/sal/osl/w32/procimpl.cxx
+++ b/sal/osl/w32/procimpl.cxx
@@ -198,7 +198,7 @@ namespace /* private */
sa.lpSecurityDescriptor = p_security_descriptor;
sa.bInheritHandle = b_read_pipe_inheritable || b_write_pipe_inheritable;
- BOOL bRet = FALSE;
+ bool bRet = FALSE;
HANDLE hTemp = nullptr;
if (!b_read_pipe_inheritable && b_write_pipe_inheritable)
@@ -520,7 +520,7 @@ oslProcessError SAL_CALL osl_executeProcess_WithRedirectedIO(
OUString cmdline = command_line.makeStringAndClear();
PROCESS_INFORMATION process_info;
- BOOL bRet = FALSE;
+ bool bRet = FALSE;
if ((Security != nullptr) && (static_cast<oslSecurityImpl*>(Security)->m_hToken != nullptr))
{
diff --git a/sal/osl/w32/profile.cxx b/sal/osl/w32/profile.cxx
index 55b7ea0d7c06..0c1da6527fd2 100644
--- a/sal/osl/w32/profile.cxx
+++ b/sal/osl/w32/profile.cxx
@@ -335,7 +335,7 @@ sal_Bool SAL_CALL osl_flushProfile(oslProfile Profile)
static bool writeProfileImpl(osl_TFile* pFile)
{
DWORD BytesWritten=0;
- BOOL bRet;
+ bool bRet;
if ( pFile == nullptr || pFile->m_Handle == INVALID_HANDLE_VALUE || ( pFile->m_pWriteBuf == nullptr ) )
{
@@ -344,7 +344,7 @@ static bool writeProfileImpl(osl_TFile* pFile)
bRet=WriteFile(pFile->m_Handle, pFile->m_pWriteBuf, pFile->m_nWriteBufLen - pFile->m_nWriteBufFree,&BytesWritten,nullptr);
- if ( bRet == 0 || BytesWritten == 0 )
+ if ( !bRet || BytesWritten == 0 )
{
OSL_ENSURE(bRet,"WriteFile failed!!!");
SAL_WARN("sal.osl", "write failed " << strerror(errno));
@@ -404,7 +404,7 @@ DWORD GetPrivateProfileStringWrapper(const osl_TProfileImpl* pProfile,
}
// Use Unicode version of WritePrivateProfileString, to work with Multi-language paths
-BOOL WritePrivateProfileStringWrapper(const osl_TProfileImpl* pProfile,
+bool WritePrivateProfileStringWrapper(const osl_TProfileImpl* pProfile,
const sal_Char* pszSection, const sal_Char* pszEntry,
const sal_Char* pszString)
{
@@ -427,7 +427,7 @@ BOOL WritePrivateProfileStringWrapper(const osl_TProfileImpl* pProfile,
pWEntry = (pEntry ? o3tl::toW(rtl_uString_getStr(pEntry)) : nullptr),
pWString = (pString ? o3tl::toW(rtl_uString_getStr(pString)) : nullptr);
- BOOL bResult = WritePrivateProfileStringW(pWSection, pWEntry, pWString, o3tl::toW(rtl_uString_getStr(pProfile->m_strFileName)));
+ bool bResult = WritePrivateProfileStringW(pWSection, pWEntry, pWString, o3tl::toW(rtl_uString_getStr(pProfile->m_strFileName)));
if (pString)
rtl_uString_release(pString);
diff --git a/sal/osl/w32/security.cxx b/sal/osl/w32/security.cxx
index d0872ef2c19c..bd3cf3339dc7 100644
--- a/sal/osl/w32/security.cxx
+++ b/sal/osl/w32/security.cxx
@@ -41,7 +41,7 @@
static bool GetSpecialFolder(rtl_uString **strPath, REFKNOWNFOLDERID rFolder);
// We use LPCTSTR here, because we use it with SE_foo_NAME constants
// which are defined in winnt.h as UNICODE-dependent TEXT("PrivilegeName")
-static BOOL Privilege(LPCTSTR pszPrivilege, BOOL bEnable);
+static bool Privilege(LPCTSTR pszPrivilege, bool bEnable);
static bool getUserNameImpl(oslSecurity Security, rtl_uString **strName, bool bIncludeDomain);
oslSecurity SAL_CALL osl_getCurrentSecurity(void)
@@ -296,7 +296,7 @@ sal_Bool SAL_CALL osl_getUserIdent(oslSecurity Security, rtl_uString **strIdent)
PSID pSid = reinterpret_cast<PTOKEN_USER>(pInfoBuffer)->User.Sid;
LPWSTR pSidStr = nullptr;
- BOOL bResult = ConvertSidToStringSidW(pSid, &pSidStr);
+ bool bResult = ConvertSidToStringSidW(pSid, &pSidStr);
if (bResult)
{
rtl_uString_newFromStr(strIdent, o3tl::toU(pSidStr));
@@ -312,7 +312,7 @@ sal_Bool SAL_CALL osl_getUserIdent(oslSecurity Security, rtl_uString **strIdent)
free(pInfoBuffer);
- return bResult != FALSE;
+ return bResult;
}
}
else
@@ -440,7 +440,7 @@ sal_Bool SAL_CALL osl_loadUserProfile(oslSecurity Security)
RegCloseKey(HKEY_CURRENT_USER);
- if (Privilege(SE_RESTORE_NAME, TRUE))
+ if (Privilege(SE_RESTORE_NAME, true))
{
HANDLE hAccessToken = static_cast<oslSecurityImpl*>(Security)->m_hToken;
@@ -529,7 +529,7 @@ static bool GetSpecialFolder(rtl_uString **strPath, REFKNOWNFOLDERID rFolder)
// We use LPCTSTR here, because we use it with SE_foo_NAME constants
// which are defined in winnt.h as UNICODE-dependent TEXT("PrivilegeName")
-static BOOL Privilege(LPCTSTR strPrivilege, BOOL bEnable)
+static bool Privilege(LPCTSTR strPrivilege, bool bEnable)
{
HANDLE hToken;
TOKEN_PRIVILEGES tp;