kbrown / rpms / libreoffice

Forked from rpms/libreoffice 2 years ago
Clone

Blame SOURCES/0038-bool-improvements.patch

f085be
From eb758877fb799111673b909e73065cb6d966881a Mon Sep 17 00:00:00 2001
f085be
From: Stephan Bergmann <sbergman@redhat.com>
f085be
Date: Tue, 28 Jan 2014 20:00:40 +0100
f085be
Subject: [PATCH 038/137] bool improvements
f085be
f085be
Change-Id: I7ae2b02e435d21390843c6c56877a8ce3a73f9f2
f085be
(cherry picked from commit bd4053f895167978978023309925c85c3826b31a)
f085be
Signed-off-by: Michael Stahl <mstahl@redhat.com>
f085be
---
f085be
 sal/osl/all/debugbase.cxx            | 2 +-
f085be
 sal/qa/osl/file/osl_File.cxx         | 4 ++--
f085be
 sal/qa/osl/module/osl_Module.cxx     | 8 ++++----
f085be
 sal/qa/osl/mutex/osl_Mutex.cxx       | 2 +-
f085be
 sal/qa/osl/process/osl_Thread.cxx    | 2 +-
f085be
 sal/qa/osl/security/osl_Security.cxx | 2 +-
f085be
 sal/rtl/alloc_global.cxx             | 6 +++---
f085be
 sal/rtl/hash.cxx                     | 4 ++--
f085be
 sal/rtl/uri.cxx                      | 2 +-
f085be
 9 files changed, 16 insertions(+), 16 deletions(-)
f085be
f085be
diff --git a/sal/osl/all/debugbase.cxx b/sal/osl/all/debugbase.cxx
f085be
index 8bc0c46..57238ce 100644
f085be
--- a/sal/osl/all/debugbase.cxx
f085be
+++ b/sal/osl/all/debugbase.cxx
f085be
@@ -32,7 +32,7 @@
f085be
     {  \
f085be
         if (!(c) && _OSL_GLOBAL osl_assertFailedLine(f, l, m)) \
f085be
             _OSL_GLOBAL osl_breakDebug(); \
f085be
-    } while (0)
f085be
+    } while (false)
f085be
 #define DEBUGBASE_ENSURE(c, m) DEBUGBASE_ENSURE_(c, OSL_THIS_FILE, __LINE__, m)
f085be
 
