[virglrenderer-devel] [PATCH v2 05/21] vrend_renderer.c: Fix warnings
Gert Wollny
gert.wollny at collabora.com
Tue Jun 5 20:11:02 UTC 2018
vrend_renderer.c: In Funktion »vrend_hw_set_zsurf_texture«:
vrend_renderer.c:1516:65: Warnung: signed and unsigned type in
conditional expression [-Wsign-compare]
first_layer != last_layer ? 0xffffffff :
first_layer);
^
vrend_renderer.c: In Funktion »vrend_hw_set_color_surface«:
vrend_renderer.c:1535:68: Warnung: signed and unsigned type in
conditional expression [-Wsign-compare]
first_layer != last_layer ? 0xffffffff :
first_layer);
^
vrend_renderer.c: In Funktion »vrend_set_framebuffer_state«:
vrend_renderer.c:1618:18: Warnung: Vergleich zwischen
vorzeichenbehafteten und vorzeichenlosen Ganzzahlausdrücken [-Wsign-
compare]
for (i = 0; i < nr_cbufs; i++) {
^
vrend_renderer.c:1666:31: Warnung: Vergleich zwischen
vorzeichenbehafteten und vorzeichenlosen Ganzzahlausdrücken [-Wsign-
compare]
if (ctx->sub->fb_height != new_height || ctx->sub-
>inverted_fbo_content != new_ibf) {
Signed-off-by: Gert Wollny <gert.wollny at collabora.com>
---
src/vrend_renderer.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c
index 338fb90..eb3c367 100644
--- a/src/vrend_renderer.c
+++ b/src/vrend_renderer.c
@@ -813,9 +813,8 @@ static void set_stream_out_varyings(int prog_id, struct vrend_shader_info *sinfo
{
struct pipe_stream_output_info *so = &sinfo->so_info;
char *varyings[PIPE_MAX_SHADER_OUTPUTS*2];
- unsigned i;
int j;
- int n_outputs = 0;
+ uint i, n_outputs = 0;
int last_buffer = 0;
char *start_skip;
int buf_offset = 0;
@@ -1499,7 +1498,7 @@ void vrend_fb_bind_texture(struct vrend_resource *res,
static void vrend_hw_set_zsurf_texture(struct vrend_context *ctx)
{
struct vrend_resource *tex;
- int first_layer, last_layer;
+ uint32_t first_layer, last_layer;
if (!ctx->sub->zsurf) {
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_STENCIL_ATTACHMENT,
GL_TEXTURE_2D, 0, 0);
@@ -1527,8 +1526,8 @@ static void vrend_hw_set_color_surface(struct vrend_context *ctx, int index)
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, attachment,
GL_TEXTURE_2D, 0, 0);
} else {
- int first_layer = ctx->sub->surf[index]->val1 & 0xffff;
- int last_layer = (ctx->sub->surf[index]->val1 >> 16) & 0xffff;
+ uint32_t first_layer = ctx->sub->surf[index]->val1 & 0xffff;
+ uint32_t last_layer = (ctx->sub->surf[index]->val1 >> 16) & 0xffff;
tex = ctx->sub->surf[index]->texture;
@@ -1590,7 +1589,7 @@ void vrend_set_framebuffer_state(struct vrend_context *ctx,
uint32_t zsurf_handle)
{
struct vrend_surface *surf, *zsurf;
- int i;
+ uint i;
int old_num;
GLenum status;
GLint new_height = -1;
@@ -1664,7 +1663,7 @@ void vrend_set_framebuffer_state(struct vrend_context *ctx,
}
if (new_height != -1) {
- if (ctx->sub->fb_height != new_height || ctx->sub->inverted_fbo_content != new_ibf) {
+ if (ctx->sub->fb_height != (uint32_t)new_height || ctx->sub->inverted_fbo_content != new_ibf) {
ctx->sub->fb_height = new_height;
ctx->sub->inverted_fbo_content = new_ibf;
ctx->sub->scissor_state_dirty = (1 << 0);
--
2.16.4
More information about the virglrenderer-devel
mailing list