[Commit] fontconfig/src fccfg.c,1.33,1.34 fccharset.c,1.22,1.23

Keith Packard commit@keithp.com
Thu, 24 Apr 2003 08:29:35 -0700


Committed by: keithp

Update of /local/src/CVS/fontconfig/src
In directory home.keithp.com:/tmp/cvs-serv2721

Modified Files:
	fccfg.c fccharset.c 
Log Message:
FcFontList broken when presented a charset - was comparing inclusion in the wrong direction


Index: fccfg.c
===================================================================
RCS file: /local/src/CVS/fontconfig/src/fccfg.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- fccfg.c	22 Apr 2003 06:27:27 -0000	1.33
+++ fccfg.c	24 Apr 2003 15:29:33 -0000	1.34
@@ -578,12 +578,12 @@
 	case FcTypeCharSet:
 	    switch (op) {
 	    case FcOpContains:
-		/* m contains v if v is a subset of m */
-		ret = FcCharSetIsSubset (v.u.c, m.u.c);
+		/* v contains m if m is a subset of v */
+		ret = FcCharSetIsSubset (m.u.c, v.u.c);
 		break;
 	    case FcOpNotContains:
-		/* m contains v if v is a subset of m */
-		ret = !FcCharSetIsSubset (v.u.c, m.u.c);
+		/* v contains m if m is a subset of v */
+		ret = !FcCharSetIsSubset (m.u.c, v.u.c);
 		break;
 	    case FcOpEqual:
 		ret = FcCharSetEqual (m.u.c, v.u.c);

Index: fccharset.c
===================================================================
RCS file: /local/src/CVS/fontconfig/src/fccharset.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- fccharset.c	18 Mar 2003 08:03:42 -0000	1.22
+++ fccharset.c	24 Apr 2003 15:29:33 -0000	1.23
@@ -596,6 +596,9 @@
     {
 	an = a->numbers[ai];
 	bn = b->numbers[bi];
+	/*
+	 * Check matching pages
+	 */
 	if (an == bn)
 	{
 	    FcChar32	*am = a->leaves[ai]->map;
@@ -604,6 +607,9 @@
 	    if (am != bm)
 	    {
 		int	i = 256/32;
+		/*
+		 * Does am have any bits not in bm?
+		 */
 		while (i--)
 		    if (*am++ & ~*bm++)
 			return FcFalse;
@@ -611,6 +617,9 @@
 	    ai++;
 	    bi++;
 	}
+	/*
+	 * Does a have any pages not in b?
+	 */
 	else if (an < bn)
 	    return FcFalse;
 	else
@@ -618,6 +627,9 @@
 	    int	    low = bi + 1;
 	    int	    high = b->num - 1;
 
+	    /*
+	     * Search for page 'an' in 'b'
+	     */
 	    while (low <= high)
 	    {
 		int mid = (low + high) >> 1;
@@ -637,6 +649,9 @@
 		bi++;
 	}
     }
+    /*
+     * did we look at every page?
+     */
     return ai >= a->num;
 }