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

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


vrend_renderer.c: In Funktion »vrend_transfer_inline_write«:
vrend_renderer.c:5643:42: Warnung: unused parameter »usage« [-Wunused-
parameter]
                                 unsigned usage)
                                          ^~~~~
vrend_renderer.c: In Funktion »vrend_set_scissor_state«:
vrend_renderer.c:5699:18: Warnung: Vergleich zwischen
vorzeichenbehafteten und vorzeichenlosen Ganzzahlausdrücken [-Wsign-
compare]
    for (i = 0; i < num_scissor; i++) {
                  ^
vrend_renderer.c: In Funktion »vrend_set_sample_mask«:
vrend_renderer.c:5755:50: Warnung: unused parameter »ctx« [-Wunused-
parameter]
 void vrend_set_sample_mask(struct vrend_context *ctx, unsigned
sample_mask)
                                                  ^~~
vrend_renderer.c: In Funktion »vrend_hw_emit_streamout_targets«:
vrend_renderer.c:5764:18: Warnung: Vergleich zwischen
vorzeichenbehafteten und vorzeichenlosen Ganzzahlausdrücken [-Wsign-
compare]
    for (i = 0; i < so_obj->num_targets; i++) {
                  ^
vrend_renderer.c:5760:67: Warnung: unused parameter »ctx« [-Wunused-
parameter]
 static void vrend_hw_emit_streamout_targets(struct vrend_context *ctx,
struct vrend_streamout_object *so_obj)
                                                                   ^~~
vrend_renderer.c: In Funktion »vrend_set_streamout_targets«:
vrend_renderer.c:5803:21: Warnung: Vergleich zwischen
vorzeichenbehafteten und vorzeichenlosen Ganzzahlausdrücken [-Wsign-
compare]
       for (i = 0; i < num_targets; i++) {
                     ^
vrend_renderer.c:5773:43: Warnung: unused parameter »append_bitmask« [-
Wunused-parameter]
                                  uint32_t append_bitmask,
                                           ^~~~~~~~~~~~~~
vrend_renderer.c: In Funktion »vrend_resource_buffer_copy«:
vrend_renderer.c:5824:62: Warnung: unused parameter »ctx« [-Wunused-
parameter]
 static void vrend_resource_buffer_copy(struct vrend_context *ctx,

v2: Use mesa style UNUSED annotation for unused parameters

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

diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c
index 2152279..a087579 100644
--- a/src/vrend_renderer.c
+++ b/src/vrend_renderer.c
@@ -5631,7 +5631,7 @@ int vrend_renderer_transfer_iov(const struct vrend_transfer_info *info,
 
 int vrend_transfer_inline_write(struct vrend_context *ctx,
                                 struct vrend_transfer_info *info,
-                                unsigned usage)
+                                UNUSED unsigned usage)
 {
    struct vrend_resource *res;
 
@@ -5679,7 +5679,7 @@ void vrend_set_scissor_state(struct vrend_context *ctx,
                              uint32_t num_scissor,
                              struct pipe_scissor_state *ss)
 {
-   int i, idx;
+   uint i, idx;
 
    if (start_slot > PIPE_MAX_VIEWPORTS ||
        num_scissor > (PIPE_MAX_VIEWPORTS - start_slot)) {
@@ -5743,14 +5743,14 @@ void vrend_set_clip_state(struct vrend_context *ctx, struct pipe_clip_state *ucp
    }
 }
 
-void vrend_set_sample_mask(struct vrend_context *ctx, unsigned sample_mask)
+void vrend_set_sample_mask(UNUSED struct vrend_context *ctx, unsigned sample_mask)
 {
    glSampleMaski(0, sample_mask);
 }
 
-static void vrend_hw_emit_streamout_targets(struct vrend_context *ctx, struct vrend_streamout_object *so_obj)
+static void vrend_hw_emit_streamout_targets(UNUSED struct vrend_context *ctx, struct vrend_streamout_object *so_obj)
 {
-   int i;
+   uint i;
 
    for (i = 0; i < so_obj->num_targets; i++) {
       if (so_obj->so_targets[i]->buffer_offset || so_obj->so_targets[i]->buffer_size < so_obj->so_targets[i]->buffer->base.width0)
@@ -5761,12 +5761,12 @@ static void vrend_hw_emit_streamout_targets(struct vrend_context *ctx, struct vr
 }
 
 void vrend_set_streamout_targets(struct vrend_context *ctx,
-                                 uint32_t append_bitmask,
+                                 UNUSED uint32_t append_bitmask,
                                  uint32_t num_targets,
                                  uint32_t *handles)
 {
    struct vrend_so_target *target;
-   int i;
+   uint i;
 
    if (num_targets) {
       bool found = false;
@@ -5812,13 +5812,12 @@ void vrend_set_streamout_targets(struct vrend_context *ctx,
    }
 }
 
-static void vrend_resource_buffer_copy(struct vrend_context *ctx,
+static void vrend_resource_buffer_copy(UNUSED struct vrend_context *ctx,
                                        struct vrend_resource *src_res,
                                        struct vrend_resource *dst_res,
                                        uint32_t dstx, uint32_t srcx,
                                        uint32_t width)
 {
-
    glBindBuffer(GL_COPY_READ_BUFFER, src_res->id);
    glBindBuffer(GL_COPY_WRITE_BUFFER, dst_res->id);
 
-- 
2.16.4



More information about the virglrenderer-devel mailing list