Commit de1e70e6 authored by Peter Hutterer's avatar Peter Hutterer
Browse files

xkb: switch to array index loops to moving pointers



Most similar loops here use a pointer that advances with each loop
iteration, let's do the same here for consistency.

No functional changes.

Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Olivier Fourdan's avatarOlivier Fourdan <ofourdan@redhat.com>
parent 3d7d6a22
Pipeline #629828 passed with stages
in 1 minute and 27 seconds
......@@ -5368,16 +5368,16 @@ _CheckSetSections(XkbGeometryPtr geom,
row->left = rWire->left;
row->vertical = rWire->vertical;
kWire = (xkbKeyWireDesc *) &rWire[1];
for (k = 0; k < rWire->nKeys; k++) {
for (k = 0; k < rWire->nKeys; k++, kWire++) {
XkbKeyPtr key;
key = XkbAddGeomKey(row);
if (!key)
return BadAlloc;
memcpy(key->name.name, kWire[k].name, XkbKeyNameLength);
key->gap = kWire[k].gap;
key->shape_ndx = kWire[k].shapeNdx;
key->color_ndx = kWire[k].colorNdx;
memcpy(key->name.name, kWire->name, XkbKeyNameLength);
key->gap = kWire->gap;
key->shape_ndx = kWire->shapeNdx;
key->color_ndx = kWire->colorNdx;
if (key->shape_ndx >= geom->num_shapes) {
client->errorValue = _XkbErrCode3(0x10, key->shape_ndx,
geom->num_shapes);
......@@ -5389,7 +5389,7 @@ _CheckSetSections(XkbGeometryPtr geom,
return BadMatch;
}
}
rWire = (xkbRowWireDesc *) &kWire[rWire->nKeys];
rWire = (xkbRowWireDesc *)kWire;
}
wire = (char *) rWire;
if (sWire->nDoodads > 0) {
......@@ -5454,16 +5454,16 @@ _CheckSetShapes(XkbGeometryPtr geom,
return BadAlloc;
ol->corner_radius = olWire->cornerRadius;
ptWire = (xkbPointWireDesc *) &olWire[1];
for (p = 0, pt = ol->points; p < olWire->nPoints; p++, pt++) {
pt->x = ptWire[p].x;
pt->y = ptWire[p].y;
for (p = 0, pt = ol->points; p < olWire->nPoints; p++, pt++, ptWire++) {
pt->x = ptWire->x;
pt->y = ptWire->y;
if (client->swapped) {
swaps(&pt->x);
swaps(&pt->y);
}
}
ol->num_points = olWire->nPoints;
olWire = (xkbOutlineWireDesc *) (&ptWire[olWire->nPoints]);
olWire = (xkbOutlineWireDesc *)ptWire;
}
if (shapeWire->primaryNdx != XkbNoShape)
shape->primary = &shape->outlines[shapeWire->primaryNdx];
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment