Page MenuHomePhabricator
Paste P115

clover address warnings
ArchivedPublic

Authored by pmoreau on Sep 24 2019, 7:04 PM.
```
../../../src/mesa/src/gallium/state_trackers/clover/api/memory.cpp:228:53: warning: suggest braces around initialization of subobject [-Wmissing-braces]
row_pitch, 0, 0, 0, NULL };
^~~~
{ }
```
```diff
diff --git a/src/gallium/state_trackers/clover/api/memory.cpp b/src/gallium/state_trackers/clover/api/memory.cpp
index df4b9baa1d9..2d25ed1a61b 100644
--- a/src/gallium/state_trackers/clover/api/memory.cpp
+++ b/src/gallium/state_trackers/clover/api/memory.cpp
@@ -225,7 +225,7 @@ clCreateImage2D(cl_context d_ctx, cl_mem_flags d_flags,
size_t width, size_t height, size_t row_pitch,
void *host_ptr, cl_int *r_errcode) {
const cl_image_desc desc = { CL_MEM_OBJECT_IMAGE2D, width, height, 0, 0,
- row_pitch, 0, 0, 0, NULL };
+ row_pitch, 0, 0, 0, { NULL } };
return clCreateImage(d_ctx, d_flags, format, &desc, host_ptr, r_errcode);
}
@@ -237,7 +237,7 @@ clCreateImage3D(cl_context d_ctx, cl_mem_flags d_flags,
size_t row_pitch, size_t slice_pitch,
void *host_ptr, cl_int *r_errcode) {
const cl_image_desc desc = { CL_MEM_OBJECT_IMAGE3D, width, height, depth, 0,
- row_pitch, slice_pitch, 0, 0, NULL };
+ row_pitch, slice_pitch, 0, 0, { NULL } };
return clCreateImage(d_ctx, d_flags, format, &desc, host_ptr, r_errcode);
}
```
```
../../../src/mesa/src/gallium/state_trackers/clover/llvm/util.hpp:40:16: warning: local variable 'e' will be copied despite being thrown by name [-Wreturn-std-move]
throw e;
^
```
```diff
diff --git a/src/gallium/state_trackers/clover/llvm/util.hpp b/src/gallium/state_trackers/clover/llvm/util.hpp
index 02e73e65071..969b28e0403 100644
--- a/src/gallium/state_trackers/clover/llvm/util.hpp
+++ b/src/gallium/state_trackers/clover/llvm/util.hpp
@@ -37,7 +37,7 @@ namespace clover {
template<typename E> void
fail(std::string &r_log, E &&e, const std::string &s) {
r_log += s;
- throw e;
+ throw std::move(e);
}
inline std::vector<std::string>
```
```
../../../src/mesa/src/gallium/state_trackers/clover/util/functional.hpp:269:17: warning: local variable 'it' will be copied despite being returned by name [-Wreturn-std-move]
return it;
^~
```
```diff
diff --git a/src/gallium/state_trackers/clover/util/functional.hpp b/src/gallium/state_trackers/clover/util/functional.hpp
index fc281c5c79a..27824892b4d 100644
--- a/src/gallium/state_trackers/clover/util/functional.hpp
+++ b/src/gallium/state_trackers/clover/util/functional.hpp
@@ -266,7 +266,7 @@ namespace clover {
S
operator()(S &&it) const {
std::advance(it, n);
- return it;
+ return static_cast<S>(it);
}
private:
```

Event Timeline

pmoreau created this object with visibility "Public (No Login Required)".