summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-01-23 18:43:53 +0100
committerStephan Bergmann <sbergman@redhat.com>2014-01-23 18:43:53 +0100
commite3133ae2371b6e2d4b47daa6a3487ea4f2753315 (patch)
treef9a000ee6542fb470733bfed28199092a36c26c5 /sal
parent14f4e2fa22a0a2576808bab08edaf2e12f761cd8 (diff)
Let C++ inline functions return bool instead of sal_Bool
...to improve diagnosing misuses of boolean expressions in client code (cf. compilerplugins/clang/implicitboolconversion.cxx). This change should be transparent to client code. Missing overloads of insert() for bool have been added to OStringBuffer and OUStringBuffer (which required dropping one !VALID_CONVERSION check that would now pick that overload, but would be flagged by compilerplugins/clang/pointertobool.cxx). Change-Id: I2d64cd923b8f47bfaa31e753def6515c29a3f8c9
Diffstat (limited to 'sal')
-rw-r--r--sal/qa/rtl/process/rtl_Process.cxx2
-rw-r--r--sal/qa/rtl/strings/test_oustring_stringliterals.cxx1
-rw-r--r--sal/qa/rtl/uri/rtl_Uri.cxx4
3 files changed, 3 insertions, 4 deletions
diff --git a/sal/qa/rtl/process/rtl_Process.cxx b/sal/qa/rtl/process/rtl_Process.cxx
index 4a093bd441b2..d93075aa6969 100644
--- a/sal/qa/rtl/process/rtl_Process.cxx
+++ b/sal/qa/rtl/process/rtl_Process.cxx
@@ -266,7 +266,7 @@ public:
osl_readFile( *pChildOutputRead, pUUID2, 32, &nRead );
printf("read buffer is %s, nRead is %" SAL_PRIdINT64 "\n", pUUID2, nRead );
OUString suUUID2 = OUString::createFromAscii( pUUID2 );
- CPPUNIT_ASSERT_MESSAGE("getGlobalProcessId: got two same ProcessIds.", suUUID2.equalsAsciiL( pUUID1, 32) == sal_False );
+ CPPUNIT_ASSERT_MESSAGE("getGlobalProcessId: got two same ProcessIds.", !suUUID2.equalsAsciiL( pUUID1, 32) );
}
CPPUNIT_TEST_SUITE(getGlobalProcessId);
diff --git a/sal/qa/rtl/strings/test_oustring_stringliterals.cxx b/sal/qa/rtl/strings/test_oustring_stringliterals.cxx
index 902cc2a0bc0b..192eeb5ae63b 100644
--- a/sal/qa/rtl/strings/test_oustring_stringliterals.cxx
+++ b/sal/qa/rtl/strings/test_oustring_stringliterals.cxx
@@ -168,7 +168,6 @@ void test::oustring::StringLiterals::checkBuffer()
char d[] = "d";
CPPUNIT_ASSERT( !VALID_CONVERSION( buf.append( rtl::OUString( d ))));
CPPUNIT_ASSERT( !VALID_CONVERSION( buf.append( rtl::OUStringBuffer( d ))));
- CPPUNIT_ASSERT( !VALID_CONVERSION( buf.insert( 0, d )));
}
}} // namespace
diff --git a/sal/qa/rtl/uri/rtl_Uri.cxx b/sal/qa/rtl/uri/rtl_Uri.cxx
index 49ee686eac64..f91747326746 100644
--- a/sal/qa/rtl/uri/rtl_Uri.cxx
+++ b/sal/qa/rtl/uri/rtl_Uri.cxx
@@ -103,13 +103,13 @@ namespace Stringtest
rtl::OString sStr("h\xE4llo", strlen("h\xE4llo"));
rtl::OUString suString = rtl::OStringToOUString(sStr, RTL_TEXTENCODING_ISO_8859_15);
- CPPUNIT_ASSERT_MESSAGE("Strings must be equal", suString.equals(suStr_UriDecodeToIuri) == sal_True);
+ CPPUNIT_ASSERT_MESSAGE("Strings must be equal", suString.equals(suStr_UriDecodeToIuri));
// ustring --> ustring (UTF8)
rtl::OUString suStr2 = rtl::Uri::encode(suStr_UriDecodeToIuri, rtl_UriCharClassUnoParamValue, rtl_UriEncodeKeepEscapes, RTL_TEXTENCODING_UTF8);
showContent(suStr2);
- CPPUNIT_ASSERT_MESSAGE("Strings must be equal", suStr2.equals(suStrUTF8) == sal_True);
+ CPPUNIT_ASSERT_MESSAGE("Strings must be equal", suStr2.equals(suStrUTF8));
// suStr should be equal to suStr2
}