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

Chris Sherlock chris.sherlock79 at gmail.com
Sat May 27 06:49:04 UTC 2017


 sal/osl/w32/tempfile.cxx |   18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

New commits:
commit dbb2fff9f3f918966ddc5f55b32e247dc2bb2874
Author: Chris Sherlock <chris.sherlock79 at gmail.com>
Date:   Sun May 21 08:53:41 2017 +1000

    osl: convert to variable == value, not value == variable
    
    Change-Id: I20e68c135f43d03cf6035eda488c85a2067910e0
    Reviewed-on: https://gerrit.libreoffice.org/37864
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sal/osl/w32/tempfile.cxx b/sal/osl/w32/tempfile.cxx
index 3c2f10cdc0e6..ec50b7ec115d 100644
--- a/sal/osl/w32/tempfile.cxx
+++ b/sal/osl/w32/tempfile.cxx
@@ -52,13 +52,13 @@ static oslFileError osl_setup_base_directory_impl_(
     else
         error = osl_getTempDirURL(&dir_url);
 
-    if (osl_File_E_None == error)
+    if (error == osl_File_E_None)
     {
         error = osl_getSystemPathFromFileURL_(dir_url, &dir, false);
         rtl_uString_release(dir_url);
     }
 
-    if (osl_File_E_None == error )
+    if (error == osl_File_E_None)
     {
         rtl_uString_assign(ppustr_base_dir, dir);
         rtl_uString_release(dir);
@@ -76,9 +76,9 @@ static oslFileError osl_setup_createTempFile_impl_(
 {
     oslFileError osl_error;
 
-    OSL_PRECOND(((nullptr != pHandle) || (nullptr != ppustrTempFileURL)), "Invalid parameter!");
+    OSL_PRECOND(((pHandle != nullptr) || (ppustrTempFileURL != nullptr)), "Invalid parameter!");
 
-    if ((nullptr == pHandle) && (nullptr == ppustrTempFileURL))
+    if ((pHandle == nullptr) && (ppustrTempFileURL == nullptr))
     {
         osl_error = osl_File_E_INVAL;
     }
@@ -87,7 +87,7 @@ static oslFileError osl_setup_createTempFile_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;
@@ -98,11 +98,11 @@ static oslFileError osl_win32_GetTempFileName_impl_(
 {
     oslFileError osl_error = osl_File_E_None;
 
-    if (0 == GetTempFileNameW(
+    if (GetTempFileNameW(
             reinterpret_cast<LPCWSTR>(rtl_uString_getStr(base_directory)),
             L"",
             0,
-            temp_file_name))
+            temp_file_name) == 0)
     {
         osl_error = oslTranslateFileError(GetLastError());
     }
@@ -158,7 +158,7 @@ static oslFileError osl_createTempFile_impl_(
 
     } while(true); // try until success
 
-    if ((osl_File_E_None == osl_error) && !b_delete_on_close)
+    if ((osl_error == osl_File_E_None) && !b_delete_on_close)
     {
         rtl_uString* pustr = nullptr;
         rtl_uString_newFromStr(&pustr, reinterpret_cast<const sal_Unicode*>(tmp_name));
@@ -186,7 +186,7 @@ oslFileError SAL_CALL osl_createTempFile(
         &base_directory,
         &b_delete_on_close);
 
-    if (osl_File_E_None != osl_error)
+    if (osl_error != osl_File_E_None)
         return osl_error;
 
     /* allocate enough space on the stack, the file name can not be longer than MAX_PATH */


More information about the Libreoffice-commits mailing list