hw/xwin: Fix using index as a formal parameter in winscrinit.c shadows index()

Using index as a local variable shadows index() from strings.h

winscrinit.c: In function ‘winFinishScreenInitFB’:
winscrinit.c:274:28: error: declaration of ‘index’ shadows a global declaration
winscrinit.c: In function ‘winFinishScreenInitNativeGDI’:
winscrinit.c:623:35: error: declaration of ‘index’ shadows a global declaration

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
hw/xwin: Fix using index as a formal parameter shadows index()

Using index as a formal parameter shadows index() from strings.h

winallpriv.c: In function ‘winInitCmapPrivates’:
winallpriv.c:119:45: error: declaration of ‘index’ shadows a global declaration

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
hw/xwin: Fix using menu as a formal parameter shadows a global variable of the same name

Using menu as a formal parameter shadows a global variable of the same name

winprefsyacc.y: In function ‘SetRootMenu’:
winprefsyacc.y:286:20: error: declaration of ‘menu’ shadows a global declaration
winprefsyacc.y:55:19: error: shadowed declaration is here
winprefsyacc.y: In function ‘SetDefaultSysMenu’:
winprefsyacc.y:293:26: error: declaration of ‘menu’ shadows a global declaration
winprefsyacc.y:55:19: error: shadowed declaration is here

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
hw/xwin: Fix using screenInfo as a formal parameter to InitOutput() shadows a global declaration

Using screenInfo as a formal parameter to InitOutput() shadows a global declaration of screenInfo.
Change the formal parameter name from screenInfo to pScreenInfo, as everywhere else uses.

InitOutput.c: In function ‘InitOutput’:
InitOutput.c:891:25: error: declaration of ‘screenInfo’ shadows a global declaration
../../include/scrnintstr.h:570:19: error: shadowed declaration is here

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
hw/xwin/glx: Fix using Mask as a formal parameter shadows a global typedef of the same name

Fix using Mask as a formal parameter shadows the typedef of the same name from X.h

indirect.c: In function 'GetShift':
indirect.c:1629:14: warning: declaration of 'Mask' shadows a global declaration [-Wshadow]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
hw/xwin: Fix shadowed local variables in winLoadCursor()

Move shadowed local variables x and y to the places they are used

wincursor.c: In function ‘winLoadCursor’:
wincursor.c:212:11: error: declaration of ‘x’ shadows a previous local
wincursor.c:166:7: error: shadowed declaration is here
wincursor.c:212:14: error: declaration of ‘y’ shadows a previous local
wincursor.c:166:10: error: shadowed declaration is here
wincursor.c:228:11: error: declaration of ‘x’ shadows a previous local
wincursor.c:166:7: error: shadowed declaration is here
wincursor.c:228:14: error: declaration of ‘y’ shadows a previous local
wincursor.c:166:10: error: shadowed declaration is here

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
hw/xwin: Fix shadowed local variable i in HandleCustomWM_COMMAND()

Fix shadowed local variable i in HandleCustomWM_COMMAND()

Also, fds are meant to be representable as an int

winprefs.c: In function ‘HandleCustomWM_COMMAND’:
winprefs.c:346:23: error: declaration of ‘i’ shadows a previous local
winprefs.c:322:7: error: shadowed declaration is here

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
hw/xwin: Warning fix in ProcWindowsWMFrameSetTitle()

winwindowswm.c: In function ‘ProcWindowsWMFrameSetTitle’:
winwindowswm.c:514: error: pointer targets in passing argument 2 of ‘strncpy’ differ in signedness

If you're going to stick random casts into your code, at least use the goddammed
right ones. :-)

Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
hw/xwin: Fix some of the warnings in generated gl wrapper code

