xserver: Branch 'master'

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Apr 15 23:40:31 UTC 2024


 dix/dixutils.c  |   43 -------------------------------------------
 include/dix.h   |    5 -----
 render/filter.c |   44 ++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 44 insertions(+), 48 deletions(-)

New commits:
commit ad7e7d9259a8561393280a9a3005bfbabff6e9a9
Author: Enrico Weigelt, metux IT consult <info at metux.net>
Date:   Thu Mar 7 14:20:05 2024 +0100

    dix: unexport CompareISOLatin1Lowered() and make it static
    
    This function isn't used by any drivers, so no need to export it.
    
    Also has just one consumer, so move it there and make it static.
    (and also move ISOLatin1ToLower() along with it)
    
    Signed-off-by: Enrico Weigelt, metux IT consult <info at metux.net>
    Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1374>

diff --git a/dix/dixutils.c b/dix/dixutils.c
index d1edc11c6..28f017fc2 100644
--- a/dix/dixutils.c
+++ b/dix/dixutils.c
@@ -96,8 +96,6 @@ Author:  Adobe Systems Incorporated
 #include "pixmapstr.h"
 #include "gcstruct.h"
 #include "scrnintstr.h"
-#define  XK_LATIN1
-#include <X11/keysymdef.h>
 #include "xace.h"
 
 /*
@@ -144,47 +142,6 @@ ClientTimeToServerTime(CARD32 c)
     return ts;
 }
 
-/*
- * ISO Latin-1 case conversion routine
- *
- * this routine always null-terminates the result, so
- * beware of too-small buffers
- */
-
-static unsigned char
-ISOLatin1ToLower(unsigned char source)
-{
-    unsigned char dest;
-
-    if ((source >= XK_A) && (source <= XK_Z))
-        dest = source + (XK_a - XK_A);
-    else if ((source >= XK_Agrave) && (source <= XK_Odiaeresis))
-        dest = source + (XK_agrave - XK_Agrave);
-    else if ((source >= XK_Ooblique) && (source <= XK_Thorn))
-        dest = source + (XK_oslash - XK_Ooblique);
-    else
-        dest = source;
-    return dest;
-}
-
-int
-CompareISOLatin1Lowered(const unsigned char *s1, int s1len,
-                        const unsigned char *s2, int s2len)
-{
-    unsigned char c1, c2;
-
-    for (;;) {
-        /* note -- compare against zero so that -1 ignores len */
-        c1 = s1len-- ? *s1++ : '\0';
-        c2 = s2len-- ? *s2++ : '\0';
-        if (!c1 ||
-            (c1 != c2 &&
-             (c1 = ISOLatin1ToLower(c1)) != (c2 = ISOLatin1ToLower(c2))))
-            break;
-    }
-    return (int) c1 - (int) c2;
-}
-
 /*
  * dixLookupWindow and dixLookupDrawable:
  * Look up the window/drawable taking into account the client doing the
diff --git a/include/dix.h b/include/dix.h
index 8f0336d4c..8a7ecd345 100644
--- a/include/dix.h
+++ b/include/dix.h
@@ -185,11 +185,6 @@ extern _X_HIDDEN Bool CreateConnectionBlock(void);
 
 /* dixutils.c */
 
-extern _X_EXPORT int CompareISOLatin1Lowered(const unsigned char * /*a */ ,
-                                             int alen,
-                                             const unsigned char * /*b */ ,
-                                             int blen);
-
 extern _X_EXPORT int dixLookupWindow(WindowPtr *result,
                                      XID id,
                                      ClientPtr client, Mask access_mode);
diff --git a/render/filter.c b/render/filter.c
index 2741f406c..44f6b6465 100644
--- a/render/filter.c
+++ b/render/filter.c
@@ -24,6 +24,9 @@
 #include <dix-config.h>
 #endif
 
+#define  XK_LATIN1
+#include <X11/keysymdef.h>
+
 #include "misc.h"
 #include "scrnintstr.h"
 #include "os.h"
@@ -42,6 +45,47 @@
 static char **filterNames;
 static int nfilterNames;
 
+/*
+ * ISO Latin-1 case conversion routine
+ *
+ * this routine always null-terminates the result, so
+ * beware of too-small buffers
+ */
+
+static unsigned char
+ISOLatin1ToLower(unsigned char source)
+{
+    unsigned char dest;
+
+    if ((source >= XK_A) && (source <= XK_Z))
+        dest = source + (XK_a - XK_A);
+    else if ((source >= XK_Agrave) && (source <= XK_Odiaeresis))
+        dest = source + (XK_agrave - XK_Agrave);
+    else if ((source >= XK_Ooblique) && (source <= XK_Thorn))
+        dest = source + (XK_oslash - XK_Ooblique);
+    else
+        dest = source;
+    return dest;
+}
+
+static int
+CompareISOLatin1Lowered(const unsigned char *s1, int s1len,
+                        const unsigned char *s2, int s2len)
+{
+    unsigned char c1, c2;
+
+    for (;;) {
+        /* note -- compare against zero so that -1 ignores len */
+        c1 = s1len-- ? *s1++ : '\0';
+        c2 = s2len-- ? *s2++ : '\0';
+        if (!c1 ||
+            (c1 != c2 &&
+             (c1 = ISOLatin1ToLower(c1)) != (c2 = ISOLatin1ToLower(c2))))
+            break;
+    }
+    return (int) c1 - (int) c2;
+}
+
 /*
  * standard but not required filters don't have constant indices
  */


More information about the xorg-commit mailing list