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/XKBSetGeom.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/XKBSetGeom.c')
-rw-r--r-- | nx-X11/lib/X11/XKBSetGeom.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/nx-X11/lib/X11/XKBSetGeom.c b/nx-X11/lib/X11/XKBSetGeom.c index e5e524fa4..ee254e0dc 100644 --- a/nx-X11/lib/X11/XKBSetGeom.c +++ b/nx-X11/lib/X11/XKBSetGeom.c @@ -245,10 +245,10 @@ static char * _WriteGeomDoodads(char *wire, int num_doodads, XkbDoodadPtr doodad) { register int i; - xkbDoodadWireDesc *doodadWire; for (i = 0; i < num_doodads; i++, doodad++) { - doodadWire = (xkbDoodadWireDesc *) wire; + xkbDoodadWireDesc *doodadWire = (xkbDoodadWireDesc *) wire; + wire = (char *) &doodadWire[1]; bzero(doodadWire, SIZEOF(xkbDoodadWireDesc)); doodadWire->any.name = doodad->any.name; @@ -292,25 +292,22 @@ _WriteGeomOverlay(char *wire, XkbOverlayPtr ol) { register int r; XkbOverlayRowPtr row; - xkbOverlayWireDesc *olWire; + xkbOverlayWireDesc *olWire = (xkbOverlayWireDesc *) wire; - olWire = (xkbOverlayWireDesc *) wire; olWire->name = ol->name; olWire->nRows = ol->num_rows; wire = (char *) &olWire[1]; for (r = 0, row = ol->rows; r < ol->num_rows; r++, row++) { unsigned int k; XkbOverlayKeyPtr key; - xkbOverlayRowWireDesc *rowWire; + xkbOverlayRowWireDesc *rowWire = (xkbOverlayRowWireDesc *) wire; - rowWire = (xkbOverlayRowWireDesc *) wire; rowWire->rowUnder = row->row_under; rowWire->nKeys = row->num_keys; wire = (char *) &rowWire[1]; for (k = 0, key = row->keys; k < row->num_keys; k++, key++) { - xkbOverlayKeyWireDesc *keyWire; + xkbOverlayKeyWireDesc *keyWire = (xkbOverlayKeyWireDesc *) wire; - keyWire = (xkbOverlayKeyWireDesc *) wire; memcpy(keyWire->over, key->over.name, XkbKeyNameLength); memcpy(keyWire->under, key->under.name, XkbKeyNameLength); wire = (char *) &keyWire[1]; @@ -324,11 +321,11 @@ _WriteGeomSections(char *wire, XkbGeometryPtr geom) { register int i; XkbSectionPtr section; - xkbSectionWireDesc *sectionWire; for (i = 0, section = geom->sections; i < geom->num_sections; i++, section++) { - sectionWire = (xkbSectionWireDesc *) wire; + xkbSectionWireDesc *sectionWire = (xkbSectionWireDesc *) wire; + sectionWire->name = section->name; sectionWire->top = section->top; sectionWire->left = section->left; @@ -344,10 +341,10 @@ _WriteGeomSections(char *wire, XkbGeometryPtr geom) if (section->rows) { int r; XkbRowPtr row; - xkbRowWireDesc *rowWire; for (r = 0, row = section->rows; r < section->num_rows; r++, row++) { - rowWire = (xkbRowWireDesc *) wire; + xkbRowWireDesc *rowWire = (xkbRowWireDesc *) wire; + rowWire->top = row->top; rowWire->left = row->left; rowWire->nKeys = row->num_keys; @@ -357,9 +354,8 @@ _WriteGeomSections(char *wire, XkbGeometryPtr geom) if (row->keys) { int k; XkbKeyPtr key; - xkbKeyWireDesc *keyWire; + xkbKeyWireDesc *keyWire = (xkbKeyWireDesc *) wire; - keyWire = (xkbKeyWireDesc *) wire; for (k = 0, key = row->keys; k < row->num_keys; k++, key++) { memcpy(keyWire[k].name, key->name.name, XkbKeyNameLength); |