Fix some of the warnings in generated gl wrapper code:
- glWinResolveHelper takes a const char * argument
- ensure formal parameter names don't collide with reserved names or shadow
global declarations (e.g. near, far, index (from string.h), remainder (from
math.h), pointer (from Xdefs.h) by postpending a '_'.

generated_gl_wrappers.c:13:3: warning: passing argument 2 of 'glWinResolveHelper' discards qualifiers from pointer target type
glwrap.c:70:1: note: expected 'char *' but argument is of type 'const char *'
[repeated many times]
generated_gl_wrappers.c: In function 'glVertexAttrib1dARBWrapper': generated_gl_wrappers.c:6884:47: warning: declaration of 'index' shadows a global declaration [-Wshadow]
generated_gl_wrappers.c:6886:3: warning: passing argument 2 of 'glWinResolveHelper' discards qualifiers from pointer target type
[repeated many times]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
hw/xwin: Fix warning about discarding const in initializing winKBLayouts

winlayouts.h:46:5: warning: initialization discards qualifiers from pointer target type
winlayouts.h:46:5: warning: initialization discards qualifiers from pointer target type
winlayouts.h:46:5: warning: initialization discards qualifiers from pointer target type
[repeated for each layout]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
hw/xwin: Use char strings in winClipboardUNIXtoDOS for consistency with the rest of the clipboard code

winclipboardxevents.c: In function ‘winClipboardFlushXEvents’:
winclipboardxevents.c:575:13: warning: passing argument 1 of ‘winClipboardUNIXtoDOS’ from incompatible pointer type
winclipboard.h:102:2: note: expected ‘unsigned char **’ but argument is of type ‘char **’

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
hw/xwin: Use X_ATTRIBUTE_PRINTF where suggested for winerror.c

Also, fix the typoed name OsVenderVErrorF (sic), so it actually gets prototyped
and remove redundant declarations of it's prototype.

winerror.c: In function ‘OsVendorVErrorF’:
winerror.c:56:5: warning: function might be possible candidate for ‘gnu_printf’ format attribute [-Wmissing-format-attribute]
winerror.c: In function ‘winMessageBoxF’:
winerror.c:104:5: warning: function might be possible candidate for ‘gnu_printf’ format attribute [-Wmissing-format-attribute]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
hw/xwin: Use X_ATTRIBUTE_PRINTF where suggested for winmsg.c

winmsg.c: In function ‘winVMsg’:
winmsg.c:47:5: warning: function might be possible candidate for ‘gnu_printf’ format attribute [-Wmissing-format-attribute]
winmsg.c: In function ‘winDrvMsg’:
winmsg.c:56:5: warning: function might be possible candidate for ‘gnu_printf’ format attribute [-Wmissing-format-attribute]
winmsg.c: In function ‘winMsg’:
winmsg.c:66:5: warning: function might be possible candidate for ‘gnu_printf’ format attribute [-Wmissing-format-attribute]
winmsg.c: In function ‘winDrvMsgVerb’:
winmsg.c:77:5: warning: function might be possible candidate for ‘gnu_printf’ format attribute [-Wmissing-format-attribute]
winmsg.c: In function ‘winMsgVerb’:
winmsg.c:87:5: warning: function might be possible candidate for ‘gnu_printf’ format attribute [-Wmissing-format-attribute]
winmsg.c: In function ‘winErrorFVerb’:
winmsg.c:97:5: warning: function might be possible candidate for ‘gnu_printf’ format attribute [-Wmissing-format-attribute]
winmsg.c: In function ‘winDebug’:
winmsg.c:107:5: warning: function might be possible candidate for ‘gnu_printf’ format attribute [-Wmissing-format-attribute]
winmsg.c: In function ‘winTrace’:
winmsg.c:117:5: warning: function might be possible candidate for ‘gnu_printf’ format attribute [-Wmissing-format-attribute]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Use X_ATTRIBUTE_PRINTF where suggested for os.h

InitOutput.c: In function ‘OsVendorInit’:
InitOutput.c:630:29: warning: assignment left-hand side might be a candidate for a format attribute [-Wmissing-format-attribute]
winprocarg.c: In function ‘ddxProcessArgument’:
winprocarg.c:231:29: warning: assignment left-hand side might be a candidate for a format attribute [-Wmissing-format-attribute]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
hw/xwin: Remove unused variables in winwindowswm.c

winwindowswm.c: In function ‘ProcWindowsWMQueryVersion’:
winwindowswm.c:85:9: warning: unused variable ‘n’ [-Wunused-variable]
winwindowswm.c: In function ‘SProcWindowsWMQueryVersion’:
winwindowswm.c:565:9: warning: unused variable ‘n’ [-Wunused-variable]

Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
hw/xwin: Remove unused variables in winvalargs.c

winvalargs.c: In function ‘winValidateArgs’:
winvalargs.c:62:10: warning: unused variable ‘fImplicitScreenFound’ [-Wunused-variable]
winvalargs.c:60:9: warning: unused variable ‘iMaxConsecutiveScreen’ [-Wunused-variable]

Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
hw/xwin: Remove unused variables in winwindow.c

winwindow.c: In function ‘winCreateWindowNativeGDI’:
winwindow.c:62:19: warning: unused variable ‘pWinPriv’ [-Wunused-variable]
winwindow.c: In function ‘winDestroyWindowNativeGDI’:
winwindow.c:85:19: warning: unused variable ‘pWinPriv’ [-Wunused-variable]
winwindow.c: In function ‘winPositionWindowNativeGDI’:
winwindow.c:108:19: warning: unused variable ‘pWinPriv’ [-Wunused-variable]
winwindow.c: In function ‘winChangeWindowAttributesNativeGDI’:
winwindow.c:213:19: warning: unused variable ‘pWinPriv’ [-Wunused-variable]
winwindow.c: In function ‘winUnmapWindowNativeGDI’:
winwindow.c:241:19: warning: unused variable ‘pWinPriv’ [-Wunused-variable]
winwindow.c: In function ‘winMapWindowNativeGDI’:
winwindow.c:265:19: warning: unused variable ‘pWinPriv’ [-Wunused-variable]

Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
hw/xwin: Remove unused variable in winmultiwindowwm.c

winmultiwindowwm.c: In function ‘UpdateName’:
winmultiwindowwm.c:522:14: warning: unused variable ‘pszName’ [-Wunused-variable]

Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
hw/xwin: Fix no return value warning in winClipboardProc()

winclipboardthread.c: In function ‘winClipboardProc’:
winclipboardthread.c:415:9: warning: ‘return’ with no value, in function returning non-void
winclipboardthread.c:424:13: warning: ‘return’ with no value, in function returning non-void

Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
End physically active touches when device is disabled

Otherwise:

* We can't end the touches while device is disabled
* New touches after enabling the device may erroneously be mapped to old
  logical touches

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>