[Libreoffice-commits] core.git: compilerplugins/clang sal/osl sal/qa

Stephan Bergmann sbergman at redhat.com
Tue May 16 15:19:52 UTC 2017


 compilerplugins/clang/comparisonwithconstant.cxx |    4 +-
 sal/osl/unx/file.cxx                             |   40 +++++++++++------------
 sal/osl/unx/file_misc.cxx                        |   16 ++++-----
 sal/osl/unx/file_path_helper.cxx                 |    8 ++--
 sal/osl/unx/file_stat.cxx                        |    2 -
 sal/osl/unx/file_url.cxx                         |    4 +-
 sal/osl/unx/nlsupport.cxx                        |    2 -
 sal/osl/unx/pipe.cxx                             |    2 -
 sal/osl/unx/process.cxx                          |    2 -
 sal/osl/unx/socket.cxx                           |    2 -
 sal/osl/unx/tempfile.cxx                         |    4 +-
 sal/qa/osl/process/osl_process.cxx               |    2 -
 sal/qa/osl/process/osl_process_child.cxx         |    2 -
 13 files changed, 45 insertions(+), 45 deletions(-)

New commits:
commit 189c3a098e0ee5b64e2ab40c3980a2a654315468
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue May 16 17:19:11 2017 +0200

    Extend loplugin:comparisonwithconstant beyond integral types
    
    Change-Id: Id3a8fd5d8b9975d3ae49af0648b39454310495fa

diff --git a/compilerplugins/clang/comparisonwithconstant.cxx b/compilerplugins/clang/comparisonwithconstant.cxx
index c0fe91f9508c..cf721a83c4e3 100644
--- a/compilerplugins/clang/comparisonwithconstant.cxx
+++ b/compilerplugins/clang/comparisonwithconstant.cxx
@@ -58,10 +58,10 @@ bool ComparisonWithConstant::VisitBinaryOperator(const BinaryOperator* binaryOp)
         return true;
     }
     APValue result;
