[virglrenderer-devel] [PATCH 00/20] Fix warnings with -Wall -Wextra in vrend* and test*

Gert Wollny gert.wollny at collabora.com
Fri Jun 1 08:47:47 UTC 2018


Dear all,

this is the second series to fix all the warnings in virglrenderer. I tried to
keep the code as close to the original as possible and work mostly with
annotations, and explicit type casts, or changing the type of local variables
to silence the warnings. Only in some cases I deemed it better to change the
actual member of a struct or add a function.

For -Wmissing-field-initializers I actually disabled the warning directly in the
code because it is misleading.

Since vrend_renderer.c is a very long file I've split the changes into an number
of managable chunks.

The final patch adds -Wextra and -Werror=int-to-pointer to the compile flags. The
first I propose to add, so that everybody always sees all the warnings, and has
more incentive to keep the code clean and latter I propose because this is really a
construct that one should not use (although when the code compiles warning free with
"-Wall -Wextra" any warning showing up might ring an alarm bell).

Thanks for reviewing,
Gert

Gert Wollny (20):
  vrend_formats.c: Silence warning -Wmissing-field-initializers
  vrend_renderer.c: Fix warnings
  virglrenderer.c: Fix warning
  vrend_renderer.c: Fix warnings
  vrend_renderer.c: Fix warnings and clean code
  vrend_renderer.c: Fix warnings
  vrend_renderer.c: Fix warnings
  vrend_renderer.c: fix warnings
  vrend_renderer.c: Fix warnings
  vrend_renderer.c: Fix warnings
  vrend_renderer.c: Fix warnings
  vrend_shader.c: Fix warnings
  vrend_object.c: Fix warnings
  vrend_decode.c: Fix warnings
  vrend_blitter.c, vrend_egl_context.c: Fix warnings
  testvirgl.c: Fix warnings
  testvirgl_encode.c: Fix warnings
  test_virgl_transfer.c: Fix warnings
  vtest_renderer.c: Fix warnings
  configure.ac: Add more warning flags

 configure.ac                |   2 +
 src/virgl_egl_context.c     |   1 +
 src/virglrenderer.c         |   1 +
 src/vrend_blitter.c         |   1 +
 src/vrend_decode.c          |  15 +++--
 src/vrend_formats.c         |  15 +++++
 src/vrend_object.c          |   3 +
 src/vrend_renderer.c        | 130 +++++++++++++++++++++++++++-----------------
 src/vrend_shader.c          |  31 ++++++-----
 tests/test_virgl_transfer.c |   3 +-
 tests/testvirgl.c           |   5 +-
 tests/testvirgl_encode.c    |  20 ++++---
 tests/testvirgl_encode.h    |   7 +++
 vtest/vtest_renderer.c      |   8 ++-
 14 files changed, 156 insertions(+), 86 deletions(-)

-- 
2.16.1



More information about the virglrenderer-devel mailing list