aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/lib/X11/XKBUse.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2013-08-16 18:27:28 -0700
committerUlrich Sibiller <uli42@gmx.de>2016-10-19 21:40:28 +0200
commit2824899d280f2b169b3e745b222f9a981c1ce5f7 (patch)
treeb36bb27f59fc802561e78aa344755808b71a0279 /nx-X11/lib/X11/XKBUse.c
parent3c5880e7254dcd04ea8e54d53ec99880e2dfdc27 (diff)
downloadnx-libs-2824899d280f2b169b3e745b222f9a981c1ce5f7.tar.gz
nx-libs-2824899d280f2b169b3e745b222f9a981c1ce5f7.tar.bz2
nx-libs-2824899d280f2b169b3e745b222f9a981c1ce5f7.zip
Rearrange some variable declarations & initializations in XKB
Little things noticed during XKB restyling that seemed to make the code easier to read. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Backported-to-NX-by: Ulrich Sibiller <uli42@gmx.de>
Diffstat (limited to 'nx-X11/lib/X11/XKBUse.c')
-rw-r--r--nx-X11/lib/X11/XKBUse.c37
1 files changed, 13 insertions, 24 deletions
diff --git a/nx-X11/lib/X11/XKBUse.c b/nx-X11/lib/X11/XKBUse.c
index 0af4679d3..cf6497551 100644
--- a/nx-X11/lib/X11/XKBUse.c
+++ b/nx-X11/lib/X11/XKBUse.c
@@ -263,9 +263,8 @@ wire_to_event(Display *dpy, XEvent *re, xEvent *event)
if ((xkbi->selected_events & XkbMapNotifyMask) &&
(xkbi->selected_map_details & mn->changed)) {
- XkbMapNotifyEvent *mev;
+ XkbMapNotifyEvent *mev = (XkbMapNotifyEvent *) re;
- mev = (XkbMapNotifyEvent *) re;
mev->type = XkbEventCode + xkbi->codes->first_event;
mev->xkb_type = XkbMapNotify;
mev->serial = _XSetLastRequestRead(dpy, (xGenericReply *) event);
@@ -318,9 +317,8 @@ wire_to_event(Display *dpy, XEvent *re, xEvent *event)
{
if (xkbi->selected_events & XkbControlsNotifyMask) {
xkbControlsNotify *cn = (xkbControlsNotify *) event;
- XkbControlsNotifyEvent *cev;
+ XkbControlsNotifyEvent *cev = (XkbControlsNotifyEvent *) re;
- cev = (XkbControlsNotifyEvent *) re;
cev->type = XkbEventCode + xkbi->codes->first_event;
cev->xkb_type = XkbControlsNotify;
cev->serial = _XSetLastRequestRead(dpy, (xGenericReply *) event);
@@ -344,9 +342,8 @@ wire_to_event(Display *dpy, XEvent *re, xEvent *event)
{
if (xkbi->selected_events & XkbIndicatorMapNotifyMask) {
xkbIndicatorNotify *in = (xkbIndicatorNotify *) event;
- XkbIndicatorNotifyEvent *iev;
+ XkbIndicatorNotifyEvent *iev = (XkbIndicatorNotifyEvent *) re;
- iev = (XkbIndicatorNotifyEvent *) re;
iev->type = XkbEventCode + xkbi->codes->first_event;
iev->xkb_type = XkbIndicatorMapNotify;
iev->serial = _XSetLastRequestRead(dpy, (xGenericReply *) event);
@@ -364,9 +361,8 @@ wire_to_event(Display *dpy, XEvent *re, xEvent *event)
{
if (xkbi->selected_events & XkbIndicatorStateNotifyMask) {
xkbIndicatorNotify *in = (xkbIndicatorNotify *) event;
- XkbIndicatorNotifyEvent *iev;
+ XkbIndicatorNotifyEvent *iev = (XkbIndicatorNotifyEvent *) re;
- iev = (XkbIndicatorNotifyEvent *) re;
iev->type = XkbEventCode + xkbi->codes->first_event;
iev->xkb_type = XkbIndicatorStateNotify;
iev->serial = _XSetLastRequestRead(dpy, (xGenericReply *) event);
@@ -384,9 +380,8 @@ wire_to_event(Display *dpy, XEvent *re, xEvent *event)
{
if (xkbi->selected_events & XkbBellNotifyMask) {
xkbBellNotify *bn = (xkbBellNotify *) event;
- XkbBellNotifyEvent *bev;
+ XkbBellNotifyEvent *bev = (XkbBellNotifyEvent *) re;
- bev = (XkbBellNotifyEvent *) re;
bev->type = XkbEventCode + xkbi->codes->first_event;
bev->xkb_type = XkbBellNotify;
bev->serial = _XSetLastRequestRead(dpy, (xGenericReply *) event);
@@ -410,9 +405,8 @@ wire_to_event(Display *dpy, XEvent *re, xEvent *event)
{
if (xkbi->selected_events & XkbAccessXNotifyMask) {
xkbAccessXNotify *axn = (xkbAccessXNotify *) event;
- XkbAccessXNotifyEvent *axev;
+ XkbAccessXNotifyEvent *axev = (XkbAccessXNotifyEvent *) re;
- axev = (XkbAccessXNotifyEvent *) re;
axev->type = XkbEventCode + xkbi->codes->first_event;
axev->xkb_type = XkbAccessXNotify;
axev->serial = _XSetLastRequestRead(dpy, (xGenericReply *) event);
@@ -432,9 +426,8 @@ wire_to_event(Display *dpy, XEvent *re, xEvent *event)
{
if (xkbi->selected_events & XkbNamesNotifyMask) {
xkbNamesNotify *nn = (xkbNamesNotify *) event;
- XkbNamesNotifyEvent *nev;
+ XkbNamesNotifyEvent *nev = (XkbNamesNotifyEvent *) re;
- nev = (XkbNamesNotifyEvent *) re;
nev->type = XkbEventCode + xkbi->codes->first_event;
nev->xkb_type = XkbNamesNotify;
nev->serial = _XSetLastRequestRead(dpy, (xGenericReply *) event);
@@ -462,9 +455,8 @@ wire_to_event(Display *dpy, XEvent *re, xEvent *event)
{
if (xkbi->selected_events & XkbCompatMapNotifyMask) {
xkbCompatMapNotify *cmn = (xkbCompatMapNotify *) event;
- XkbCompatMapNotifyEvent *cmev;
+ XkbCompatMapNotifyEvent *cmev = (XkbCompatMapNotifyEvent *) re;
- cmev = (XkbCompatMapNotifyEvent *) re;
cmev->type = XkbEventCode + xkbi->codes->first_event;
cmev->xkb_type = XkbCompatMapNotify;
cmev->serial = _XSetLastRequestRead(dpy, (xGenericReply *) event);
@@ -484,9 +476,8 @@ wire_to_event(Display *dpy, XEvent *re, xEvent *event)
{
if (xkbi->selected_events & XkbActionMessageMask) {
xkbActionMessage *am = (xkbActionMessage *) event;
- XkbActionMessageEvent *amev;
+ XkbActionMessageEvent *amev = (XkbActionMessageEvent *) re;
- amev = (XkbActionMessageEvent *) re;
amev->type = XkbEventCode + xkbi->codes->first_event;
amev->xkb_type = XkbActionMessage;
amev->serial = _XSetLastRequestRead(dpy, (xGenericReply *) event);
@@ -509,9 +500,9 @@ wire_to_event(Display *dpy, XEvent *re, xEvent *event)
{
if (xkbi->selected_events & XkbExtensionDeviceNotifyMask) {
xkbExtensionDeviceNotify *ed = (xkbExtensionDeviceNotify *) event;
- XkbExtensionDeviceNotifyEvent *edev;
+ XkbExtensionDeviceNotifyEvent *edev
+ = (XkbExtensionDeviceNotifyEvent *) re;
- edev = (XkbExtensionDeviceNotifyEvent *) re;
edev->type = XkbEventCode + xkbi->codes->first_event;
edev->xkb_type = XkbExtensionDeviceNotify;
edev->serial = _XSetLastRequestRead(dpy, (xGenericReply *) event);
@@ -538,9 +529,8 @@ wire_to_event(Display *dpy, XEvent *re, xEvent *event)
if ((xkbi->selected_events & XkbNewKeyboardNotifyMask) &&
(xkbi->selected_nkn_details & nkn->changed)) {
- XkbNewKeyboardNotifyEvent *nkev;
+ XkbNewKeyboardNotifyEvent *nkev = (XkbNewKeyboardNotifyEvent *) re;
- nkev = (XkbNewKeyboardNotifyEvent *) re;
nkev->type = XkbEventCode + xkbi->codes->first_event;
nkev->xkb_type = XkbNewKeyboardNotify;
nkev->serial = _XSetLastRequestRead(dpy, (xGenericReply *) event);
@@ -763,9 +753,8 @@ XkbUseExtension(Display *dpy, int *major_rtrn, int *minor_rtrn)
req->wantedMajor = XkbMajorVersion;
req->wantedMinor = XkbMinorVersion;
if (!_XReply(dpy, (xReply *) &rep, 0, xFalse) || !rep.supported) {
- Bool fail;
+ Bool fail = True;
- fail = True;
if (debugMsg)
fprintf(stderr,
"XKEYBOARD version mismatch (want %d.%02d, got %d.%02d)\n",