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 #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 #endif +#define XK_LATIN1 +#include + #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 */