diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-07-03 14:04:06 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-07-03 14:04:06 +0200 |
commit | a3bb6af1c2520b4bbb98a49bd7beed497d2d08b1 (patch) | |
tree | 8ff9b148f3e67526882c5ea24724f06ef4749c10 /sal | |
parent | 065a8ea524dacb8bda2ee00d0a6a08964823e0f5 (diff) |
loplugin:oncevar (clang-cl): sal
Change-Id: Ib43dd6f8c96274d251bbf5935888789964ba3f9b
Diffstat (limited to 'sal')
-rw-r--r-- | sal/osl/w32/file.cxx | 4 | ||||
-rw-r--r-- | sal/osl/w32/process.cxx | 5 | ||||
-rw-r--r-- | sal/osl/w32/profile.cxx | 4 | ||||
-rw-r--r-- | sal/osl/w32/salinit.cxx | 4 | ||||
-rw-r--r-- | sal/osl/w32/security.cxx | 3 | ||||
-rw-r--r-- | sal/osl/w32/socket.cxx | 3 |
6 files changed, 9 insertions, 14 deletions
diff --git a/sal/osl/w32/file.cxx b/sal/osl/w32/file.cxx index a2fea0ce1fed..43f04ba92310 100644 --- a/sal/osl/w32/file.cxx +++ b/sal/osl/w32/file.cxx @@ -711,7 +711,7 @@ oslFileError SAL_CALL osl_openFile( if (result != osl_File_E_None) return result; - DWORD dwAccess = GENERIC_READ, dwShare = FILE_SHARE_READ, dwCreation = 0, dwAttributes = 0; + DWORD dwAccess = GENERIC_READ, dwShare = FILE_SHARE_READ, dwCreation = 0; if (uFlags & osl_File_OpenFlag_Write) dwAccess |= GENERIC_WRITE; @@ -728,7 +728,7 @@ oslFileError SAL_CALL osl_openFile( HANDLE hFile = CreateFileW( SAL_W(rtl_uString_getStr(strSysPath)), - dwAccess, dwShare, nullptr, dwCreation, dwAttributes, nullptr); + dwAccess, dwShare, nullptr, dwCreation, 0, nullptr); // @@@ ERROR HANDLING @@@ if (!IsValidHandle(hFile)) diff --git a/sal/osl/w32/process.cxx b/sal/osl/w32/process.cxx index 6d86ae58bad8..528d6ad2409b 100644 --- a/sal/osl/w32/process.cxx +++ b/sal/osl/w32/process.cxx @@ -76,7 +76,7 @@ oslProcessError SAL_CALL osl_terminateProcess(oslProcess Process) // that the handle doesn't have the appropriate level of access... // see https://msdn.microsoft.com/en-au/library/windows/desktop/ms684880(v=vs.85).aspx - DWORD dwAccessFlags = (PROCESS_CREATE_THREAD | PROCESS_QUERY_INFORMATION | PROCESS_VM_OPERATION + 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 @@ -105,7 +105,6 @@ oslProcessError SAL_CALL osl_terminateProcess(oslProcess Process) // process DWORD dwTID = 0; // dummy variable as we don't need to track the thread ID - UINT uExitCode = 0; // dummy variable... ExitProcess has no return value // Note: we want to call on ExitProcess() and not TerminateProcess() - this is // because with ExitProcess() Windows notifies all attached dlls that the process @@ -121,7 +120,7 @@ oslProcessError SAL_CALL osl_terminateProcess(oslProcess Process) 0, /* initial size of stack in bytes is default size for executable */ reinterpret_cast<LPTHREAD_START_ROUTINE>(pfnExitProc), /* Win32 ExitProcess() */ - reinterpret_cast<PVOID>(uExitCode), /* ExitProcess() dummy return... */ + reinterpret_cast<PVOID>(UINT(0)), /* ExitProcess(UINT uExitCode) argument */ 0, /* value of 0 tells thread to run immediately after creation */ &dwTID); /* new remote thread's identifier */ diff --git a/sal/osl/w32/profile.cxx b/sal/osl/w32/profile.cxx index 66db4be6386b..97eb10f1eb07 100644 --- a/sal/osl/w32/profile.cxx +++ b/sal/osl/w32/profile.cxx @@ -1744,8 +1744,6 @@ static osl_TFile* osl_openTmpProfileImpl(osl_TProfileImpl* pProfile) static bool osl_ProfileSwapProfileNames(osl_TProfileImpl* pProfile) { - bool bRet = false; - rtl_uString* ustrBakFile=nullptr; rtl_uString* ustrTmpFile=nullptr; rtl_uString* ustrIniFile=nullptr; @@ -1778,7 +1776,7 @@ static bool osl_ProfileSwapProfileNames(osl_TProfileImpl* pProfile) /* rename tmp ini */ MoveFileExW( reinterpret_cast<LPCWSTR>(rtl_uString_getStr( ustrTmpFile )), reinterpret_cast<LPCWSTR>(rtl_uString_getStr( ustrIniFile )), MOVEFILE_COPY_ALLOWED | MOVEFILE_WRITE_THROUGH ); - return bRet; + return false; } static rtl_uString* osl_ProfileGenerateExtension(rtl_uString* ustrFileName, rtl_uString* ustrExtension) diff --git a/sal/osl/w32/salinit.cxx b/sal/osl/w32/salinit.cxx index 2b7d338589f6..e3bd9208fc86 100644 --- a/sal/osl/w32/salinit.cxx +++ b/sal/osl/w32/salinit.cxx @@ -65,8 +65,8 @@ void sal_detail_initialize(int argc, char ** argv) error = WSAStartup(wVersionRequested, &wsaData); if ( 0 == error ) { - WORD wMajorVersionRequired = 1; - WORD wMinorVersionRequired = 1; + WORD const wMajorVersionRequired = 1; + WORD const wMinorVersionRequired = 1; if ((LOBYTE(wsaData.wVersion) < wMajorVersionRequired) || ((LOBYTE(wsaData.wVersion) == wMajorVersionRequired) && diff --git a/sal/osl/w32/security.cxx b/sal/osl/w32/security.cxx index 591e6b6b42c9..eba02216fa70 100644 --- a/sal/osl/w32/security.cxx +++ b/sal/osl/w32/security.cxx @@ -335,7 +335,6 @@ sal_Bool SAL_CALL osl_getUserIdent(oslSecurity Security, rtl_uString **strIdent) PSID pSid = reinterpret_cast<PTOKEN_USER>(pInfoBuffer)->User.Sid; PSID_IDENTIFIER_AUTHORITY psia; DWORD dwSubAuthorities; - DWORD dwSidRev=SID_REVISION; DWORD dwCounter; DWORD dwSidSize; PUCHAR pSSACount; @@ -351,7 +350,7 @@ sal_Bool SAL_CALL osl_getUserIdent(oslSecurity Security, rtl_uString **strIdent) Ident=static_cast<sal_Char *>(malloc(88*sizeof(sal_Char))); /* prepare S-SID_REVISION- */ - dwSidSize=wsprintf(Ident, TEXT("S-%lu-"), dwSidRev); + dwSidSize=wsprintf(Ident, TEXT("S-%lu-"), SID_REVISION); /* prepare SidIdentifierAuthority */ if ((psia->Value[0] != 0) || (psia->Value[1] != 0)) diff --git a/sal/osl/w32/socket.cxx b/sal/osl/w32/socket.cxx index c1f5b461fc24..9074de45353b 100644 --- a/sal/osl/w32/socket.cxx +++ b/sal/osl/w32/socket.cxx @@ -1888,7 +1888,6 @@ sal_Int32 SAL_CALL osl_demultiplexSocketEvents ( oslSocketSet OutOfBandSet, const TimeValue* pTimeout) { - int MaxHandle= 0; struct timeval tv; if(pTimeout) @@ -1898,7 +1897,7 @@ sal_Int32 SAL_CALL osl_demultiplexSocketEvents ( tv.tv_usec = pTimeout->Nanosec / 1000L; } - return select(MaxHandle, /* redundant in WIN32 */ + return select(0, /* redundant in WIN32 */ IncomingSet ? &IncomingSet->m_Set : nullptr, OutgoingSet ? &OutgoingSet->m_Set : nullptr, OutOfBandSet ? &OutOfBandSet->m_Set : nullptr, |