diff options
author | Ulrich Sibiller <uli42@gmx.de> | 2019-06-21 10:10:21 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2019-06-22 11:30:54 +0200 |
commit | 56dcc8a4b6a9ed3b7f55e0eeaeff9bc14737cdd5 (patch) | |
tree | 5778dd489ab277e7c9f99792ce7424d7096cd5c0 /nx-X11 | |
parent | c8520ac0aabb475d92ea6b60e3113f2999c04eb8 (diff) | |
download | nx-libs-56dcc8a4b6a9ed3b7f55e0eeaeff9bc14737cdd5.tar.gz nx-libs-56dcc8a4b6a9ed3b7f55e0eeaeff9bc14737cdd5.tar.bz2 nx-libs-56dcc8a4b6a9ed3b7f55e0eeaeff9bc14737cdd5.zip |
xkb: remove oldState from XkbHandleActions.
Fixes this cppcheck finding:
[nx-X11/programs/Xserver/xkb/xkbActions.c:1306]: (error) Uninitialized variable: oldState
commit 35a4b8e7f4526a92d44cb16a783f21030cd1f6df
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date: Tue May 5 16:51:59 2009 +1000
xkb: remove oldState from XkbHandleActions.
I really don't know what the purpose of this variable is or was, aside from
potentially clobbering up our key state since there's a path where it may be
used uninitialised.
Also, this means that xkbi->prev_state is now accessible from the DIX with
meaningful data.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'nx-X11')
-rw-r--r-- | nx-X11/programs/Xserver/xkb/xkbActions.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/nx-X11/programs/Xserver/xkb/xkbActions.c b/nx-X11/programs/Xserver/xkb/xkbActions.c index d2dda00f4..90bad93e0 100644 --- a/nx-X11/programs/Xserver/xkb/xkbActions.c +++ b/nx-X11/programs/Xserver/xkb/xkbActions.c @@ -1142,7 +1142,6 @@ XkbSrvInfoPtr xkbi; KeyClassPtr keyc; int changed,sendEvent; Bool genStateNotify; -XkbStateRec oldState; XkbAction act; XkbFilterPtr filter; Bool keyEvent; @@ -1157,7 +1156,7 @@ xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(dev); xkbi= keyc->xkbInfo; key= xE->u.u.detail; if ((xkbi->flags&_XkbStateNotifyInProgress)==0) { - oldState= xkbi->state; + xkbi->prev_state = xkbi->state; xkbi->flags|= _XkbStateNotifyInProgress; genStateNotify= True; } @@ -1303,11 +1302,10 @@ xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(dev); else if (keyEvent) FixKeyState(xE,dev); - xkbi->prev_state= oldState; XkbComputeDerivedState(xkbi); keyc->prev_state= keyc->state; keyc->state= XkbStateFieldFromRec(&xkbi->state); - changed = XkbStateChangedFlags(&oldState,&xkbi->state); + changed = XkbStateChangedFlags(&xkbi->prev_state,&xkbi->state); if (genStateNotify) { if (changed) { xkbStateNotify sn; |