summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-04-27 15:28:41 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-04-27 15:31:00 +0200
commit3591554df303958e519d8758acd595975809c827 (patch)
tree07189361437b7aee68cb61c0ed18cb7289dd6400 /sal
parentbadc69d73ae2da5ddc68d93a3e327104253a0598 (diff)
More loplugin:simplifybool
Change-Id: I9414d9167213c0156fb97559a8af5e55a4e1c1de
Diffstat (limited to 'sal')
-rw-r--r--sal/osl/unx/profile.cxx14
-rw-r--r--sal/qa/rtl/alloc/rtl_alloc.cxx8
-rw-r--r--sal/qa/rtl/oustring/rtl_OUString2.cxx54
-rw-r--r--sal/qa/rtl/strings/test_ostring_stringliterals.cxx44
-rw-r--r--sal/qa/rtl/strings/test_oustring_stringliterals.cxx2
5 files changed, 61 insertions, 61 deletions
diff --git a/sal/osl/unx/profile.cxx b/sal/osl/unx/profile.cxx
index 4feb4ebfb8b0..00d0b44e8219 100644
--- a/sal/osl/unx/profile.cxx
+++ b/sal/osl/unx/profile.cxx
@@ -196,7 +196,7 @@ sal_Bool SAL_CALL osl_closeProfile(oslProfile Profile)
pthread_mutex_lock(&(pProfile->m_AccessLock));
- if ( pProfile->m_bIsValid == false )
+ if ( !pProfile->m_bIsValid )
{
SAL_WARN("sal.osl", "!pProfile->m_bIsValid");
pthread_mutex_unlock(&(pProfile->m_AccessLock));
@@ -293,7 +293,7 @@ sal_Bool SAL_CALL osl_flushProfile(oslProfile Profile)
pthread_mutex_lock(&(pProfile->m_AccessLock));
- if ( pProfile->m_bIsValid == false )
+ if ( !pProfile->m_bIsValid )
{
SAL_WARN_IF(!pProfile->m_bIsValid, "sal.osl", "!pProfile->m_bIsValid");
pthread_mutex_unlock(&(pProfile->m_AccessLock));
@@ -370,7 +370,7 @@ sal_Bool SAL_CALL osl_readProfileString(oslProfile Profile,
pthread_mutex_lock(&(pTmpProfile->m_AccessLock));
- if ( pTmpProfile->m_bIsValid == false )
+ if ( !pTmpProfile->m_bIsValid )
{
pthread_mutex_unlock(&(pTmpProfile->m_AccessLock));
@@ -504,7 +504,7 @@ sal_Bool SAL_CALL osl_writeProfileString(oslProfile Profile,
pthread_mutex_lock(&(pTmpProfile->m_AccessLock));
- if ( pTmpProfile->m_bIsValid == false )
+ if ( !pTmpProfile->m_bIsValid )
{
SAL_WARN_IF(!pTmpProfile->m_bIsValid, "sal.osl", "!pTmpProfile->m_bIsValid");
pthread_mutex_unlock(&(pTmpProfile->m_AccessLock));
@@ -657,7 +657,7 @@ sal_Bool SAL_CALL osl_removeProfileEntry(oslProfile Profile,
pthread_mutex_lock(&(pTmpProfile->m_AccessLock));
- if ( pTmpProfile->m_bIsValid == false )
+ if ( !pTmpProfile->m_bIsValid )
{
SAL_WARN_IF(!pTmpProfile->m_bIsValid, "sal.osl", "!pTmpProfile->m_bIsValid");
pthread_mutex_unlock(&(pTmpProfile->m_AccessLock));
@@ -727,7 +727,7 @@ sal_uInt32 SAL_CALL osl_getProfileSectionEntries(oslProfile Profile,
pthread_mutex_lock(&(pTmpProfile->m_AccessLock));
- if ( pTmpProfile->m_bIsValid == false )
+ if ( !pTmpProfile->m_bIsValid )
{
SAL_WARN_IF(!pTmpProfile->m_bIsValid, "sal.osl", "!pTmpProfile->m_bIsValid");
@@ -810,7 +810,7 @@ sal_uInt32 SAL_CALL osl_getProfileSections(oslProfile Profile,
pthread_mutex_lock(&(pTmpProfile->m_AccessLock));
- if ( pTmpProfile->m_bIsValid == false )
+ if ( !pTmpProfile->m_bIsValid )
{
SAL_WARN_IF(!pTmpProfile->m_bIsValid, "sal.osl", "!pTmpProfile->m_bIsValid");
pthread_mutex_unlock(&(pTmpProfile->m_AccessLock));
diff --git a/sal/qa/rtl/alloc/rtl_alloc.cxx b/sal/qa/rtl/alloc/rtl_alloc.cxx
index 4aee1ca22978..9a5c488ae6ba 100644
--- a/sal/qa/rtl/alloc/rtl_alloc.cxx
+++ b/sal/qa/rtl/alloc/rtl_alloc.cxx
@@ -73,7 +73,7 @@ public:
{
CPPUNIT_ASSERT_MESSAGE( "Can get zero memory.", m_pMemory != NULL);
memset(m_pMemory, 1, m_nSizeOfMemory);
- CPPUNIT_ASSERT_MESSAGE( "memory contains wrong value.", checkMemory(m_pMemory, m_nSizeOfMemory, 1) == true);
+ CPPUNIT_ASSERT_MESSAGE( "memory contains wrong value.", checkMemory(m_pMemory, m_nSizeOfMemory, 1));
}
void rtl_reallocateMemory_001()
@@ -83,7 +83,7 @@ public:
CPPUNIT_ASSERT_MESSAGE( "Can reallocate memory.", m_pMemory != NULL);
memset(m_pMemory, 2, nSize);
- CPPUNIT_ASSERT_MESSAGE( "memory contains wrong value.", checkMemory(m_pMemory, nSize, 2) == true);
+ CPPUNIT_ASSERT_MESSAGE( "memory contains wrong value.", checkMemory(m_pMemory, nSize, 2));
}
CPPUNIT_TEST_SUITE(Memory);
@@ -123,10 +123,10 @@ public:
void rtl_allocateZeroMemory_001()
{
CPPUNIT_ASSERT_MESSAGE( "Can get zero memory.", m_pZeroMemory != NULL);
- CPPUNIT_ASSERT_MESSAGE( "memory contains wrong value.", checkMemory(m_pZeroMemory, m_nSizeOfZeroMemory, 0) == true);
+ CPPUNIT_ASSERT_MESSAGE( "memory contains wrong value.", checkMemory(m_pZeroMemory, m_nSizeOfZeroMemory, 0));
memset(m_pZeroMemory, 3, m_nSizeOfZeroMemory);
- CPPUNIT_ASSERT_MESSAGE( "memory contains wrong value.", checkMemory(m_pZeroMemory, m_nSizeOfZeroMemory, 3) == true);
+ CPPUNIT_ASSERT_MESSAGE( "memory contains wrong value.", checkMemory(m_pZeroMemory, m_nSizeOfZeroMemory, 3));
}
CPPUNIT_TEST_SUITE(TestZeroMemory);
diff --git a/sal/qa/rtl/oustring/rtl_OUString2.cxx b/sal/qa/rtl/oustring/rtl_OUString2.cxx
index 95940f7ea3ea..eff33e9bc3ec 100644
--- a/sal/qa/rtl/oustring/rtl_OUString2.cxx
+++ b/sal/qa/rtl/oustring/rtl_OUString2.cxx
@@ -62,7 +62,7 @@ class number : public CppUnit::TestFixture
double nValueATOF = doubleToFloat(atof( sValue.getStr() ));
bool bEqualResult = is_float_equal(_nValue, nValueATOF);
- CPPUNIT_ASSERT_MESSAGE("Values are not equal.", bEqualResult == true);
+ CPPUNIT_ASSERT_MESSAGE("Values are not equal.", bEqualResult);
}
void number_float_test(float _nValue)
@@ -133,7 +133,7 @@ private:
double nValueATOF = atof( sValue.getStr() );
bool bEqualResult = is_double_equal(_nValue, nValueATOF);
- CPPUNIT_ASSERT_MESSAGE("Values are not equal.", bEqualResult == true);
+ CPPUNIT_ASSERT_MESSAGE("Values are not equal.", bEqualResult);
}
void number_double_test(double _nValue)
@@ -256,7 +256,7 @@ public:
//printf("result data is %e\n", nValueToDouble);
bool bEqualResult = is_double_equal(nValueToDouble, nValueATOF);
- CPPUNIT_ASSERT_MESSAGE("Values are not equal.", bEqualResult == true);
+ CPPUNIT_ASSERT_MESSAGE("Values are not equal.", bEqualResult);
}
void toDouble_test(rtl::OString const& _sValue)
@@ -273,22 +273,22 @@ public:
void toDouble_selftest()
{
printf("Start selftest:\n");
- CPPUNIT_ASSERT (is_double_equal(1.0, 1.01) == false);
- CPPUNIT_ASSERT (is_double_equal(1.0, 1.001) == false);
- CPPUNIT_ASSERT (is_double_equal(1.0, 1.0001) == false);
- CPPUNIT_ASSERT (is_double_equal(1.0, 1.00001) == false);
- CPPUNIT_ASSERT (is_double_equal(1.0, 1.000001) == false);
- CPPUNIT_ASSERT (is_double_equal(1.0, 1.0000001) == false);
- CPPUNIT_ASSERT (is_double_equal(1.0, 1.00000001) == false);
- CPPUNIT_ASSERT (is_double_equal(1.0, 1.000000001) == false);
- CPPUNIT_ASSERT (is_double_equal(1.0, 1.0000000001) == false);
- CPPUNIT_ASSERT (is_double_equal(1.0, 1.00000000001) == false);
- CPPUNIT_ASSERT (is_double_equal(1.0, 1.000000000001) == false);
- CPPUNIT_ASSERT (is_double_equal(1.0, 1.0000000000001) == false);
+ CPPUNIT_ASSERT (!is_double_equal(1.0, 1.01));
+ CPPUNIT_ASSERT (!is_double_equal(1.0, 1.001));
+ CPPUNIT_ASSERT (!is_double_equal(1.0, 1.0001));
+ CPPUNIT_ASSERT (!is_double_equal(1.0, 1.00001));
+ CPPUNIT_ASSERT (!is_double_equal(1.0, 1.000001));
+ CPPUNIT_ASSERT (!is_double_equal(1.0, 1.0000001));
+ CPPUNIT_ASSERT (!is_double_equal(1.0, 1.00000001));
+ CPPUNIT_ASSERT (!is_double_equal(1.0, 1.000000001));
+ CPPUNIT_ASSERT (!is_double_equal(1.0, 1.0000000001));
+ CPPUNIT_ASSERT (!is_double_equal(1.0, 1.00000000001));
+ CPPUNIT_ASSERT (!is_double_equal(1.0, 1.000000000001));
+ CPPUNIT_ASSERT (!is_double_equal(1.0, 1.0000000000001));
// we check til 15 values after comma
- CPPUNIT_ASSERT (is_double_equal(1.0, 1.00000000000001) == true);
- CPPUNIT_ASSERT (is_double_equal(1.0, 1.000000000000001) == true);
- CPPUNIT_ASSERT (is_double_equal(1.0, 1.0000000000000001) == true);
+ CPPUNIT_ASSERT (is_double_equal(1.0, 1.00000000000001));
+ CPPUNIT_ASSERT (is_double_equal(1.0, 1.000000000000001));
+ CPPUNIT_ASSERT (is_double_equal(1.0, 1.0000000000000001));
printf("Selftest done.\n");
}
@@ -391,7 +391,7 @@ public:
//printf("the result str is %.10f\n", nValueToFloat);
bool bEqualResult = is_float_equal(nValueToFloat, nValueATOF);
- CPPUNIT_ASSERT_MESSAGE("Values are not equal.", bEqualResult == true);
+ CPPUNIT_ASSERT_MESSAGE("Values are not equal.", bEqualResult);
}
void toFloat_test(rtl::OString const& _sValue)
@@ -408,14 +408,14 @@ public:
void toFloat_selftest()
{
printf("Start selftest:\n");
- CPPUNIT_ASSERT (is_float_equal(1.0f, 1.01f) == false);
- CPPUNIT_ASSERT (is_float_equal(1.0f, 1.001f) == false);
- CPPUNIT_ASSERT (is_float_equal(1.0f, 1.0001f) == false);
- CPPUNIT_ASSERT (is_float_equal(1.0f, 1.00001f) == false);
- CPPUNIT_ASSERT (is_float_equal(1.0f, 1.000002f) == false);
- CPPUNIT_ASSERT (is_float_equal(1.0f, 1.0000001f) == true);
- CPPUNIT_ASSERT (is_float_equal(1.0f, 1.00000001f) == true);
- CPPUNIT_ASSERT (is_float_equal(1.0f, 1.000000001f) == true);
+ CPPUNIT_ASSERT (!is_float_equal(1.0f, 1.01f));
+ CPPUNIT_ASSERT (!is_float_equal(1.0f, 1.001f));
+ CPPUNIT_ASSERT (!is_float_equal(1.0f, 1.0001f));
+ CPPUNIT_ASSERT (!is_float_equal(1.0f, 1.00001f));
+ CPPUNIT_ASSERT (!is_float_equal(1.0f, 1.000002f));
+ CPPUNIT_ASSERT (is_float_equal(1.0f, 1.0000001f));
+ CPPUNIT_ASSERT (is_float_equal(1.0f, 1.00000001f));
+ CPPUNIT_ASSERT (is_float_equal(1.0f, 1.000000001f));
printf("Selftest done.\n");
}
diff --git a/sal/qa/rtl/strings/test_ostring_stringliterals.cxx b/sal/qa/rtl/strings/test_ostring_stringliterals.cxx
index 7e24e490dce1..af547ed8e9eb 100644
--- a/sal/qa/rtl/strings/test_ostring_stringliterals.cxx
+++ b/sal/qa/rtl/strings/test_ostring_stringliterals.cxx
@@ -126,53 +126,53 @@ void test::ostring::StringLiterals::checkUsage()
rtl_string_unittest_non_const_literal_function = false; // and check for non-const variants
rtl_string_unittest_const_literal_function = false;
CPPUNIT_ASSERT_EQUAL( foo, rtl::OString() = "foo" );
- CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == true );
+ CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function );
rtl_string_unittest_const_literal_function = false;
CPPUNIT_ASSERT( FoO.equalsIgnoreAsciiCase( "fOo" ));
- CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == true );
+ CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function );
rtl_string_unittest_const_literal_function = false;
CPPUNIT_ASSERT( foobarfoo.match( "bar", 3 ));
- CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == true );
+ CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function );
rtl_string_unittest_const_literal_function = false;
CPPUNIT_ASSERT( foobar.match( "foo" ));
- CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == true );
+ CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function );
rtl_string_unittest_const_literal_function = false;
CPPUNIT_ASSERT( FooBaRfoo.matchIgnoreAsciiCase( "bAr", 3 ));
- CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == true );
+ CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function );
rtl_string_unittest_const_literal_function = false;
CPPUNIT_ASSERT( FooBaR.matchIgnoreAsciiCase( "fOo" ));
- CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == true );
+ CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function );
rtl_string_unittest_const_literal_function = false;
CPPUNIT_ASSERT( foobar.startsWith( "foo" ));
- CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == true );
+ CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function );
rtl_string_unittest_const_literal_function = false;
CPPUNIT_ASSERT( foobar.endsWith( "bar" ));
- CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == true );
+ CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function );
// rtl_string_unittest_const_literal_function = false;
// CPPUNIT_ASSERT( FooBaR.endsWithIgnoreAsciiCase( "bar" ));
// CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == true );
rtl_string_unittest_const_literal_function = false;
CPPUNIT_ASSERT( foo == "foo" );
- CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == true );
+ CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function );
rtl_string_unittest_const_literal_function = false;
CPPUNIT_ASSERT( "foo" == foo );
- CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == true );
+ CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function );
rtl_string_unittest_const_literal_function = false;
CPPUNIT_ASSERT( foo != "bar" );
- CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == true );
+ CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function );
rtl_string_unittest_const_literal_function = false;
CPPUNIT_ASSERT( "foo" != bar );
- CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == true );
+ CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function );
rtl_string_unittest_const_literal_function = false;
CPPUNIT_ASSERT( foobarfoo.indexOf( "foo", 1 ) == 6 );
- CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == true );
+ CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function );
// rtl_string_unittest_const_literal_function = false;
// CPPUNIT_ASSERT( foobarfoo.lastIndexOf( "foo" ) == 6 );
// CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == true );
// if this is not true, some of the calls above converted to OString
- CPPUNIT_ASSERT( rtl_string_unittest_const_literal == false );
+ CPPUNIT_ASSERT( !rtl_string_unittest_const_literal );
// if this is not true, some of the calls above used non-const variants
- CPPUNIT_ASSERT( rtl_string_unittest_non_const_literal_function == false );
+ CPPUNIT_ASSERT( !rtl_string_unittest_non_const_literal_function );
}
void test::ostring::StringLiterals::checkNonConstUsage()
@@ -223,8 +223,8 @@ void test::ostring::StringLiterals::checkNonConstUsage()
// CPPUNIT_ASSERT( foobarfoo.lastIndexOf( (const char*)foo_c ) == 6 );
// CPPUNIT_ASSERT( foobarfoo.lastIndexOf( foo_c ) == 6 );
// if this is not true, some of the calls above used const variants
- CPPUNIT_ASSERT( rtl_string_unittest_const_literal == false );
- CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == false );
+ CPPUNIT_ASSERT( !rtl_string_unittest_const_literal );
+ CPPUNIT_ASSERT( !rtl_string_unittest_const_literal_function );
}
void test::ostring::StringLiterals::checkBuffer()
@@ -232,15 +232,15 @@ void test::ostring::StringLiterals::checkBuffer()
rtl::OStringBuffer buf;
rtl_string_unittest_const_literal_function = false;
buf.append( "foo" );
- CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == true );
+ CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function );
CPPUNIT_ASSERT_EQUAL( rtl::OString( "foo" ), buf.toString());
rtl_string_unittest_const_literal_function = false;
buf.append( "bar" );
- CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == true );
+ CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function );
CPPUNIT_ASSERT_EQUAL( rtl::OString( "foobar" ), buf.toString());
rtl_string_unittest_const_literal_function = false;
buf.insert( 3, "baz" );
- CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == true );
+ CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function );
CPPUNIT_ASSERT_EQUAL( rtl::OString( "foobazbar" ), buf.toString());
rtl::OString foobazbard( "foobazbard" );
@@ -250,8 +250,8 @@ void test::ostring::StringLiterals::checkBuffer()
char d[] = "d";
CPPUNIT_ASSERT_EQUAL( foobazbard, buf.append( d ).toString());
CPPUNIT_ASSERT_EQUAL( foodbazbard, buf.insert( 3, d ).toString() );
- CPPUNIT_ASSERT( rtl_string_unittest_const_literal == false );
- CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == false );
+ CPPUNIT_ASSERT( !rtl_string_unittest_const_literal );
+ CPPUNIT_ASSERT( !rtl_string_unittest_const_literal_function );
}
#undef CONST_CTOR_USED
diff --git a/sal/qa/rtl/strings/test_oustring_stringliterals.cxx b/sal/qa/rtl/strings/test_oustring_stringliterals.cxx
index c237b1732012..a1261043ba10 100644
--- a/sal/qa/rtl/strings/test_oustring_stringliterals.cxx
+++ b/sal/qa/rtl/strings/test_oustring_stringliterals.cxx
@@ -132,7 +132,7 @@ void test::oustring::StringLiterals::checkUsage()
CPPUNIT_ASSERT( foobarfoo.replaceAll( "foo", "test" ) == "testbartest" );
CPPUNIT_ASSERT( foo.reverseCompareTo( "foo" ) == 0 );
// if this is not true, some of the calls above converted to OUString
- CPPUNIT_ASSERT( rtl_string_unittest_const_literal == false );
+ CPPUNIT_ASSERT( !rtl_string_unittest_const_literal );
}
void test::oustring::StringLiterals::checkExtraIntArgument()