diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2017-06-25 08:03:48 +1000 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-25 12:00:45 +0200 |
commit | 609c0d268ff52c0566ad77dc54de2eeb4d5ef4f8 (patch) | |
tree | af2530ba41eb85aa57e61e59b9ee2cfa4b624c0c /sal/osl/w32 | |
parent | dff3a597dad3b76990311ee356e0bd603753d8d3 (diff) |
osl: socket.cxx nullptr comparison cleanups
Change-Id: Ie0339482bf3a9b108e26008526bc5e73b761d27b
Reviewed-on: https://gerrit.libreoffice.org/39223
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sal/osl/w32')
-rw-r--r-- | sal/osl/w32/pipe.cxx | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/sal/osl/w32/pipe.cxx b/sal/osl/w32/pipe.cxx index ac75fc0236c7..217b18d918f8 100644 --- a/sal/osl/w32/pipe.cxx +++ b/sal/osl/w32/pipe.cxx @@ -78,12 +78,12 @@ oslPipe osl_createPipeImpl(void) void osl_destroyPipeImpl(oslPipe pPipe) { - if (pPipe != nullptr) + if (pPipe) { - if ( pPipe->m_NamedObject != INVALID_HANDLE_VALUE && pPipe->m_NamedObject != nullptr ) - CloseHandle( pPipe->m_NamedObject ); + if (pPipe->m_NamedObject != INVALID_HANDLE_VALUE && pPipe->m_NamedObject) + CloseHandle(pPipe->m_NamedObject); - if (pPipe->m_Security != nullptr) + if (pPipe->m_Security) { rtl_freeMemory(pPipe->m_Security->lpSecurityDescriptor); rtl_freeMemory(pPipe->m_Security); @@ -165,7 +165,7 @@ oslPipe SAL_CALL osl_createPipe(rtl_uString *strPipeName, oslPipeOptions Options pPipe->m_NamedObject = CreateMutexW(nullptr, FALSE, SAL_W(name->buffer)); - if (pPipe->m_NamedObject != INVALID_HANDLE_VALUE && pPipe->m_NamedObject != nullptr) + if (pPipe->m_NamedObject != INVALID_HANDLE_VALUE && pPipe->m_NamedObject) { if (GetLastError() != ERROR_ALREADY_EXISTS) { @@ -247,12 +247,10 @@ void SAL_CALL osl_acquirePipe(oslPipe pPipe) void SAL_CALL osl_releasePipe(oslPipe pPipe) { -// OSL_ASSERT( pPipe ); - - if (nullptr == pPipe) + if (!pPipe) return; - if (0 == osl_atomic_decrement(&(pPipe->m_Reference))) + if (osl_atomic_decrement(&(pPipe->m_Reference)) == 0) { if (!pPipe->m_bClosed) osl_closePipe(pPipe); @@ -263,7 +261,7 @@ void SAL_CALL osl_releasePipe(oslPipe pPipe) void SAL_CALL osl_closePipe(oslPipe pPipe) { - if(pPipe && !pPipe->m_bClosed) + if (pPipe && !pPipe->m_bClosed) { pPipe->m_bClosed = true; /* if we have a system pipe close it */ @@ -467,7 +465,7 @@ oslPipeError SAL_CALL osl_getLastPipeError(oslPipe pPipe) { oslPipeError Error; - if (pPipe != nullptr) + if (pPipe) { Error = pPipe->m_Error; pPipe->m_Error = osl_Pipe_E_None; |