xserver: Branch 'master' - 4 commits

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sun Jul 10 22:51:46 UTC 2022


 include/xkbsrv.h |    3 ---
 test/test_xkb.c  |    1 -
 xkb/ddxLoad.c    |    1 -
 xkb/xkb-procs.h  |    3 +++
 xkb/xkb.c        |   26 +++++++++++++-------------
 xkb/xkbActions.c |    1 -
 xkb/xkbEvents.c  |    1 -
 xkb/xkbInit.c    |    1 -
 xkb/xkbLEDs.c    |    1 -
 xkb/xkbSwap.c    |    2 +-
 xkb/xkbUtils.c   |    1 -
 xkb/xkbfmisc.c   |    1 -
 12 files changed, 17 insertions(+), 25 deletions(-)

New commits:
commit f1070c01d616c5f21f939d5ebc533738779451ac
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Tue Jul 5 12:40:47 2022 +1000

    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 <peter.hutterer at who-t.net>
    Reviewed-by: Olivier Fourdan <ofourdan at redhat.com>

diff --git a/xkb/xkb.c b/xkb/xkb.c
index a29262c24..64e52611e 100644
--- a/xkb/xkb.c
+++ b/xkb/xkb.c
@@ -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];
commit 6f234c60d9e931a36705d93a714a027e7ca55a84
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Mon Jul 4 15:49:31 2022 +1000

    xkb: whitespace fixes
    
    Sick of fighting vim and git from trying to add this fix with every
    commit iteration...
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Olivier Fourdan <ofourdan at redhat.com>

