[virglrenderer-devel] [PATCH v2 15/15] gallium/aux/util: fix some warnings
Gert Wollny
gert.wollny at collabora.com
Tue Jun 5 20:20:03 UTC 2018
u_debug_describe.c: In function 'debug_describe_reference':
util/u_debug_describe.c:33:65: warning: unused parameter 'ptr' [-
Wunused-parameter]
debug_describe_reference(char* buf, const struct pipe_reference*ptr)
^~~
CC util/u_format.lo
util/u_format.c: In function 'util_format_is_float':
util/u_format.c:57:10: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
if (i == -1) {
^~
CC util/u_surface.lo
util/u_surface.c: In function 'util_copy_rect':
util/u_surface.c:101:37: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
if (width == dst_stride && width == src_stride)
v2: use mesa style UNUSED annotation for unused parameters
Signed-off-by: Gert Wollny <gert.wollny at collabora.com>
---
src/gallium/auxiliary/util/u_debug_describe.c | 2 +-
src/gallium/auxiliary/util/u_format.c | 2 +-
src/gallium/auxiliary/util/u_surface.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/gallium/auxiliary/util/u_debug_describe.c b/src/gallium/auxiliary/util/u_debug_describe.c
index df73ed8..499c360 100644
--- a/src/gallium/auxiliary/util/u_debug_describe.c
+++ b/src/gallium/auxiliary/util/u_debug_describe.c
@@ -30,7 +30,7 @@
#include "util/u_string.h"
void
-debug_describe_reference(char* buf, const struct pipe_reference*ptr)
+debug_describe_reference(char* buf, UNUSED const struct pipe_reference*ptr)
{
strcpy(buf, "pipe_object");
}
diff --git a/src/gallium/auxiliary/util/u_format.c b/src/gallium/auxiliary/util/u_format.c
index 659189f..cda6aa7 100644
--- a/src/gallium/auxiliary/util/u_format.c
+++ b/src/gallium/auxiliary/util/u_format.c
@@ -46,7 +46,7 @@ boolean
util_format_is_float(enum pipe_format format)
{
const struct util_format_description *desc = util_format_description(format);
- unsigned i;
+ int i;
assert(desc);
if (!desc) {
diff --git a/src/gallium/auxiliary/util/u_surface.c b/src/gallium/auxiliary/util/u_surface.c
index 521bfe6..efc14fb 100644
--- a/src/gallium/auxiliary/util/u_surface.c
+++ b/src/gallium/auxiliary/util/u_surface.c
@@ -98,7 +98,7 @@ util_copy_rect(ubyte * dst,
src += src_y * src_stride_pos;
width *= blocksize;
- if (width == dst_stride && width == src_stride)
+ if (width == dst_stride && (int)width == src_stride)
memcpy(dst, src, height * width);
else {
for (i = 0; i < height; i++) {
--
2.16.4
More information about the virglrenderer-devel
mailing list