aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2020-01-09 22:50:13 +0100
committerUlrich Sibiller <uli42@gmx.de>2020-01-10 00:25:46 +0100
commit1a1ace774f49bccbb4760b4a0c58e56bf46548db (patch)
tree85dff8622b31d7c38e5b55d7e886aa9ea05d5186
parent914f88a8ab7bbbef3f0cb0674dfa5bd1fbddf050 (diff)
downloadnx-libs-1a1ace774f49bccbb4760b4a0c58e56bf46548db.tar.gz
nx-libs-1a1ace774f49bccbb4760b4a0c58e56bf46548db.tar.bz2
nx-libs-1a1ace774f49bccbb4760b4a0c58e56bf46548db.zip
_XkbFilterDeviceBtn: move variable declarations to match usage scope
Fix this warning: xkbActions.c: In function ‘_XkbFilterDeviceBtn’: xkbActions.c:1084:6: warning: declaration of ‘button’ shadows a previous local [-Wshadow=compatible-local] int button; ^~~~~~ xkbActions.c:1044:6: note: shadowed declaration is here int button; ^~~~~~ Backport of this xorg-xserver upstream commit: commit 41dd7cf673e47ab74c5065b8dbf268b2e5facb64 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Mon Dec 12 16:49:34 2011 -0800 _XkbFilterDeviceBtn: move variable declarations to match usage scope The main body of this function is an if { } else if { } pair of blocks. Previously there was int button at the top level scope which is used only in the first block, and a redeclaration of int button inside the second block. Since there's no overlap in the code paths for the two uses of button, move the one from the outer block into the first block to help the programmer more quickly determine they are unrelated usages, and to silence the gcc warning of: xkbActions.c: In function '_XkbFilterDeviceBtn': xkbActions.c:999:6: warning: declaration of 'button' shadows a previous local xkbActions.c:955:6: warning: shadowed declaration is here For consistency, move DeviceIntPtr dev declarations as well that are used in the same way. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--nx-X11/programs/Xserver/xkb/xkbActions.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/nx-X11/programs/Xserver/xkb/xkbActions.c b/nx-X11/programs/Xserver/xkb/xkbActions.c
index eadef3bee..d51b3ade4 100644
--- a/nx-X11/programs/Xserver/xkb/xkbActions.c
+++ b/nx-X11/programs/Xserver/xkb/xkbActions.c
@@ -1040,10 +1040,10 @@ _XkbFilterDeviceBtn( XkbSrvInfoPtr xkbi,
unsigned keycode,
XkbAction * pAction)
{
-DeviceIntPtr dev;
-int button;
-
if (filter->keycode==0) { /* initial press */
+ DeviceIntPtr dev;
+ int button;
+
dev= _XkbLookupButtonDevice(pAction->devbtn.device,NULL);
if ((!dev)||(!dev->public.on)||(&dev->public==LookupPointerDevice()))
return 1;
@@ -1081,7 +1081,8 @@ int button;
}
}
else if (filter->keycode==keycode) {
- int button;
+ DeviceIntPtr dev;
+ int button;
filter->active= 0;
dev= _XkbLookupButtonDevice(filter->upAction.devbtn.device,NULL);