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 <olvaffe@gmail.com>
Reviewed-by: Elie Tournier <elie.tournier@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
macos/master
Chia-I Wu 5 years ago
parent 7fecf772f1
commit 82d05bfb10
  1. 3
      meson.build
  2. 2
      tests/test_virgl_strbuf.c
  3. 6
      tests/testvirgl_encode.c

@ -51,7 +51,8 @@ warnings = [
'-Werror=implicit-function-declaration', '-Werror=implicit-function-declaration',
'-Werror=missing-prototypes', '-Werror=missing-prototypes',
'-Wmissing-prototypes', '-Wmissing-prototypes',
'-Werror=int-to-pointer-cast' '-Werror=int-to-pointer-cast',
'-Wno-overlength-strings',
] ]
foreach w : warnings foreach w : warnings

@ -218,4 +218,4 @@ int main(void)
number_failed = srunner_ntests_failed(sr); number_failed = srunner_ntests_failed(sr);
srunner_free(sr); srunner_free(sr);
return number_failed == 0 ? EXIT_SUCCESS : EXIT_FAILURE; return number_failed == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}; }

@ -529,13 +529,13 @@ int virgl_encoder_inline_write(struct virgl_context *ctx,
/* break things down into chunks we can send */ /* break things down into chunks we can send */
/* send layers in separate chunks */ /* send layers in separate chunks */
for (layer = 0; layer < box->depth; layer++) { for (layer = 0; layer < box->depth; layer++) {
const void *layer_data = data; const uint8_t *layer_data = data;
mybox.z = layer; mybox.z = layer;
mybox.depth = 1; mybox.depth = 1;
/* send one line in separate chunks */ /* send one line in separate chunks */
for (row = 0; row < box->height; row++) { for (row = 0; row < box->height; row++) {
const void *row_data = layer_data; const uint8_t *row_data = layer_data;
mybox.y = row; mybox.y = row;
mybox.height = 1; mybox.height = 1;
mybox.x = 0; mybox.x = 0;
@ -558,7 +558,7 @@ int virgl_encoder_inline_write(struct virgl_context *ctx,
} }
layer_data += stride_internal; layer_data += stride_internal;
} }
data += layer_stride_internal; data = (uint8_t *)data + layer_stride_internal;
} }
return 0; return 0;
} }

Loading…
Cancel
Save