hw/xwin: Fix -Wmaybe-uninitialized warning in winWindowProc
This is possibly an actual bug in failing to check we successfully retrieved the monitor size before using it to set the X screen size. ../hw/xwin/winwndproc.c: In function ‘winWindowProc’: ../hw/xwin/winwndproc.c:283:55: warning: ‘dwHeight’ may be used uninitialized in this function [-Wmaybe-uninitialized] ../hw/xwin/winwndproc.c:240:32: note: ‘dwHeight’ was declared here ../hw/xwin/winwndproc.c:281:54: warning: ‘dwWidth’ may be used uninitialized in this function [-Wmaybe-uninitialized] ../hw/xwin/winwndproc.c:240:23: note: ‘dwWidth’ was declared here Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk> Reviewed-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
This commit is contained in:
parent
7a90c9b24e
commit
319daa7a9f
|
@ -237,7 +237,7 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
fMultiWindow
|
||||
#endif
|
||||
)) {
|
||||
DWORD dwWidth, dwHeight;
|
||||
DWORD dwWidth = 0, dwHeight = 0;
|
||||
|
||||
if (s_pScreenInfo->fMultipleMonitors) {
|
||||
/* resize to new virtual desktop size */
|
||||
|
@ -273,8 +273,9 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
*/
|
||||
|
||||
/* Set screen size to match new size, if it is different to current */
|
||||
if ((s_pScreenInfo->dwWidth != dwWidth) ||
|
||||
(s_pScreenInfo->dwHeight != dwHeight)) {
|
||||
if (((dwWidth != 0) && (dwHeight != 0)) &&
|
||||
((s_pScreenInfo->dwWidth != dwWidth) ||
|
||||
(s_pScreenInfo->dwHeight != dwHeight))) {
|
||||
winDoRandRScreenSetSize(s_pScreen,
|
||||
dwWidth,
|
||||
dwHeight,
|
||||
|
|
Loading…
Reference in New Issue
Block a user