summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2011-12-12 16:49:34 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2011-12-12 17:03:11 -0800
commit41dd7cf673e47ab74c5065b8dbf268b2e5facb64 (patch)
tree101b682c15c55057b2378434431a0c6f93c5a10a
parentd8eb9b5faa2d2c9350bdaffef8749a9cac3c87b8 (diff)
_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--xkb/xkbActions.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/xkb/xkbActions.c b/xkb/xkbActions.c
index 1e94d261c..33864e16d 100644
--- a/xkb/xkbActions.c
+++ b/xkb/xkbActions.c
@@ -951,13 +951,13 @@ _XkbFilterDeviceBtn( XkbSrvInfoPtr xkbi,
unsigned keycode,
XkbAction * pAction)
{
-DeviceIntPtr dev;
-int button;
-
if (xkbi->device == inputInfo.keyboard)
return 0;
if (filter->keycode==0) { /* initial press */
+ DeviceIntPtr dev;
+ int button;
+
_XkbLookupButtonDevice(&dev, pAction->devbtn.device, serverClient,
DixUnknownAccess, &button);
if (!dev || !dev->public.on)
@@ -996,7 +996,8 @@ int button;
}
}
else if (filter->keycode==keycode) {
- int button;
+ DeviceIntPtr dev;
+ int button;
filter->active= 0;
_XkbLookupButtonDevice(&dev, filter->upAction.devbtn.device,