diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-08-16 18:27:28 -0700 |
---|---|---|
committer | Ulrich Sibiller <uli42@gmx.de> | 2016-10-19 21:40:28 +0200 |
commit | 2824899d280f2b169b3e745b222f9a981c1ce5f7 (patch) | |
tree | b36bb27f59fc802561e78aa344755808b71a0279 /nx-X11/lib/X11/XKBExtDev.c | |
parent | 3c5880e7254dcd04ea8e54d53ec99880e2dfdc27 (diff) | |
download | nx-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/XKBExtDev.c')
-rw-r--r-- | nx-X11/lib/X11/XKBExtDev.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/nx-X11/lib/X11/XKBExtDev.c b/nx-X11/lib/X11/XKBExtDev.c index 37847dcfd..25c76ab11 100644 --- a/nx-X11/lib/X11/XKBExtDev.c +++ b/nx-X11/lib/X11/XKBExtDev.c @@ -68,9 +68,8 @@ XkbNoteDeviceChanges(XkbDeviceChangesPtr old, XkbDeviceLedChangesPtr this; if (old->changed & XkbXI_IndicatorsMask) { - XkbDeviceLedChangesPtr found; + XkbDeviceLedChangesPtr found = NULL; - found = NULL; for (this = &old->leds; this && (!found); this = this->next) { if ((this->led_class == new->led_class) && (this->led_id == new->led_id)) { @@ -607,9 +606,8 @@ _XkbWriteLedInfo(char *wire, unsigned changed, XkbDeviceLedInfoPtr devli) lwire->state = devli->state; wire = (char *) &lwire[1]; if (namesNeeded) { - CARD32 *awire; + CARD32 *awire = (CARD32 *) wire; - awire = (CARD32 *) wire; for (i = 0, bit = 1; i < XkbNumIndicators; i++, bit <<= 1) { if (namesNeeded & bit) { *awire = (CARD32) devli->names[i]; @@ -619,14 +617,12 @@ _XkbWriteLedInfo(char *wire, unsigned changed, XkbDeviceLedInfoPtr devli) wire = (char *) awire; } if (mapsNeeded) { - xkbIndicatorMapWireDesc *mwire; + xkbIndicatorMapWireDesc *mwire = (xkbIndicatorMapWireDesc *) wire; - mwire = (xkbIndicatorMapWireDesc *) wire; for (i = 0, bit = 1; i < XkbNumIndicators; i++, bit <<= 1) { if (mapsNeeded & bit) { - XkbIndicatorMapPtr map; + XkbIndicatorMapPtr map = &devli->maps[i]; - map = &devli->maps[i]; mwire->flags = map->flags; mwire->whichGroups = map->which_groups; mwire->groups = map->groups; @@ -650,13 +646,11 @@ _XkbWriteSetDeviceInfo(char *wire, SetLedStuff *stuff, XkbDeviceInfoPtr devi) { - char *start; + char *start = wire; - start = wire; if (changes->changed & XkbXI_ButtonActionsMask) { - int size; + int size = changes->num_btns * SIZEOF(xkbActionWireDesc); - size = changes->num_btns * SIZEOF(xkbActionWireDesc); memcpy(wire, (char *) &devi->btn_acts[changes->first_btn], size); wire += size; } |