diff options
Diffstat (limited to 'sal')
-rw-r--r-- | sal/osl/all/debugbase.cxx | 6 | ||||
-rw-r--r-- | sal/osl/unx/process_impl.cxx | 4 | ||||
-rw-r--r-- | sal/qa/osl/socket.cxx | 5 | ||||
-rw-r--r-- | sal/qa/rtl/strings/test_ostring.cxx | 2 | ||||
-rw-r--r-- | sal/qa/rtl/strings/test_strings_defaultstringview.cxx | 2 |
5 files changed, 8 insertions, 11 deletions
diff --git a/sal/osl/all/debugbase.cxx b/sal/osl/all/debugbase.cxx index 51656e7d37d2..08fccf50316d 100644 --- a/sal/osl/all/debugbase.cxx +++ b/sal/osl/all/debugbase.cxx @@ -35,9 +35,9 @@ const std::vector<OString>& StaticDebugBaseAddressFilter() { std::vector<OString> vec; rtl_uString * pStr = nullptr; - OUString const name( - "OSL_DEBUGBASE_STORE_ADDRESSES" ); - if (osl_getEnvironment( name.pData, &pStr ) == osl_Process_E_None) { + if (osl_getEnvironment( u"OSL_DEBUGBASE_STORE_ADDRESSES"_ustr.pData, &pStr ) + == osl_Process_E_None) + { OUString const str(pStr); rtl_uString_release(pStr); sal_Int32 nIndex = 0; diff --git a/sal/osl/unx/process_impl.cxx b/sal/osl/unx/process_impl.cxx index e2d3d125b0ab..0e3f3e6d8e20 100644 --- a/sal/osl/unx/process_impl.cxx +++ b/sal/osl/unx/process_impl.cxx @@ -247,10 +247,8 @@ void SAL_CALL osl_setCommandArgs (int argc, char ** argv) /* see @ osl_getExecutableFile(). */ if (rtl_ustr_indexOfChar (rtl_uString_getStr(ppArgs[0]), '/') == -1) { - const OUString PATH ("PATH"); - rtl_uString * pSearchPath = nullptr; - osl_getEnvironment (PATH.pData, &pSearchPath); + osl_getEnvironment (u"PATH"_ustr.pData, &pSearchPath); if (pSearchPath) { rtl_uString * pSearchResult = nullptr; diff --git a/sal/qa/osl/socket.cxx b/sal/qa/osl/socket.cxx index ed31c9ede7ae..4598754a2214 100644 --- a/sal/qa/osl/socket.cxx +++ b/sal/qa/osl/socket.cxx @@ -25,7 +25,7 @@ class SocketTest : public CppUnit::TestFixture void test_createInetSocketAddr() { - OUString const in("123.4.56.78"); + OUString constexpr in(u"123.4.56.78"_ustr); auto const addr = osl_createInetSocketAddr(in.pData, 100); CPPUNIT_ASSERT(addr != nullptr); CPPUNIT_ASSERT_EQUAL(osl_Socket_FamilyInet, osl_getFamilyOfSocketAddr(addr)); @@ -39,8 +39,7 @@ class SocketTest : public CppUnit::TestFixture void test_createInetBroadcastAddr() { - OUString const in("123.4.56.78"); - auto const addr = osl_createInetBroadcastAddr(in.pData, 100); + auto const addr = osl_createInetBroadcastAddr(u"123.4.56.78"_ustr.pData, 100); CPPUNIT_ASSERT(addr != nullptr); CPPUNIT_ASSERT_EQUAL(osl_Socket_FamilyInet, osl_getFamilyOfSocketAddr(addr)); OUString out; diff --git a/sal/qa/rtl/strings/test_ostring.cxx b/sal/qa/rtl/strings/test_ostring.cxx index b4fb201cafa3..f0a82a712254 100644 --- a/sal/qa/rtl/strings/test_ostring.cxx +++ b/sal/qa/rtl/strings/test_ostring.cxx @@ -109,7 +109,7 @@ void Test::testCompareTo() void Test::testUtf8StringLiterals() { - const OString sIn(u8"ßa"); + OString sIn(u8"ßa"); CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(3), sIn.getLength()); CPPUNIT_ASSERT_EQUAL(195, int(static_cast<unsigned char>(sIn[0]))); CPPUNIT_ASSERT_EQUAL(159, int(static_cast<unsigned char>(sIn[1]))); diff --git a/sal/qa/rtl/strings/test_strings_defaultstringview.cxx b/sal/qa/rtl/strings/test_strings_defaultstringview.cxx index 591688b31c3c..3e7c5f971599 100644 --- a/sal/qa/rtl/strings/test_strings_defaultstringview.cxx +++ b/sal/qa/rtl/strings/test_strings_defaultstringview.cxx @@ -52,7 +52,7 @@ class Test : public CppUnit::TestFixture OUString("foo").startsWithIgnoreAsciiCase(std::u16string_view())); CPPUNIT_ASSERT_EQUAL(true, OUString("foo").endsWith(std::u16string_view())); CPPUNIT_ASSERT_EQUAL(true, OUString("foo").endsWithIgnoreAsciiCase(std::u16string_view())); - OUString const foo("foo"); // avoid loplugin:stringconstant, loplugin:stringview + OUString constexpr foo(u"foo"_ustr); // avoid loplugin:stringconstant, loplugin:stringview CPPUNIT_ASSERT_EQUAL(false, foo == std::u16string_view()); CPPUNIT_ASSERT_EQUAL(true, foo != std::u16string_view()); CPPUNIT_ASSERT_EQUAL(false, foo < std::u16string_view()); |