opencl/source/opencl_device.cxx |   18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

New commits:
commit c544f9ea78eab46c4f5230273a5a8571b28ea84d
Author:     Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org>
AuthorDate: Thu Feb 2 16:19:11 2023 +0200
Commit:     Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org>
CommitDate: Fri Feb 3 07:13:52 2023 +0000

    Use raw string literal in opencl to keep PMD static analyser happy
    
    Change-Id: Ibf2bd12b79c6e7c7eae59fc516e75c1bda971a7c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146502
    Tested-by: Jenkins
    Tested-by: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org>
    Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org>

diff --git a/opencl/source/opencl_device.cxx b/opencl/source/opencl_device.cxx
index ca9f4f43b5d1..e8712cb5a745 100644
--- a/opencl/source/opencl_device.cxx
+++ b/opencl/source/opencl_device.cxx
@@ -30,8 +30,6 @@
 #define INPUTSIZE  15360
 #define OUTPUTSIZE 15360
 
-#define STRINGIFY(...) #__VA_ARGS__"\n"
-
 namespace {
 
 void DS_CHECK_STATUS(cl_int status, char const * name) {
@@ -55,13 +53,13 @@ struct LibreOfficeDeviceEvaluationIO
     tools::ULong outputSize;
 };
 
-const char* source = STRINGIFY(
-\n#if defined(KHR_DP_EXTENSION)
-\n#pragma OPENCL EXTENSION cl_khr_fp64 : enable
-\n#elif defined(AMD_DP_EXTENSION)
-\n#pragma OPENCL EXTENSION cl_amd_fp64 : enable
-\n#endif
-    \n
+const char* source = R"delimit(
+#if defined(KHR_DP_EXTENSION)
+#pragma OPENCL EXTENSION cl_khr_fp64 : enable
+#elif defined(AMD_DP_EXTENSION)
+#pragma OPENCL EXTENSION cl_amd_fp64 : enable
+#endif
+
     int isNan(fp_t a) { return a != a; }
     fp_t fsum(fp_t a, fp_t b) { return a + b; }
 
@@ -108,7 +106,7 @@ const char* source = STRINGIFY(
     fp_t tmp1 = fMin(input1) * fSoP(input2, input3);
     result[gid0] = fsum(tmp0, tmp1);
 }
-    );
+    )delimit";
 
 size_t sourceSize[] = { strlen(source) };
 

Reply via email to