f085be
 namespace {
f085be
diff --git a/sal/qa/osl/file/osl_File.cxx b/sal/qa/osl/file/osl_File.cxx
f085be
index 43f255c..54055fe 100644
f085be
--- a/sal/qa/osl/file/osl_File.cxx
f085be
+++ b/sal/qa/osl/file/osl_File.cxx
f085be
@@ -2587,7 +2587,7 @@ namespace osl_FileStatus
f085be
                 ::osl::FileBase::RC nError1 = testDirectory.open();
f085be
             ::rtl::OUString aFileName ("link.file");
f085be
             sal_Bool bOk = sal_False;
f085be
-            while (1) {
f085be
+            while (true) {
f085be
                 nError1 = testDirectory.getNextItem( rItem_link, 4 );
f085be
                 if (::osl::FileBase::E_None == nError1) {
f085be
                     sal_uInt32 mask_link = osl_FileStatus_Mask_FileName | osl_FileStatus_Mask_LinkTargetURL;
f085be
@@ -5639,7 +5639,7 @@ namespace osl_Directory
f085be
             CPPUNIT_ASSERT( ::osl::FileBase::E_None == nError1 );
f085be
             ::rtl::OUString aFileName ("link.file");
f085be
 
f085be
-            while (1) {
f085be
+            while (true) {
f085be
                 nError1 = testDirectory.getNextItem( rItem, 4 );
f085be
                 if (::osl::FileBase::E_None == nError1) {
f085be
                     ::osl::FileStatus   rFileStatus( osl_FileStatus_Mask_FileName | osl_FileStatus_Mask_Type );
f085be
diff --git a/sal/qa/osl/module/osl_Module.cxx b/sal/qa/osl/module/osl_Module.cxx
f085be
index d6358d4..ee547fb 100644
f085be
--- a/sal/qa/osl/module/osl_Module.cxx
f085be
+++ b/sal/qa/osl/module/osl_Module.cxx
f085be
@@ -189,7 +189,7 @@ namespace osl_Module
f085be
 
f085be
             if ( !( bRes ) )
f085be
             {
f085be
-                CPPUNIT_ASSERT_MESSAGE("Cannot locate current module.",  sal_False  );
f085be
+                CPPUNIT_ASSERT_MESSAGE("Cannot locate current module.", false );
f085be
             }
f085be
 
f085be
             ::osl::Module aMod( aFileURL );
f085be
@@ -221,7 +221,7 @@ namespace osl_Module
f085be
             bRes = osl::Module::getUrlFromAddress( ( void* ) &::osl_Module::testClass::myFunc, aFileURL ) ;
f085be
             if ( !( bRes ) )
f085be
             {
f085be
-                CPPUNIT_ASSERT_MESSAGE("Cannot locate current module.",  sal_False  );
f085be
+                CPPUNIT_ASSERT_MESSAGE("Cannot locate current module.", false );
f085be
             }
f085be
 
f085be
             CPPUNIT_ASSERT_MESSAGE( "#test comment#: test get Module URL from address.",
f085be
@@ -239,7 +239,7 @@ namespace osl_Module
f085be
             bRes = osl::Module::getUrlFromAddress( ( void* )pFunc, aFileURL );
f085be
             if ( !( bRes  ) )
f085be
             {
f085be
-                CPPUNIT_ASSERT_MESSAGE("Cannot locate current module.",  sal_False  );
f085be
+                CPPUNIT_ASSERT_MESSAGE("Cannot locate current module.", false );
f085be
             }
f085be
             aMod.unload( );
f085be
 
f085be
@@ -325,7 +325,7 @@ namespace osl_Module
f085be
             bRes = osl::Module::getUrlFromAddress( ( void* ) &::osl_Module::testClass::myFunc, aFileURL );
f085be
             if ( !( bRes  ) )
f085be
             {
f085be
-                CPPUNIT_ASSERT_MESSAGE("Cannot locate current module - using executable instead",  sal_False  );
f085be
+                CPPUNIT_ASSERT_MESSAGE("Cannot locate current module - using executable instead", false );
f085be
             }
f085be
 
f085be
             ::osl::Module aMod;
f085be
diff --git a/sal/qa/osl/mutex/osl_Mutex.cxx b/sal/qa/osl/mutex/osl_Mutex.cxx
f085be
index 0e9ce85..3f86f9c 100644
f085be
--- a/sal/qa/osl/mutex/osl_Mutex.cxx
f085be
+++ b/sal/qa/osl/mutex/osl_Mutex.cxx
f085be
@@ -732,7 +732,7 @@ namespace osl_ClearableGuard
f085be
             // wait 1 second to assure the child thread has begun
f085be
             ThreadHelper::thread_sleep(1);
f085be
 
f085be
-            while (1)
f085be
+            while (true)
f085be
             {
f085be
                 if (aMutex.tryToAcquire() == sal_True)
f085be
                 {
f085be
diff --git a/sal/qa/osl/process/osl_Thread.cxx b/sal/qa/osl/process/osl_Thread.cxx
f085be
index 3e394aa..aeab4e9 100644
f085be
--- a/sal/qa/osl/process/osl_Thread.cxx
f085be
+++ b/sal/qa/osl/process/osl_Thread.cxx
f085be
@@ -626,7 +626,7 @@ namespace osl_Thread
f085be
     void suspendCountThread(OCountThread* _pCountThread)
f085be
     {
f085be
         sal_Int32 nValue = 0;
f085be
-        while (1)
f085be
+        while (true)
f085be
         {
f085be
             nValue = _pCountThread->getValue();
f085be
             if (nValue >= 3)
f085be
diff --git a/sal/qa/osl/security/osl_Security.cxx b/sal/qa/osl/security/osl_Security.cxx
f085be
index e9ad1a7..3ad78b0 100644
f085be
--- a/sal/qa/osl/security/osl_Security.cxx
f085be
+++ b/sal/qa/osl/security/osl_Security.cxx
f085be
@@ -280,7 +280,7 @@ namespace osl_Security
f085be
             {
f085be
                 ::osl::Security aSec;
f085be
                 osl_unloadUserProfile(aSec.getHandle());
f085be
-                CPPUNIT_ASSERT_MESSAGE( "empty function.", sal_True );
f085be
+                CPPUNIT_ASSERT_MESSAGE( "empty function.", true );
f085be
             }
f085be
 
f085be
         CPPUNIT_TEST_SUITE( UserProfile );
f085be
diff --git a/sal/rtl/alloc_global.cxx b/sal/rtl/alloc_global.cxx
f085be
index 8194b13..07cded3 100644
f085be
--- a/sal/rtl/alloc_global.cxx
f085be
+++ b/sal/rtl/alloc_global.cxx
f085be
@@ -291,7 +291,7 @@ void* SAL_CALL rtl_allocateMemory (sal_Size n) SAL_THROW_EXTERN_C()
f085be
         n >= SAL_MAX_INT32, "sal.rtl",
f085be
         "suspicious massive alloc " << n);
f085be
 #if !defined(FORCE_SYSALLOC)
f085be
-    while (1)
f085be
+    while (true)
f085be
     {
f085be
         if (alloc_mode == AMode_CUSTOM)
f085be
         {
f085be
@@ -314,7 +314,7 @@ void* SAL_CALL rtl_reallocateMemory (void * p, sal_Size n) SAL_THROW_EXTERN_C()
f085be
         n >= SAL_MAX_INT32, "sal.rtl",
f085be
         "suspicious massive alloc " << n);
f085be
 #if !defined(FORCE_SYSALLOC)
f085be
-    while (1)
f085be
+    while (true)
f085be
     {
f085be
         if (alloc_mode == AMode_CUSTOM)
f085be
         {
f085be
@@ -334,7 +334,7 @@ void* SAL_CALL rtl_reallocateMemory (void * p, sal_Size n) SAL_THROW_EXTERN_C()
f085be
 void SAL_CALL rtl_freeMemory (void * p) SAL_THROW_EXTERN_C()
f085be
 {
f085be
 #if !defined(FORCE_SYSALLOC)
f085be
-    while (1)
f085be
+    while (true)
f085be
     {
f085be
         if (alloc_mode == AMode_CUSTOM)
f085be
         {
f085be
diff --git a/sal/rtl/hash.cxx b/sal/rtl/hash.cxx
f085be
index 823e56a..47e8681 100644
f085be
--- a/sal/rtl/hash.cxx
f085be
+++ b/sal/rtl/hash.cxx
f085be
@@ -139,9 +139,9 @@ static int
f085be
 compareEqual (rtl_uString *pStringA, rtl_uString *pStringB)
f085be
 {
f085be
     if (pStringA == pStringB)
f085be
-        return 1;
f085be
+        return true;
f085be
     if (pStringA->length != pStringB->length)
f085be
-        return 0;
f085be
+        return false;
f085be
     return !rtl_ustr_compare_WithLength( pStringA->buffer, pStringA->length,
f085be
                                          pStringB->buffer, pStringB->length);
f085be
 }
f085be
diff --git a/sal/rtl/uri.cxx b/sal/rtl/uri.cxx
f085be
index 7e4402f..513fb51 100644
f085be
--- a/sal/rtl/uri.cxx
f085be
+++ b/sal/rtl/uri.cxx
f085be
@@ -142,7 +142,7 @@ sal_uInt32 readUcs4(sal_Unicode const ** pBegin, sal_Unicode const * pEnd,
f085be
                         || nWeight1 > 11
f085be
                         || (nWeight2 = getHexWeight(p[2])) < 0)
f085be
                     {
f085be
-                        bUTF8 = sal_False;
f085be
+                        bUTF8 = false;
f085be
                         break;
f085be
                     }
f085be
                     p += 3;
f085be
-- 
f085be
1.9.3
f085be