[xorg-commit-diffs] xc/programs/Xserver/dix dixutils.c, 1.1.4.3, 1.1.4.3.2.1

Stuart Kreitman xorg-commit at pdx.freedesktop.org
Tue Mar 30 08:35:09 PST 2004


Committed by: stukreit

Update of /cvs/xorg/xc/programs/Xserver/dix
In directory pdx:/tmp/cvs-serv3428

Modified Files:
      Tag: DAMAGE-XFIXES
	dixutils.c 
Log Message:
First integration from modular tree
Modified Files:
  Tag: DAMAGE-XFIXES
 	dixutils.c 


Index: dixutils.c
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/dix/dixutils.c,v
retrieving revision 1.1.4.3
retrieving revision 1.1.4.3.2.1
diff -u -d -r1.1.4.3 -r1.1.4.3.2.1
--- a/dixutils.c	5 Mar 2004 13:39:57 -0000	1.1.4.3
+++ b/dixutils.c	30 Mar 2004 16:35:06 -0000	1.1.4.3.2.1
@@ -152,6 +152,21 @@
  * 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;
+}
+
 void
 CopyISOLatin1Lowered(dest, source, length)
     register unsigned char *dest, *source;
@@ -160,17 +175,27 @@
     register int i;
 
     for (i = 0; i < length; i++, source++, dest++)
+	*dest = ISOLatin1ToLower (*source);
+    *dest = '\0';
+}
+
+int
+CompareISOLatin1Lowered(unsigned char *s1, int s1len, 
+			unsigned char *s2, int s2len)
+{
+    unsigned char   c1, c2;
+    
+    for (;;) 
     {
-	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;
+	/* 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;
     }
-    *dest = '\0';
+    return (int) c1 - (int) c2;
 }
 
 #ifdef XCSECURITY
@@ -321,10 +346,11 @@
 
 
 int
-AlterSaveSetForClient(client, pWin, mode)
-    ClientPtr client;
-    WindowPtr pWin;
-    unsigned mode;
+AlterSaveSetForClient(ClientPtr client,
+		      WindowPtr pWin,
+		      unsigned mode,
+		      Bool  toRoot,
+		      Bool  remap)
 {
     int numnow;
     pointer *pTmp = NULL;
@@ -348,7 +374,9 @@
 	    return(BadAlloc);
 	client->saveSet = pTmp;
        	client->numSaved = numnow;
-	client->saveSet[numnow - 1] = (pointer)pWin;
+	SaveSetAssignWindow(client->saveSet[numnow - 1], pWin);
+	SaveSetAssignToRoot(client->saveSet[numnow - 1], toRoot);
+	SaveSetAssignRemap(client->saveSet[numnow - 1], remap);
 	return(Success);
     }
     else if ((mode == SetModeDelete) && (j < numnow))
@@ -388,7 +416,7 @@
     {    
 	client = clients[i];
 	if (client && client->numSaved)
-	    (void)AlterSaveSetForClient(client, pWin, SetModeDelete);
+	    (void)AlterSaveSetForClient(client, pWin, SetModeDelete, FALSE, TRUE);
     }
 }
 




More information about the xorg-commit-diffs mailing list