-    if (!binaryOp->getLHS()->isIntegerConstantExpr(compiler.getASTContext())) {
+    if (!binaryOp->getLHS()->isEvaluatable(compiler.getASTContext())) {
         return true;
     }
-    if (binaryOp->getRHS()->isIntegerConstantExpr(compiler.getASTContext())) {
+    if (binaryOp->getRHS()->isEvaluatable(compiler.getASTContext())) {
         return true;
     }
     if (!rewrite(binaryOp))
diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx
index 933780f87d8f..9d7b31d3a7d4 100644
--- a/sal/osl/unx/file.cxx
+++ b/sal/osl/unx/file.cxx
@@ -197,7 +197,7 @@ FileHandle_Impl::Allocator::Allocator()
     {
         m_cache  = rtl_cache_create (
             "osl_file_buffer_cache", pagesize, 0, nullptr, nullptr, nullptr, nullptr, nullptr, 0);
-        if (nullptr != m_cache)
+        if (m_cache != nullptr)
             m_bufsiz = pagesize;
     }
 }
@@ -210,7 +210,7 @@ FileHandle_Impl::Allocator::~Allocator()
 void FileHandle_Impl::Allocator::allocate (sal_uInt8 ** ppBuffer, size_t * pnSize)
 {
     OSL_PRECOND((nullptr != ppBuffer) && (nullptr != pnSize), "FileHandle_Impl::Allocator::allocate(): contract violation");
-    if ((nullptr != ppBuffer) && (nullptr != pnSize))
+    if ((ppBuffer != nullptr) && (pnSize != nullptr))
     {
         *ppBuffer = static_cast< sal_uInt8* >(rtl_cache_alloc(m_cache));
         *pnSize = m_bufsiz;
@@ -218,7 +218,7 @@ void FileHandle_Impl::Allocator::allocate (sal_uInt8 ** ppBuffer, size_t * pnSiz
 }
 void FileHandle_Impl::Allocator::deallocate (sal_uInt8 * pBuffer)
 {
-    if (nullptr != pBuffer)
+    if (pBuffer != nullptr)
         rtl_cache_free (m_cache, pBuffer);
 }
 
@@ -251,7 +251,7 @@ FileHandle_Impl::FileHandle_Impl (int fd, enum Kind kind, char const * path)
     rtl_string_newFromStr (&m_strFilePath, path);
     if (m_kind == KIND_FD) {
         Allocator::get().allocate (&m_buffer, &m_bufsiz);
-        if (nullptr != m_buffer)
+        if (m_buffer != nullptr)
             memset (m_buffer, 0, m_bufsiz);
     }
 }
@@ -431,7 +431,7 @@ oslFileError FileHandle_Impl::readFileAt (
         *pBytesRead = nBytes;
         return osl_File_E_None;
     }
-    if (m_kind == KIND_MEM || nullptr == m_buffer)
+    if (m_kind == KIND_MEM || m_buffer == nullptr)
     {
         // not buffered
         return readAt (nOffset, pBuffer, nBytesRequested, pBytesRead);
@@ -504,7 +504,7 @@ oslFileError FileHandle_Impl::writeFileAt (
         *pBytesWritten = nBytes;
         return osl_File_E_None;
     }
-    if (nullptr == m_buffer)
+    if (m_buffer == nullptr)
     {
         // not buffered
         return writeAt (nOffset, pBuffer, nBytesToWrite, pBytesWritten);
@@ -734,7 +734,7 @@ oslFileHandle osl::detail::createFileHandleFromFD( int fd )
         return nullptr; // EBADF
 
     FileHandle_Impl * pImpl = new FileHandle_Impl (fd);
-    if (nullptr == pImpl)
+    if (pImpl == nullptr)
         return nullptr; // ENOMEM
 
     // assume writeable
@@ -1107,7 +1107,7 @@ SAL_CALL osl_syncFile(oslFileHandle Handle)
 {
     FileHandle_Impl* pImpl = static_cast<FileHandle_Impl*>(Handle);
 
-    if ((nullptr == pImpl) || ((pImpl->m_kind == FileHandle_Impl::KIND_FD) && (pImpl->m_fd == -1)))
+    if ((pImpl == nullptr) || ((pImpl->m_kind == FileHandle_Impl::KIND_FD) && (pImpl->m_fd == -1)))
         return osl_File_E_INVAL;
 
     if (pImpl->m_kind == FileHandle_Impl::KIND_MEM)
@@ -1138,7 +1138,7 @@ SAL_CALL osl_mapFile (
 {
     FileHandle_Impl* pImpl = static_cast<FileHandle_Impl*>(Handle);
 
-    if ((nullptr == pImpl) || ((pImpl->m_kind == FileHandle_Impl::KIND_FD) && (pImpl->m_fd == -1)) || (nullptr == ppAddr))
+    if ((pImpl == nullptr) || ((pImpl->m_kind == FileHandle_Impl::KIND_FD) && (pImpl->m_fd == -1)) || (ppAddr == nullptr))
         return osl_File_E_INVAL;
     *ppAddr = nullptr;
 
@@ -1218,7 +1218,7 @@ static
 oslFileError
 unmapFile (void* pAddr, sal_uInt64 uLength)
 {
-    if (nullptr == pAddr)
+    if (pAddr == nullptr)
         return osl_File_E_INVAL;
 
     if (uLength > SAL_MAX_SIZE)
@@ -1269,7 +1269,7 @@ SAL_CALL osl_readLine (
 {
     FileHandle_Impl * pImpl = static_cast<FileHandle_Impl*>(Handle);
 
-    if ((nullptr == pImpl) || ((pImpl->m_kind == FileHandle_Impl::KIND_FD) && (pImpl->m_fd == -1)) || (nullptr == ppSequence))
+    if ((pImpl == nullptr) || ((pImpl->m_kind == FileHandle_Impl::KIND_FD) && (pImpl->m_fd == -1)) || (ppSequence == nullptr))
         return osl_File_E_INVAL;
     sal_uInt64 uBytesRead = 0;
 
@@ -1291,7 +1291,7 @@ SAL_CALL osl_readFile (
 {
     FileHandle_Impl* pImpl = static_cast<FileHandle_Impl*>(Handle);
 
-    if ((nullptr == pImpl) || ((pImpl->m_kind == FileHandle_Impl::KIND_FD) && (pImpl->m_fd == -1)) || (nullptr == pBuffer) || (nullptr == pBytesRead))
+    if ((pImpl == nullptr) || ((pImpl->m_kind == FileHandle_Impl::KIND_FD) && (pImpl->m_fd == -1)) || (pBuffer == nullptr) || (pBytesRead == nullptr))
         return osl_File_E_INVAL;
 
     static sal_uInt64 const g_limit_ssize_t = std::numeric_limits< ssize_t >::max();
@@ -1317,7 +1317,7 @@ SAL_CALL osl_writeFile (
 {
     FileHandle_Impl* pImpl = static_cast<FileHandle_Impl*>(Handle);
 
-    if ((nullptr == pImpl) || (pImpl->m_fd == -1) || (nullptr == pBuffer) || (nullptr == pBytesWritten))
+    if ((pImpl == nullptr) || (pImpl->m_fd == -1) || (pBuffer == nullptr) || (pBytesWritten == nullptr))
         return osl_File_E_INVAL;
     if ((pImpl->m_state & FileHandle_Impl::STATE_WRITEABLE) == 0)
         return osl_File_E_BADF;
@@ -1346,7 +1346,7 @@ SAL_CALL osl_readFileAt (
 {
     FileHandle_Impl* pImpl = static_cast<FileHandle_Impl*>(Handle);
 
-    if ((nullptr == pImpl) || ((pImpl->m_kind == FileHandle_Impl::KIND_FD) && (pImpl->m_fd == -1)) || (nullptr == pBuffer) || (nullptr == pBytesRead))
+    if ((pImpl == nullptr) || ((pImpl->m_kind == FileHandle_Impl::KIND_FD) && (pImpl->m_fd == -1)) || (pBuffer == nullptr) || (pBytesRead == nullptr))
         return osl_File_E_INVAL;
     if ((pImpl->m_state & FileHandle_Impl::STATE_SEEKABLE) == 0)
         return osl_File_E_SPIPE;
@@ -1376,7 +1376,7 @@ SAL_CALL osl_writeFileAt (
 {
     FileHandle_Impl* pImpl = static_cast<FileHandle_Impl*>(Handle);
 
-    if ((nullptr == pImpl) || (pImpl->m_fd == -1) || (nullptr == pBuffer) || (nullptr == pBytesWritten))
+    if ((pImpl == nullptr) || (pImpl->m_fd == -1) || (pBuffer == nullptr) || (pBytesWritten == nullptr))
         return osl_File_E_INVAL;
     if ((pImpl->m_state & FileHandle_Impl::STATE_SEEKABLE) == 0)
         return osl_File_E_SPIPE;
@@ -1403,7 +1403,7 @@ SAL_CALL osl_isEndOfFile( oslFileHandle Handle, sal_Bool *pIsEOF )
 {
     FileHandle_Impl* pImpl = static_cast<FileHandle_Impl*>(Handle);
 
-    if ((nullptr == pImpl) || ((pImpl->m_kind == FileHandle_Impl::KIND_FD) && (pImpl->m_fd == -1)) || (nullptr == pIsEOF))
+    if ((pImpl == nullptr) || ((pImpl->m_kind == FileHandle_Impl::KIND_FD) && (pImpl->m_fd == -1)) || (pIsEOF == nullptr))
         return osl_File_E_INVAL;
 
     FileHandle_Impl::Guard lock (&(pImpl->m_mutex));
@@ -1416,7 +1416,7 @@ SAL_CALL osl_getFilePos( oslFileHandle Handle, sal_uInt64* pPos )
 {
     FileHandle_Impl* pImpl = static_cast<FileHandle_Impl*>(Handle);
 
-    if ((nullptr == pImpl) || ((pImpl->m_kind == FileHandle_Impl::KIND_FD) && (pImpl->m_fd == -1)) || (nullptr == pPos))
+    if ((pImpl == nullptr) || ((pImpl->m_kind == FileHandle_Impl::KIND_FD) && (pImpl->m_fd == -1)) || (pPos == nullptr))
         return osl_File_E_INVAL;
 
     FileHandle_Impl::Guard lock (&(pImpl->m_mutex));
@@ -1429,7 +1429,7 @@ SAL_CALL osl_setFilePos (oslFileHandle Handle, sal_uInt32 uHow, sal_Int64 uOffse
 {
     FileHandle_Impl* pImpl = static_cast<FileHandle_Impl*>(Handle);
 
-    if ((nullptr == pImpl) || ((pImpl->m_kind == FileHandle_Impl::KIND_FD) && (pImpl->m_fd == -1)))
+    if ((pImpl == nullptr) || ((pImpl->m_kind == FileHandle_Impl::KIND_FD) && (pImpl->m_fd == -1)))
         return osl_File_E_INVAL;
 
     sal_Int64 const limit_off_t = MAX_OFF_T;
@@ -1473,7 +1473,7 @@ SAL_CALL osl_getFileSize( oslFileHandle Handle, sal_uInt64* pSize )
 {
     FileHandle_Impl* pImpl = static_cast<FileHandle_Impl*>(Handle);
 
-    if ((nullptr == pImpl) || ((pImpl->m_kind == FileHandle_Impl::KIND_FD) && (pImpl->m_fd == -1)) || (nullptr == pSize))
+    if ((pImpl == nullptr) || ((pImpl->m_kind == FileHandle_Impl::KIND_FD) && (pImpl->m_fd == -1)) || (pSize == nullptr))
         return osl_File_E_INVAL;
 
     FileHandle_Impl::Guard lock (&(pImpl->m_mutex));
@@ -1486,7 +1486,7 @@ SAL_CALL osl_setFileSize( oslFileHandle Handle, sal_uInt64 uSize )
 {
     FileHandle_Impl* pImpl = static_cast<FileHandle_Impl*>(Handle);
 
-    if ((nullptr == pImpl) || (pImpl->m_fd == -1))
+    if ((pImpl == nullptr) || (pImpl->m_fd == -1))
         return osl_File_E_INVAL;
     if ((pImpl->m_state & FileHandle_Impl::STATE_WRITEABLE) == 0)
         return osl_File_E_BADF;
diff --git a/sal/osl/unx/file_misc.cxx b/sal/osl/unx/file_misc.cxx
index a651ed5cd342..52fd6b780bb0 100644
--- a/sal/osl/unx/file_misc.cxx
+++ b/sal/osl/unx/file_misc.cxx
@@ -143,7 +143,7 @@ oslFileError SAL_CALL osl_openDirectory(rtl_uString* ustrDirectoryURL, oslDirect
 
     char path[PATH_MAX];
 
-    if ((nullptr == ustrDirectoryURL) || (ustrDirectoryURL->length == 0) || (nullptr == pDirectory))
+    if ((ustrDirectoryURL == nullptr) || (ustrDirectoryURL->length == 0) || (pDirectory == nullptr))
         return osl_File_E_INVAL;
 
     /* convert file URL to system path */
@@ -231,7 +231,7 @@ oslFileError SAL_CALL osl_closeDirectory( oslDirectory Directory )
 
     OSL_ASSERT( Directory );
 
-    if( nullptr == pDirImpl )
+    if( pDirImpl == nullptr )
         return osl_File_E_INVAL;
 
 #ifdef ANDROID
@@ -287,7 +287,7 @@ oslFileError SAL_CALL osl_getNextDirectoryItem(oslDirectory Directory, oslDirect
     OSL_ASSERT(Directory);
     OSL_ASSERT(pItem);
 
-    if ((nullptr == Directory) || (nullptr == pItem))
+    if ((Directory == nullptr) || (pItem == nullptr))
         return osl_File_E_INVAL;
 
 #ifdef ANDROID
@@ -301,7 +301,7 @@ oslFileError SAL_CALL osl_getNextDirectoryItem(oslDirectory Directory, oslDirect
         pEntry = osl_readdir_impl_(pDirImpl->pDirStruct, true);
     }
 
-    if (nullptr == pEntry)
+    if (pEntry == nullptr)
         return osl_File_E_NOENT;
 
 #if defined(MACOSX)
@@ -328,7 +328,7 @@ oslFileError SAL_CALL osl_getNextDirectoryItem(oslDirectory Directory, oslDirect
     rtl_uString_release( ustrFileName );
 
     DirectoryItem_Impl * pImpl = static_cast< DirectoryItem_Impl* >(*pItem);
-    if (nullptr != pImpl)
+    if (pImpl != nullptr)
     {
         pImpl->release();
         pImpl = nullptr;
@@ -350,7 +350,7 @@ oslFileError SAL_CALL osl_getDirectoryItem( rtl_uString* ustrFileURL, oslDirecto
     oslFileError osl_error      = osl_File_E_INVAL;
 
     OSL_ASSERT((nullptr != ustrFileURL) && (nullptr != pItem));
-    if ((nullptr == ustrFileURL) || (ustrFileURL->length == 0) || (nullptr == pItem))
+    if ((ustrFileURL == nullptr) || (ustrFileURL->length == 0) || (pItem == nullptr))
         return osl_File_E_INVAL;
 
     osl_error = osl_getSystemPathFromFileURL_Ex(ustrFileURL, &ustrSystemPath);
@@ -375,7 +375,7 @@ oslFileError SAL_CALL osl_getDirectoryItem( rtl_uString* ustrFileURL, oslDirecto
 oslFileError SAL_CALL osl_acquireDirectoryItem( oslDirectoryItem Item )
 {
     DirectoryItem_Impl * pImpl = static_cast< DirectoryItem_Impl* >(Item);
-    if (nullptr == pImpl)
+    if (pImpl == nullptr)
         return osl_File_E_INVAL;
 
     pImpl->acquire();
@@ -385,7 +385,7 @@ oslFileError SAL_CALL osl_acquireDirectoryItem( oslDirectoryItem Item )
 oslFileError SAL_CALL osl_releaseDirectoryItem( oslDirectoryItem Item )
 {
     DirectoryItem_Impl * pImpl = static_cast< DirectoryItem_Impl* >(Item);
-    if (nullptr == pImpl)
+    if (pImpl == nullptr)
         return osl_File_E_INVAL;
 
     pImpl->release();
diff --git a/sal/osl/unx/file_path_helper.cxx b/sal/osl/unx/file_path_helper.cxx
index df90ca952be2..08387de782ff 100644
--- a/sal/osl/unx/file_path_helper.cxx
+++ b/sal/osl/unx/file_path_helper.cxx
@@ -40,7 +40,7 @@ inline const rtl::OUString FPH_PARENT_DIR_ENTRY()
 void SAL_CALL osl_systemPathRemoveSeparator(rtl_uString* pustrPath)
 {
     OSL_PRECOND(nullptr != pustrPath, "osl_systemPathRemoveSeparator: Invalid parameter");
-    if (nullptr != pustrPath)
+    if (pustrPath != nullptr)
     {
         // maybe there are more than one separator at end
         // so we run in a loop
@@ -60,7 +60,7 @@ void SAL_CALL osl_systemPathRemoveSeparator(rtl_uString* pustrPath)
 void SAL_CALL osl_systemPathEnsureSeparator(rtl_uString** ppustrPath)
 {
     OSL_PRECOND((nullptr != ppustrPath) && (nullptr != *ppustrPath), "osl_systemPathEnsureSeparator: Invalid parameter");
-    if ((nullptr != ppustrPath) && (nullptr != *ppustrPath))
+    if ((ppustrPath != nullptr) && (*ppustrPath != nullptr))
     {
         rtl::OUString path(*ppustrPath);
         sal_Int32    lp = path.getLength();
@@ -81,7 +81,7 @@ void SAL_CALL osl_systemPathEnsureSeparator(rtl_uString** ppustrPath)
 bool SAL_CALL osl_systemPathIsRelativePath(const rtl_uString* pustrPath)
 {
     OSL_PRECOND(nullptr != pustrPath, "osl_systemPathIsRelativePath: Invalid parameter");
-    return ((nullptr == pustrPath) || (pustrPath->length == 0) || (pustrPath->buffer[0] != FPH_CHAR_PATH_SEPARATOR));
+    return ((pustrPath == nullptr) || (pustrPath->length == 0) || (pustrPath->buffer[0] != FPH_CHAR_PATH_SEPARATOR));
 }
 
 void SAL_CALL osl_systemPathMakeAbsolutePath(
@@ -127,7 +127,7 @@ bool SAL_CALL osl_systemPathIsHiddenFileOrDirectoryEntry(
     const rtl_uString* pustrPath)
 {
     OSL_PRECOND(nullptr != pustrPath, "osl_systemPathIsHiddenFileOrDirectoryEntry: Invalid parameter");
-    if ((nullptr == pustrPath) || (pustrPath->length == 0))
+    if ((pustrPath == nullptr) || (pustrPath->length == 0))
         return false;
 
     rtl::OUString fdp;
diff --git a/sal/osl/unx/file_stat.cxx b/sal/osl/unx/file_stat.cxx
index 87a56e570c43..ec1ebe45849a 100644
--- a/sal/osl/unx/file_stat.cxx
+++ b/sal/osl/unx/file_stat.cxx
@@ -185,7 +185,7 @@ namespace
     inline oslFileError setup_osl_getFileStatus(
         DirectoryItem_Impl * pImpl, oslFileStatus* pStat, rtl::OUString& file_path)
     {
-        if ((nullptr == pImpl) || (nullptr == pStat))
+        if ((pImpl == nullptr) || (pStat == nullptr))
             return osl_File_E_INVAL;
 
         file_path = rtl::OUString(pImpl->m_ustrFilePath);
diff --git a/sal/osl/unx/file_url.cxx b/sal/osl/unx/file_url.cxx
index 6e80f9778515..b47f94192833 100644
--- a/sal/osl/unx/file_url.cxx
+++ b/sal/osl/unx/file_url.cxx
@@ -289,7 +289,7 @@ oslFileError SAL_CALL osl_getFileURLFromSystemPath( rtl_uString *ustrSystemPath,
         sal_Int32 nDeleted = 0;
 
         /* if pTmp is not already allocated, copy ustrSystemPath for modification */
-        if( nullptr == pTmp )
+        if( pTmp == nullptr )
             rtl_uString_newFromString( &pTmp, ustrSystemPath );
 
         /* adapt index to pTmp */
@@ -308,7 +308,7 @@ oslFileError SAL_CALL osl_getFileURLFromSystemPath( rtl_uString *ustrSystemPath,
         pTmp->length -= nDeleted;
     }
 
-    if( nullptr == pTmp )
+    if( pTmp == nullptr )
         rtl_uString_assign( &pTmp, ustrSystemPath );
 
     /* file URLs must be URI encoded */
diff --git a/sal/osl/unx/nlsupport.cxx b/sal/osl/unx/nlsupport.cxx
index 48558b9489d3..5300752335af 100644
--- a/sal/osl/unx/nlsupport.cxx
+++ b/sal/osl/unx/nlsupport.cxx
@@ -571,7 +571,7 @@ rtl_TextEncoding osl_getTextEncodingFromLocale( rtl_Locale * pLocale )
     char *codeset      = nullptr;
 
     /* default to process locale if pLocale == NULL */
-    if( nullptr == pLocale )
+    if( pLocale == nullptr )
         osl_getProcessLocale( &pLocale );
 
     /* convert rtl_Locale to locale string */
diff --git a/sal/osl/unx/pipe.cxx b/sal/osl/unx/pipe.cxx
index 576b38448add..4cda5053cdcd 100644
--- a/sal/osl/unx/pipe.cxx
+++ b/sal/osl/unx/pipe.cxx
@@ -324,7 +324,7 @@ void SAL_CALL osl_acquirePipe( oslPipe pPipe )
 void SAL_CALL osl_releasePipe( oslPipe pPipe )
 {
 
-    if( nullptr == pPipe )
+    if( pPipe == nullptr )
         return;
 
     if( osl_atomic_decrement( &(pPipe->m_nRefCount) ) == 0 )
diff --git a/sal/osl/unx/process.cxx b/sal/osl/unx/process.cxx
index a9fb2986dc4f..405322955d3d 100644
--- a/sal/osl/unx/process.cxx
+++ b/sal/osl/unx/process.cxx
@@ -1130,7 +1130,7 @@ oslProcessError SAL_CALL osl_joinProcessWithTimeout(oslProcess Process, const Ti
     OSL_PRECOND(Process, "osl_joinProcess: Invalid parameter");
     OSL_ASSERT(ChildListMutex);
 
-    if (nullptr == Process || nullptr == ChildListMutex)
+    if (Process == nullptr || ChildListMutex == nullptr)
         return osl_Process_E_Unknown;
 
     osl_acquireMutex(ChildListMutex);
diff --git a/sal/osl/unx/socket.cxx b/sal/osl/unx/socket.cxx
index 15ce591bade9..6b24b0ab0143 100644
--- a/sal/osl/unx/socket.cxx
+++ b/sal/osl/unx/socket.cxx
@@ -1979,7 +1979,7 @@ static bool socket_poll (
     int           result;
 
     SAL_WARN_IF( !pSocket, "sal.osl", "undefined socket" );
-    if (nullptr == pSocket)
+    if (pSocket == nullptr)
       return false; /* EINVAL */
 
     pSocket->m_nLastError = 0;
diff --git a/sal/osl/unx/tempfile.cxx b/sal/osl/unx/tempfile.cxx
index fdf85e6014f9..4894fa43154a 100644
--- a/sal/osl/unx/tempfile.cxx
+++ b/sal/osl/unx/tempfile.cxx
@@ -150,7 +150,7 @@ static oslFileError osl_setup_base_directory_impl_(
 
     OSL_PRECOND(((nullptr != pHandle) || (nullptr != ppustrTempFileURL)), "Invalid parameter!");
 
-    if ((nullptr == pHandle) && (nullptr == ppustrTempFileURL))
+    if ((pHandle == nullptr) && (ppustrTempFileURL == nullptr))
     {
         osl_error = osl_File_E_INVAL;
     }
@@ -159,7 +159,7 @@ static oslFileError osl_setup_base_directory_impl_(
         osl_error = osl_setup_base_directory_impl_(
             pustrDirectoryURL, ppustr_base_dir);
 
-        *b_delete_on_close = (nullptr == ppustrTempFileURL);
+        *b_delete_on_close = (ppustrTempFileURL == nullptr);
     }
 
     return osl_error;
diff --git a/sal/qa/osl/process/osl_process.cxx b/sal/qa/osl/process/osl_process.cxx
index ff97d3a55357..fa1b1c4905de 100644
--- a/sal/qa/osl/process/osl_process.cxx
+++ b/sal/qa/osl/process/osl_process.cxx
@@ -152,7 +152,7 @@ namespace
 
     void read_parent_environment(string_container_t* env_container)
     {
-        for (int i = 0; nullptr != environ[i]; i++)
+        for (int i = 0; environ[i] != nullptr; i++)
             env_container->push_back(OString(environ[i]));
         tidy_container(*env_container);
     }
diff --git a/sal/qa/osl/process/osl_process_child.cxx b/sal/qa/osl/process/osl_process_child.cxx
index a1791c6f9b60..36729ee1b968 100644
--- a/sal/qa/osl/process/osl_process_child.cxx
+++ b/sal/qa/osl/process/osl_process_child.cxx
@@ -82,7 +82,7 @@ void w_to_a(LPCTSTR _strW, LPSTR strA, DWORD size)
     void dump_env(char* file_path)
     {
         std::ofstream file(file_path);
-        for (int i = 0; nullptr != environ[i]; ++i)
+        for (int i = 0; environ[i] != nullptr; ++i)
             file << environ[i] << '\0';
     }
 #endif


More information about the Libreoffice-commits mailing list