Skip to content

Commit fd348fd

Browse files
Fix more -Wcast-qual warnings (KhronosGroup#317)
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.
1 parent a232f10 commit fd348fd

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

include/CL/opencl.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8801,7 +8801,7 @@ class CommandQueue : public detail::Wrapper<cl_command_queue>
88018801
cl_int err = detail::errHandler(CL_(clEnqueueSVMMemcpy)(
88028802
object_, blocking, static_cast<void *>(dst_ptr), static_cast<const void *>(src_ptr), size,
88038803
(events != nullptr) ? (cl_uint) events->size() : 0,
8804-
(events != nullptr && events->size() > 0) ? (cl_event *) &events->front() : nullptr,
8804+
(events != nullptr && events->size() > 0) ? (const cl_event *) &events->front() : nullptr,
88058805
(event != nullptr) ? &tmp : nullptr), __ENQUEUE_COPY_SVM_ERR);
88068806

88078807
if (event != nullptr && err == CL_SUCCESS)
@@ -8827,7 +8827,7 @@ class CommandQueue : public detail::Wrapper<cl_command_queue>
88278827
object_, blocking, static_cast<void *>(dst_ptr.get()), static_cast<const void *>(src_ptr.get()),
88288828
size,
88298829
(events != nullptr) ? (cl_uint) events->size() : 0,
8830-
(events != nullptr && events->size() > 0) ? (cl_event *) &events->front() : nullptr,
8830+
(events != nullptr && events->size() > 0) ? (const cl_event *) &events->front() : nullptr,
88318831
(event != nullptr) ? &tmp : nullptr), __ENQUEUE_COPY_SVM_ERR);
88328832

88338833
if (event != nullptr && err == CL_SUCCESS)
@@ -8856,7 +8856,7 @@ class CommandQueue : public detail::Wrapper<cl_command_queue>
88568856
static_cast<const void *>(src_container.data()),
88578857
dst_container.size() * sizeof(T),
88588858
(events != nullptr) ? (cl_uint) events->size() : 0,
8859-
(events != nullptr && events->size() > 0) ? (cl_event *) &events->front() : nullptr,
8859+
(events != nullptr && events->size() > 0) ? (const cl_event *) &events->front() : nullptr,
88608860
(event != NULL) ? &tmp : nullptr), __ENQUEUE_COPY_SVM_ERR);
88618861

88628862
if (event != nullptr && err == CL_SUCCESS)
@@ -8881,7 +8881,7 @@ class CommandQueue : public detail::Wrapper<cl_command_queue>
88818881
object_, static_cast<void *>(ptr), static_cast<void *>(&pattern),
88828882
sizeof(PatternType), size,
88838883
(events != nullptr) ? (cl_uint) events->size() : 0,
8884-
(events != nullptr && events->size() > 0) ? (cl_event *) &events->front() : nullptr,
8884+
(events != nullptr && events->size() > 0) ? (const cl_event *) &events->front() : nullptr,
88858885
(event != nullptr) ? &tmp : nullptr), __ENQUEUE_FILL_SVM_ERR);
88868886

88878887
if (event != nullptr && err == CL_SUCCESS)
@@ -8906,7 +8906,7 @@ class CommandQueue : public detail::Wrapper<cl_command_queue>
89068906
object_, static_cast<void *>(ptr.get()), static_cast<void *>(&pattern),
89078907
sizeof(PatternType), size,
89088908
(events != nullptr) ? (cl_uint) events->size() : 0,
8909-
(events != nullptr && events->size() > 0) ? (cl_event *) &events->front() : nullptr,
8909+
(events != nullptr && events->size() > 0) ? (const cl_event *) &events->front() : nullptr,
89108910
(event != nullptr) ? &tmp : nullptr), __ENQUEUE_FILL_SVM_ERR);
89118911

89128912
if (event != nullptr && err == CL_SUCCESS)
@@ -8931,7 +8931,7 @@ class CommandQueue : public detail::Wrapper<cl_command_queue>
89318931
object_, static_cast<void *>(container.data()), static_cast<void *>(&pattern),
89328932
sizeof(PatternType), container.size() * sizeof(T),
89338933
(events != nullptr) ? (cl_uint) events->size() : 0,
8934-
(events != nullptr && events->size() > 0) ? (cl_event *) &events->front() : nullptr,
8934+
(events != nullptr && events->size() > 0) ? (const cl_event *) &events->front() : nullptr,
89358935
(event != nullptr) ? &tmp : NULL), __ENQUEUE_FILL_SVM_ERR);
89368936

89378937
if (event != nullptr && err == CL_SUCCESS)

0 commit comments

Comments
 (0)