summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-09-20 12:53:27 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-09-22 12:58:14 +0200
commitde74d98c58db604aafc0ee623c252f3aa25ac4b7 (patch)
tree1ff996e3f5bc27c10c7c64313a357a5a9c2bfa86 /sal
parentbe8a33c0f03b83357d2ae37dda6bf65313267cea (diff)
OUStringLiteral/OStringLiteral coverity PARSE_ERROR workaround
do more like commit 121771e37f7e2de41cd5643475861062bf25627b Date: Mon Sep 21 09:17:54 2020 +0200 Make some OUStringLiteral vars constexpr cause coverity can live with that Change-Id: I9efd7f848289c4865997a44c6780373068422227 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103147 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sal')
-rw-r--r--sal/osl/w32/path_helper.cxx4
-rw-r--r--sal/qa/osl/pipe/osl_Pipe.cxx8
-rw-r--r--sal/qa/rtl/digest/rtl_digest.cxx4
-rw-r--r--sal/qa/rtl/textenc/rtl_textcvt.cxx2
4 files changed, 9 insertions, 9 deletions
diff --git a/sal/osl/w32/path_helper.cxx b/sal/osl/w32/path_helper.cxx
index 52808b3a9774..a2dd134fded9 100644
--- a/sal/osl/w32/path_helper.cxx
+++ b/sal/osl/w32/path_helper.cxx
@@ -25,8 +25,8 @@
#include <algorithm>
#include <wchar.h>
-const OUStringLiteral BACKSLASH (u"\\");
-const OUStringLiteral SLASH (u"/");
+constexpr OUStringLiteral BACKSLASH (u"\\");
+constexpr OUStringLiteral SLASH (u"/");
void osl_systemPathEnsureSeparator(/*inout*/ rtl_uString** ppustrPath)
{
diff --git a/sal/qa/osl/pipe/osl_Pipe.cxx b/sal/qa/osl/pipe/osl_Pipe.cxx
index c34bb0448977..f9e2bb16174e 100644
--- a/sal/qa/osl/pipe/osl_Pipe.cxx
+++ b/sal/qa/osl/pipe/osl_Pipe.cxx
@@ -87,11 +87,11 @@ static void printPipeError( ::osl::Pipe const & aPipe )
// pipe name and transfer contents
-const OUStringLiteral aTestPipeName(u"testpipe2");
-const OUStringLiteral aTestPipe1(u"testpipe1");
+constexpr OUStringLiteral aTestPipeName(u"testpipe2");
+constexpr OUStringLiteral aTestPipe1(u"testpipe1");
-const OStringLiteral m_pTestString1("Sun Microsystems");
-const OStringLiteral m_pTestString2("test pipe PASS/OK");
+constexpr OStringLiteral m_pTestString1("Sun Microsystems");
+constexpr OStringLiteral m_pTestString2("test pipe PASS/OK");
// test code start here
diff --git a/sal/qa/rtl/digest/rtl_digest.cxx b/sal/qa/rtl/digest/rtl_digest.cxx
index d948deaf6d6c..d890f924ddb1 100644
--- a/sal/qa/rtl/digest/rtl_digest.cxx
+++ b/sal/qa/rtl/digest/rtl_digest.cxx
@@ -39,8 +39,8 @@ using namespace rtl;
namespace
{
-const OStringLiteral sSampleString ("This is a sample sentence, which we use to check some crypto functions in sal.");
-const OStringLiteral sSampleString_only_one_diff ("This is a sample sentence. which we use to check some crypto functions in sal.");
+constexpr OStringLiteral sSampleString ("This is a sample sentence, which we use to check some crypto functions in sal.");
+constexpr OStringLiteral sSampleString_only_one_diff ("This is a sample sentence. which we use to check some crypto functions in sal.");
const rtlDigestAlgorithm constDigestAlgorithms[] =
{
diff --git a/sal/qa/rtl/textenc/rtl_textcvt.cxx b/sal/qa/rtl/textenc/rtl_textcvt.cxx
index 6dec034a96ff..1952e4b7a904 100644
--- a/sal/qa/rtl/textenc/rtl_textcvt.cxx
+++ b/sal/qa/rtl/textenc/rtl_textcvt.cxx
@@ -2961,7 +2961,7 @@ void Test::testInvalidUtf8() {
auto const converter = rtl_createTextToUnicodeConverter(
RTL_TEXTENCODING_JAVA_UTF8);
CPPUNIT_ASSERT(converter != nullptr);
- OStringLiteral const input(u8"\U00010000");
+ constexpr OStringLiteral input(u8"\U00010000");
sal_Unicode buf[TEST_STRING_SIZE];
sal_uInt32 info;
sal_Size converted;