hw/xwin: Fix -Warray-bounds warning in winXCursorToHCURSOR()
authorJon TURNEY <jon.turney@dronecode.org.uk>
Sat, 10 Aug 2013 10:55:23 +0000 (11:55 +0100)
committerJon TURNEY <jon.turney@dronecode.org.uk>
Fri, 30 Aug 2013 11:58:49 +0000 (12:58 +0100)
commit784c006adb22c6693ad30dd0b1b05369cfaa7b5e
tree0e43bcaea6f5db96e7d3b503d780dd2ffccf94ad
parent41d03c9ccce665b919b180bbb819b78c750aa325
hw/xwin: Fix -Warray-bounds warning in winXCursorToHCURSOR()

Rewrite winXCursorToHCURSOR() so access to BITMAPINFO bmiColors member doesn't
trigger an -Warray-bounds warning.

Note that the underlying storage is allocated as a BITMAPV4HEADER, so has
sufficent room for the extra RGBQUADs bmiColors after the BITMAPINFO bmiHeader.

wincursor.c: In function 'winSetCursor':
wincursor.c:293:24: error: array subscript is above array bounds [-Werror=array-bounds]
wincursor.c:294:24: error: array subscript is above array bounds [-Werror=array-bounds]
wincursor.c:295:24: error: array subscript is above array bounds [-Werror=array-bounds]
wincursor.c:296:24: error: array subscript is above array bounds [-Werror=array-bounds]
wincursor.c:297:24: error: array subscript is above array bounds [-Werror=array-bounds]
wincursor.c:298:24: error: array subscript is above array bounds [-Werror=array-bounds]
wincursor.c:299:24: error: array subscript is above array bounds [-Werror=array-bounds]
wincursor.c:300:24: error: array subscript is above array bounds [-Werror=array-bounds]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
hw/xwin/wincursor.c