From 2824899d280f2b169b3e745b222f9a981c1ce5f7 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Fri, 16 Aug 2013 18:27:28 -0700 Subject: 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 Backported-to-NX-by: Ulrich Sibiller --- nx-X11/lib/X11/XKBExtDev.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'nx-X11/lib/X11/XKBExtDev.c') 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; } -- cgit v1.2.3