From 7b405ed3f95091486d6590f65831f884a272fe6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20Kie=C3=9F?= Date: Mon, 11 Nov 2024 17:54:24 +0100 Subject: [PATCH] Fix more -Wcast-qual warnings Cast pointers to the correct type to avoid -Wcast-qual warnings. The previous fix was missing some casts in template methods, but clang issues warnings for there methods even if the templates are not instantiated. --- include/CL/opencl.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/CL/opencl.hpp b/include/CL/opencl.hpp index 53f479de..81702dfb 100644 --- a/include/CL/opencl.hpp +++ b/include/CL/opencl.hpp @@ -8801,7 +8801,7 @@ class CommandQueue : public detail::Wrapper cl_int err = detail::errHandler(CL_(clEnqueueSVMMemcpy)( object_, blocking, static_cast(dst_ptr), static_cast(src_ptr), size, (events != nullptr) ? (cl_uint) events->size() : 0, - (events != nullptr && events->size() > 0) ? (cl_event *) &events->front() : nullptr, + (events != nullptr && events->size() > 0) ? (const cl_event *) &events->front() : nullptr, (event != nullptr) ? &tmp : nullptr), __ENQUEUE_COPY_SVM_ERR); if (event != nullptr && err == CL_SUCCESS) @@ -8827,7 +8827,7 @@ class CommandQueue : public detail::Wrapper object_, blocking, static_cast(dst_ptr.get()), static_cast(src_ptr.get()), size, (events != nullptr) ? (cl_uint) events->size() : 0, - (events != nullptr && events->size() > 0) ? (cl_event *) &events->front() : nullptr, + (events != nullptr && events->size() > 0) ? (const cl_event *) &events->front() : nullptr, (event != nullptr) ? &tmp : nullptr), __ENQUEUE_COPY_SVM_ERR); if (event != nullptr && err == CL_SUCCESS) @@ -8856,7 +8856,7 @@ class CommandQueue : public detail::Wrapper static_cast(src_container.data()), dst_container.size() * sizeof(T), (events != nullptr) ? (cl_uint) events->size() : 0, - (events != nullptr && events->size() > 0) ? (cl_event *) &events->front() : nullptr, + (events != nullptr && events->size() > 0) ? (const cl_event *) &events->front() : nullptr, (event != NULL) ? &tmp : nullptr), __ENQUEUE_COPY_SVM_ERR); if (event != nullptr && err == CL_SUCCESS) @@ -8881,7 +8881,7 @@ class CommandQueue : public detail::Wrapper object_, static_cast(ptr), static_cast(&pattern), sizeof(PatternType), size, (events != nullptr) ? (cl_uint) events->size() : 0, - (events != nullptr && events->size() > 0) ? (cl_event *) &events->front() : nullptr, + (events != nullptr && events->size() > 0) ? (const cl_event *) &events->front() : nullptr, (event != nullptr) ? &tmp : nullptr), __ENQUEUE_FILL_SVM_ERR); if (event != nullptr && err == CL_SUCCESS) @@ -8906,7 +8906,7 @@ class CommandQueue : public detail::Wrapper object_, static_cast(ptr.get()), static_cast(&pattern), sizeof(PatternType), size, (events != nullptr) ? (cl_uint) events->size() : 0, - (events != nullptr && events->size() > 0) ? (cl_event *) &events->front() : nullptr, + (events != nullptr && events->size() > 0) ? (const cl_event *) &events->front() : nullptr, (event != nullptr) ? &tmp : nullptr), __ENQUEUE_FILL_SVM_ERR); if (event != nullptr && err == CL_SUCCESS) @@ -8931,7 +8931,7 @@ class CommandQueue : public detail::Wrapper object_, static_cast(container.data()), static_cast(&pattern), sizeof(PatternType), container.size() * sizeof(T), (events != nullptr) ? (cl_uint) events->size() : 0, - (events != nullptr && events->size() > 0) ? (cl_event *) &events->front() : nullptr, + (events != nullptr && events->size() > 0) ? (const cl_event *) &events->front() : nullptr, (event != nullptr) ? &tmp : NULL), __ENQUEUE_FILL_SVM_ERR); if (event != nullptr && err == CL_SUCCESS)