|
|
a04e0a |
From c9b379ec5a1a34692af06056925bd0fc5f809713 Mon Sep 17 00:00:00 2001
|
|
|
a04e0a |
From: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
a04e0a |
Date: Tue, 5 Jul 2022 12:40:47 +1000
|
|
|
a04e0a |
Subject: [PATCH xserver 1/3] xkb: switch to array index loops to moving
|
|
|
a04e0a |
pointers
|
|
|
a04e0a |
|
|
|
a04e0a |
Most similar loops here use a pointer that advances with each loop
|
|
|
a04e0a |
iteration, let's do the same here for consistency.
|
|
|
a04e0a |
|
|
|
a04e0a |
No functional changes.
|
|
|
a04e0a |
|
|
|
a04e0a |
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
a04e0a |
Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
|
|
|
a04e0a |
(cherry picked from commit f1070c01d616c5f21f939d5ebc533738779451ac)
|
|
|
a04e0a |
---
|
|
|
a04e0a |
xkb/xkb.c | 20 ++++++++++----------
|
|
|
a04e0a |
1 file changed, 10 insertions(+), 10 deletions(-)
|
|
|
a04e0a |
|
|
|
a04e0a |
diff --git a/xkb/xkb.c b/xkb/xkb.c
|
|
|
a04e0a |
index d056c698c..684394d77 100644
|
|
|
a04e0a |
--- a/xkb/xkb.c
|
|
|
a04e0a |
+++ b/xkb/xkb.c
|
|
|
a04e0a |
@@ -5372,16 +5372,16 @@ _CheckSetSections(XkbGeometryPtr geom,
|
|
|
a04e0a |
row->left = rWire->left;
|
|
|
a04e0a |
row->vertical = rWire->vertical;
|
|
|
a04e0a |
kWire = (xkbKeyWireDesc *) &rWire[1];
|
|
|
a04e0a |
- for (k = 0; k < rWire->nKeys; k++) {
|
|
|
a04e0a |
+ for (k = 0; k < rWire->nKeys; k++, kWire++) {
|
|
|
a04e0a |
XkbKeyPtr key;
|
|
|
a04e0a |
|
|
|
a04e0a |
key = XkbAddGeomKey(row);
|
|
|
a04e0a |
if (!key)
|
|
|
a04e0a |
return BadAlloc;
|
|
|
a04e0a |
- memcpy(key->name.name, kWire[k].name, XkbKeyNameLength);
|
|
|
a04e0a |
- key->gap = kWire[k].gap;
|
|
|
a04e0a |
- key->shape_ndx = kWire[k].shapeNdx;
|
|
|
a04e0a |
- key->color_ndx = kWire[k].colorNdx;
|
|
|
a04e0a |
+ memcpy(key->name.name, kWire->name, XkbKeyNameLength);
|
|
|
a04e0a |
+ key->gap = kWire->gap;
|
|
|
a04e0a |
+ key->shape_ndx = kWire->shapeNdx;
|
|
|
a04e0a |
+ key->color_ndx = kWire->colorNdx;
|
|
|
a04e0a |
if (key->shape_ndx >= geom->num_shapes) {
|
|
|
a04e0a |
client->errorValue = _XkbErrCode3(0x10, key->shape_ndx,
|
|
|
a04e0a |
geom->num_shapes);
|
|
|
a04e0a |
@@ -5393,7 +5393,7 @@ _CheckSetSections(XkbGeometryPtr geom,
|
|
|
a04e0a |
return BadMatch;
|
|
|
a04e0a |
}
|
|
|
a04e0a |
}
|
|
|
a04e0a |
- rWire = (xkbRowWireDesc *) &kWire[rWire->nKeys];
|
|
|
a04e0a |
+ rWire = (xkbRowWireDesc *)kWire;
|
|
|
a04e0a |
}
|
|
|
a04e0a |
wire = (char *) rWire;
|
|
|
a04e0a |
if (sWire->nDoodads > 0) {
|
|
|
a04e0a |
@@ -5458,16 +5458,16 @@ _CheckSetShapes(XkbGeometryPtr geom,
|
|
|
a04e0a |
return BadAlloc;
|
|
|
a04e0a |
ol->corner_radius = olWire->cornerRadius;
|
|
|
a04e0a |
ptWire = (xkbPointWireDesc *) &olWire[1];
|
|
|
a04e0a |
- for (p = 0, pt = ol->points; p < olWire->nPoints; p++, pt++) {
|
|
|
a04e0a |
- pt->x = ptWire[p].x;
|
|
|
a04e0a |
- pt->y = ptWire[p].y;
|
|
|
a04e0a |
+ for (p = 0, pt = ol->points; p < olWire->nPoints; p++, pt++, ptWire++) {
|
|
|
a04e0a |
+ pt->x = ptWire->x;
|
|
|
a04e0a |
+ pt->y = ptWire->y;
|
|
|
a04e0a |
if (client->swapped) {
|
|
|
a04e0a |
swaps(&pt->x);
|
|
|
a04e0a |
swaps(&pt->y);
|
|
|
a04e0a |
}
|
|
|
a04e0a |
}
|
|
|
a04e0a |
ol->num_points = olWire->nPoints;
|
|
|
a04e0a |
- olWire = (xkbOutlineWireDesc *) (&ptWire[olWire->nPoints]);
|
|
|
a04e0a |
+ olWire = (xkbOutlineWireDesc *)ptWire;
|
|
|
a04e0a |
}
|
|
|
a04e0a |
if (shapeWire->primaryNdx != XkbNoShape)
|
|
|
a04e0a |
shape->primary = &shape->outlines[shapeWire->primaryNdx];
|
|
|
a04e0a |
--
|
|
|
a04e0a |
2.36.1
|
|
|
a04e0a |
|