From 82d05bfb1034a0dfe1eb23f084d99f8f1a171e52 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Thu, 23 Apr 2020 12:51:09 -0700 Subject: [PATCH] tests: silence warnings Fix void* arithmetic and extra semicolon. -Wno-overlength-strings is for large_frag in large_shader.h. Signed-off-by: Chia-I Wu Reviewed-by: Elie Tournier Reviewed-by: Gert Wollny --- meson.build | 3 ++- tests/test_virgl_strbuf.c | 2 +- tests/testvirgl_encode.c | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/meson.build b/meson.build index 9ebc49a..6e253e5 100644 --- a/meson.build +++ b/meson.build @@ -51,7 +51,8 @@ warnings = [ '-Werror=implicit-function-declaration', '-Werror=missing-prototypes', '-Wmissing-prototypes', - '-Werror=int-to-pointer-cast' + '-Werror=int-to-pointer-cast', + '-Wno-overlength-strings', ] foreach w : warnings diff --git a/tests/test_virgl_strbuf.c b/tests/test_virgl_strbuf.c index 7347948..17b596d 100644 --- a/tests/test_virgl_strbuf.c +++ b/tests/test_virgl_strbuf.c @@ -218,4 +218,4 @@ int main(void) number_failed = srunner_ntests_failed(sr); srunner_free(sr); return number_failed == 0 ? EXIT_SUCCESS : EXIT_FAILURE; -}; +} diff --git a/tests/testvirgl_encode.c b/tests/testvirgl_encode.c index 6f7192a..f44a640 100644 --- a/tests/testvirgl_encode.c +++ b/tests/testvirgl_encode.c @@ -529,13 +529,13 @@ int virgl_encoder_inline_write(struct virgl_context *ctx, /* break things down into chunks we can send */ /* send layers in separate chunks */ for (layer = 0; layer < box->depth; layer++) { - const void *layer_data = data; + const uint8_t *layer_data = data; mybox.z = layer; mybox.depth = 1; /* send one line in separate chunks */ for (row = 0; row < box->height; row++) { - const void *row_data = layer_data; + const uint8_t *row_data = layer_data; mybox.y = row; mybox.height = 1; mybox.x = 0; @@ -558,7 +558,7 @@ int virgl_encoder_inline_write(struct virgl_context *ctx, } layer_data += stride_internal; } - data += layer_stride_internal; + data = (uint8_t *)data + layer_stride_internal; } return 0; }