[virglrenderer-devel] [PATCH 11/21] vrend_renderer.c: Fix warnings
Gert Wollny
gert.wollny at collabora.com
Fri Jun 1 08:47:58 UTC 2018
vrend_renderer.c: In function »vrend_resource_copy_fallback«:
vrend_renderer.c:5902:100: Warning: 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: Warning: 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 function »vrend_create_query«:
vrend_renderer.c:6404:54: Warning: unused parameter »offset« [-Wunused-
parameter]
uint32_t res_handle, uint32_t offset)
^~~~~~
vrend_renderer.c: In function »vrend_get_query_result«:
vrend_renderer.c:6528:38: Warning: unused parameter »wait« [-Wunused-
parameter]
uint32_t wait)
^~~~
vrend_renderer.c: In function »vrend_renderer_fill_caps_common«:
vrend_renderer.c:6659:68: Warning: unused parameter »version« [-Wunused-
parameter]
static bool vrend_renderer_fill_caps_common(uint32_t set, uint32_t
version,
^~~~~~~
vrend_renderer.c: In function »vrend_renderer_fill_caps_gles«:
vrend_renderer.c:6769:66: Warning: unused parameter »version« [-Wunused-
parameter]
static void vrend_renderer_fill_caps_gles(uint32_t set, uint32_t
version,
^~~~~~~
vrend_renderer.c: In function »vrend_renderer_get_cursor_contents«:
vrend_renderer.c:7184:18: Warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
for (h = 0; h < res->base.height0; h++) {
^
Signed-off-by: Gert Wollny <gert.wollny at collabora.com>
---
src/vrend_renderer.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c
index 1eb1eba..4398830 100644
--- a/src/vrend_renderer.c
+++ b/src/vrend_renderer.c
@@ -5899,7 +5899,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);
@@ -5940,7 +5941,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,
@@ -6403,6 +6405,7 @@ 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)
{
+ VREND_UNUSED(offset);
struct vrend_query *q;
struct vrend_resource *res;
uint32_t ret_handle;
@@ -6527,6 +6530,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)
{
+ VREND_UNUSED(wait);
struct vrend_query *q;
bool ret;
@@ -6659,6 +6663,8 @@ static void vrender_get_glsl_version(int *glsl_version)
static bool vrend_renderer_fill_caps_common(uint32_t set, uint32_t version,
union virgl_caps *caps)
{
+ VREND_UNUSED(version);
+
int i, gl_ver;
GLint max;
@@ -6769,6 +6775,8 @@ static bool vrend_renderer_fill_caps_common(uint32_t set, uint32_t version,
static void vrend_renderer_fill_caps_gles(uint32_t set, uint32_t version,
union virgl_caps *caps)
{
+ VREND_UNUSED(version);
+
GLint max;
GLfloat range[2];
bool fill_capset2 = false;
@@ -7116,7 +7124,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.17.0
More information about the virglrenderer-devel
mailing list