diff --git a/xkb/xkb.c b/xkb/xkb.c
index 21c046913..a29262c24 100644
--- a/xkb/xkb.c
+++ b/xkb/xkb.c
@@ -2433,7 +2433,7 @@ _XkbSetMapCheckLength(xkbSetMapReq *req)
     }
     /* actions */
     if (req->present & XkbKeyActionsMask) {
-        _add_check_len(req->totalActs * sz_xkbActionWireDesc 
+        _add_check_len(req->totalActs * sz_xkbActionWireDesc
                        + XkbPaddedSize(req->nKeyActs));
     }
     /* behaviours */
@@ -6774,7 +6774,7 @@ _XkbSetDeviceInfoCheck(ClientPtr client, DeviceIntPtr dev,
     ed.deviceID = dev->id;
     wire = (char *) &stuff[1];
     if (stuff->change & XkbXI_ButtonActionsMask) {
-	int nBtns, sz, i;
+        int nBtns, sz, i;
         XkbAction *acts;
         DeviceIntPtr kbd;
 
commit a2762514b66e8869ce93fa7dc2a1d0faaebd9272
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Mon Jul 4 09:42:53 2022 +1000

    xkb: rename xkb.h to xkb-procs.h
    
    This header merely defines the various protocol request handlers, so
    let's rename it to something less generic and remove its include from
    all the files that don't actually need it (which is almost all of them).
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Olivier Fourdan <ofourdan at redhat.com>

diff --git a/test/test_xkb.c b/test/test_xkb.c
index f81a7ed65..a13107390 100644
--- a/test/test_xkb.c
+++ b/test/test_xkb.c
@@ -48,7 +48,6 @@
 #include "../xkb/xkbgeom.h"
 #include <X11/extensions/XKMformat.h>
 #include "xkbfile.h"
-#include "../xkb/xkb.h"
 #include <assert.h>
 
 #include "tests-common.h"
diff --git a/xkb/ddxLoad.c b/xkb/ddxLoad.c
index f9b7b06d9..2d203ce11 100644
--- a/xkb/ddxLoad.c
+++ b/xkb/ddxLoad.c
@@ -43,7 +43,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #define	XKBSRV_NEED_FILE_FUNCS
 #include <xkbsrv.h>
 #include <X11/extensions/XI.h>
-#include "xkb.h"
 
 #define	PRE_ERROR_MSG "\"The XKEYBOARD keymap compiler (xkbcomp) reports:\""
 #define	ERROR_PREFIX	"\"> \""
diff --git a/xkb/xkb.h b/xkb/xkb-procs.h
similarity index 100%
rename from xkb/xkb.h
rename to xkb/xkb-procs.h
diff --git a/xkb/xkb.c b/xkb/xkb.c
index 820cd7166..21c046913 100644
--- a/xkb/xkb.c
+++ b/xkb/xkb.c
@@ -38,7 +38,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #include "extnsionst.h"
 #include "extinit.h"
 #include "xace.h"
-#include "xkb.h"
+#include "xkb-procs.h"
 #include "protocol-versions.h"
 
 #include <X11/extensions/XI.h>
diff --git a/xkb/xkbActions.c b/xkb/xkbActions.c
index db29091e7..5e9a6b6d6 100644
--- a/xkb/xkbActions.c
+++ b/xkb/xkbActions.c
@@ -38,7 +38,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #include "exevents.h"
 #include "eventstr.h"
 #include <xkbsrv.h>
-#include "xkb.h"
 #include <ctype.h>
 #include "mi.h"
 #include "mipointer.h"
diff --git a/xkb/xkbEvents.c b/xkb/xkbEvents.c
index 0bbd66186..f8f65d4a7 100644
--- a/xkb/xkbEvents.c
+++ b/xkb/xkbEvents.c
@@ -39,7 +39,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #include "exglobals.h"
 #include "windowstr.h"
 #include <xkbsrv.h>
-#include "xkb.h"
 
 /***====================================================================***/
 
diff --git a/xkb/xkbInit.c b/xkb/xkbInit.c
index 4108e1b26..de1dd3fe3 100644
--- a/xkb/xkbInit.c
+++ b/xkb/xkbInit.c
@@ -49,7 +49,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #include "xkbgeom.h"
 #include <X11/extensions/XKMformat.h>
 #include "xkbfile.h"
-#include "xkb.h"
 
 #define	CREATE_ATOM(s)	MakeAtom(s,sizeof(s)-1,1)
 
diff --git a/xkb/xkbLEDs.c b/xkb/xkbLEDs.c
index 5792d9fb7..d4690dad9 100644
--- a/xkb/xkbLEDs.c
+++ b/xkb/xkbLEDs.c
@@ -38,7 +38,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
 #include <X11/extensions/XI.h>
 #include <xkbsrv.h>
-#include "xkb.h"
 
 /***====================================================================***/
 
diff --git a/xkb/xkbSwap.c b/xkb/xkbSwap.c
index 50cabb90e..efbdb81c1 100644
--- a/xkb/xkbSwap.c
+++ b/xkb/xkbSwap.c
@@ -36,7 +36,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #include <xkbsrv.h>
 #include "xkbstr.h"
 #include "extnsionst.h"
-#include "xkb.h"
+#include "xkb-procs.h"
 
         /*
          * REQUEST SWAPPING
diff --git a/xkb/xkbUtils.c b/xkb/xkbUtils.c
index 8975ade8d..dd089c204 100644
--- a/xkb/xkbUtils.c
+++ b/xkb/xkbUtils.c
@@ -67,7 +67,6 @@ DEALINGS IN THE SOFTWARE.
 #define	XKBSRV_NEED_FILE_FUNCS
 #include <xkbsrv.h>
 #include "xkbgeom.h"
-#include "xkb.h"
 
 /***====================================================================***/
 
diff --git a/xkb/xkbfmisc.c b/xkb/xkbfmisc.c
index 2ecdcd555..fc9197f2d 100644
--- a/xkb/xkbfmisc.c
+++ b/xkb/xkbfmisc.c
@@ -46,7 +46,6 @@
 #define XKBSRV_NEED_FILE_FUNCS	1
 #include <xkbsrv.h>
 #include "xkbgeom.h"
-#include "xkb.h"
 
 unsigned
 _XkbKSCheckCase(KeySym ks)
commit d9dd300b8dcc250d9f2bc93cab664daf83975752
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Tue Jul 5 10:07:54 2022 +1000

    xkb: move the SProcXkbDispatch declaration
    
    Let's move this to where all the other protocol handlers are.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Olivier Fourdan <ofourdan at redhat.com>

diff --git a/include/xkbsrv.h b/include/xkbsrv.h
index fbb5427e1..5b4f71f76 100644
--- a/include/xkbsrv.h
+++ b/include/xkbsrv.h
@@ -779,9 +779,6 @@ extern _X_EXPORT void XkbDeleteRulesDflts(void
 extern _X_EXPORT void XkbDeleteRulesUsed(void
     );
 
-extern _X_EXPORT int SProcXkbDispatch(ClientPtr /* client */
-    );
-
 extern _X_EXPORT XkbGeometryPtr XkbLookupNamedGeometry(DeviceIntPtr /* dev */ ,
                                                        Atom /* name */ ,
                                                        Bool *   /* shouldFree */
diff --git a/xkb/xkb.h b/xkb/xkb.h
index f3a60af6b..d0ae8309a 100644
--- a/xkb/xkb.h
+++ b/xkb/xkb.h
@@ -27,4 +27,7 @@ extern int ProcXkbGetKbdByName(ClientPtr client);
 extern int ProcXkbGetDeviceInfo(ClientPtr client);
 extern int ProcXkbSetDeviceInfo(ClientPtr client);
 extern int ProcXkbSetDebuggingFlags(ClientPtr client);
+
+extern int SProcXkbDispatch(ClientPtr client);
+
 #endif


More information about the xorg-commit mailing list