SDL/src/render
David Gow 8f06a629aa render: Fix -Wmaybe-uninitialized warning in RenderDrawLinesWithRects{,F}
The RenderDrawLinesWithRects and RenderDrawLinesWithRectsF functions can
sometimes call QueueCmdFillRects() with the data pointed to by frects
uninitialised. This can occur if none of the lines can be replaced with
rects, in which case the frects array is empty, and nrects is 0.

gcc 10.3.0 will detect this possibility, and print a warning like:
/home/david/Development/SDL/src/render/SDL_render.c: In function 'RenderDrawLinesWithRectsF':
/home/david/Development/SDL/src/render/SDL_render.c:2725:15: warning: '<unknown>' may be used uninitialized [-Wmaybe-uninitialized]
 2725 |     retval += QueueCmdFillRects(renderer, frects, nrects);
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/david/Development/SDL/src/render/SDL_render.c:499:1: note: by argument 2 of type 'const SDL_FRect *' to 'QueueCmdFillRects' declared here
  499 | QueueCmdFillRects(SDL_Renderer *renderer, const SDL_FRect * rects, const int count)
      | ^~~~~~~~~~~~~~~~~

This is harmless, because when this is uninitialised, nrects is always
0, so QueueCmdFillRects() does nothing anyway. We therefore can work
around this by only calling QueueCmdFillRects() when nrects is nonzero.
Somewhat impressively, gcc recognises that this is now safe.
2021-07-30 10:53:49 -04:00
..
direct3d direct3d: Fix possibly-incorrect scissor test when clearing. 2021-07-30 00:33:15 -04:00
direct3d11 update SDL_COMPOSE_ERROR macro for windows clang-cl 2021-03-04 18:27:47 +03:00
metal mac/iOS: allow Metal in windows created without an explicit backend 2021-02-15 08:43:53 -08:00
opengl opengl: More work on making line drawing match software renderer. 2021-01-11 20:40:11 -05:00
opengles opengl: More work on making line drawing match software renderer. 2021-01-11 20:40:11 -05:00
opengles2 Fix casts that should be using uintptr_t 2021-07-29 14:42:15 -07:00
psp Updated copyright for 2021 2021-01-02 10:25:38 -08:00
software Updated copyright for 2021 2021-01-02 10:25:38 -08:00
vitagxm Remove 'support' for rgb/bgr textures, that was causing issues with them 2021-07-19 10:14:13 -04:00
SDL_d3dmath.c Updated copyright for 2021 2021-01-02 10:25:38 -08:00
SDL_d3dmath.h Updated copyright for 2021 2021-01-02 10:25:38 -08:00
SDL_render.c render: Fix -Wmaybe-uninitialized warning in RenderDrawLinesWithRects{,F} 2021-07-30 10:53:49 -04:00
SDL_sysrender.h Remove leftovers 2021-06-11 13:21:07 -04:00
SDL_yuv_sw.c Fix software UpdateNVTexture non fullscreen (bug #5430) 2021-01-05 21:54:03 +01:00
SDL_yuv_sw_c.h Remove old YUV fixme 2021-02-10 10:22:18 -05:00