[virglrenderer-devel] [PATCH v2 12/21] vrend_renderer.c: Fix warnings

Gert Wollny gert.wollny at collabora.com
Tue Jun 5 20:11:09 UTC 2018


vrend_renderer.c: In Funktion »vrend_resource_copy_fallback«:
vrend_renderer.c:5902:100: Warnung: signed and unsigned type in
conditional expression [-Wsign-compare]
       GLenum ctarget = src_res->target == GL_TEXTURE_CUBE_MAP ?
       GL_TEXTURE_CUBE_MAP_POSITIVE_X + i : src_res->target;

vrend_renderer.c:5943:100: Warnung: signed and unsigned type in
conditional expression [-Wsign-compare]
       GLenum ctarget = dst_res->target == GL_TEXTURE_CUBE_MAP ?
       GL_TEXTURE_CUBE_MAP_POSITIVE_X + i : dst_res->target;

vrend_renderer.c: In Funktion »vrend_create_query«:
vrend_renderer.c:6404:54: Warnung: unused parameter »offset« [-Wunused-
parameter]
                        uint32_t res_handle, uint32_t offset)
                                                      ^~~~~~
vrend_renderer.c: In Funktion »vrend_get_query_result«:
vrend_renderer.c:6528:38: Warnung: unused parameter »wait« [-Wunused-
parameter]
                             uint32_t wait)
                                      ^~~~
vrend_renderer.c: In Funktion »vrend_renderer_fill_caps_common«:
vrend_renderer.c:6659:68: Warnung: unused parameter »version« [-Wunused-
parameter]
 static bool vrend_renderer_fill_caps_common(uint32_t set, uint32_t
version,
                                                                    ^~~~~~~
vrend_renderer.c: In Funktion »vrend_renderer_fill_caps_gles«:
vrend_renderer.c:6769:66: Warnung: unused parameter »version« [-Wunused-
parameter]
 static void vrend_renderer_fill_caps_gles(uint32_t set, uint32_t
version,
                                                                  ^~~~~~~
vrend_renderer.c: In Funktion »vrend_renderer_get_cursor_contents«:
vrend_renderer.c:7184:18: Warnung: Vergleich zwischen
vorzeichenbehafteten und vorzeichenlosen Ganzzahlausdrücken [-Wsign-
compare]
    for (h = 0; h < res->base.height0; h++) {
                  ^
v2: Use mesa style UNUSED annotation for unused parameters 

Signed-off-by: Gert Wollny <gert.wollny at collabora.com>
---
 src/vrend_renderer.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c
index a087579..1701236 100644
--- a/src/vrend_renderer.c
+++ b/src/vrend_renderer.c
@@ -5884,7 +5884,8 @@ static void vrend_resource_copy_fallback(struct vrend_context *ctx,
 
    slice_offset = 0;
    for (i = 0; i < cube_slice; i++) {
-      GLenum ctarget = src_res->target == GL_TEXTURE_CUBE_MAP ? GL_TEXTURE_CUBE_MAP_POSITIVE_X + i : src_res->target;
+      GLenum ctarget = src_res->target == GL_TEXTURE_CUBE_MAP ?
+                          (GLenum)(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i) : src_res->target;
       if (compressed) {
          if (vrend_state.have_arb_robustness)
             glGetnCompressedTexImageARB(ctarget, src_level, transfer_size, tptr + slice_offset);
@@ -5925,7 +5926,8 @@ static void vrend_resource_copy_fallback(struct vrend_context *ctx,
    cube_slice = (src_res->target == GL_TEXTURE_CUBE_MAP) ? src_box->z + src_box->depth : cube_slice;
    i = (src_res->target == GL_TEXTURE_CUBE_MAP) ? src_box->z : 0;
    for (; i < cube_slice; i++) {
-      GLenum ctarget = dst_res->target == GL_TEXTURE_CUBE_MAP ? GL_TEXTURE_CUBE_MAP_POSITIVE_X + i : dst_res->target;
+      GLenum ctarget = dst_res->target == GL_TEXTURE_CUBE_MAP ?
+                          (GLenum)(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i) : dst_res->target;
       if (compressed) {
          if (ctarget == GL_TEXTURE_1D) {
             glCompressedTexSubImage1D(ctarget, dst_level, dstx,
@@ -6386,7 +6388,7 @@ uint32_t vrend_renderer_object_insert(struct vrend_context *ctx, void *data,
 
 int vrend_create_query(struct vrend_context *ctx, uint32_t handle,
                        uint32_t query_type, uint32_t query_index,
-                       uint32_t res_handle, uint32_t offset)
+                       uint32_t res_handle, UNUSED uint32_t offset)
 {
    struct vrend_query *q;
    struct vrend_resource *res;
@@ -6510,7 +6512,7 @@ void vrend_end_query(struct vrend_context *ctx, uint32_t handle)
 }
 
 void vrend_get_query_result(struct vrend_context *ctx, uint32_t handle,
-                            uint32_t wait)
+                            UNUSED uint32_t wait)
 {
    struct vrend_query *q;
    bool ret;
@@ -6641,7 +6643,7 @@ static void vrender_get_glsl_version(int *glsl_version)
  * Does all of the common caps setting,
  * if it dedects a early out returns true.
  */
-static bool vrend_renderer_fill_caps_common(uint32_t set, uint32_t version,
+static bool vrend_renderer_fill_caps_common(uint32_t set, UNUSED uint32_t version,
 					    union virgl_caps *caps)
 {
    int i, gl_ver;
@@ -6751,7 +6753,7 @@ static bool vrend_renderer_fill_caps_common(uint32_t set, uint32_t version,
    return false;
 }
 
-static void vrend_renderer_fill_caps_gles(uint32_t set, uint32_t version,
+static void vrend_renderer_fill_caps_gles(uint32_t set, UNUSED uint32_t version,
 					  union virgl_caps *caps)
 {
    GLint max;
@@ -7101,7 +7103,7 @@ void *vrend_renderer_get_cursor_contents(uint32_t res_handle, uint32_t *width, u
    int blsize;
    char *data, *data2;
    int size;
-   int h;
+   uint h;
 
    res = vrend_resource_lookup(res_handle, 0);
    if (!res)
-- 
2.16.4



More information about the virglrenderer-devel mailing list