]> git.wh0rd.org - fontconfig.git/blobdiff - src/fcname.c
Don't assign types to user object names.
[fontconfig.git] / src / fcname.c
index 6ca4f1ad30b3e497ba188189043cf2ad9d2145ac..d7100359f7e29bcccae4c3b8445218ef4e8a719f 100644 (file)
@@ -93,7 +93,8 @@ struct _FcObjectTypeList {
 static const FcObjectTypeList _FcBaseObjectTypesList = {
     0,
     _FcBaseObjectTypes,
-    NUM_OBJECT_TYPES
+    NUM_OBJECT_TYPES,
+    0
 };
 
 static const FcObjectTypeList  *_FcObjectTypes = &_FcBaseObjectTypesList;
@@ -154,6 +155,9 @@ FcNameGetObjectType (const char *object)
     
     for (l = _FcObjectTypes; l; l = l->next)
     {
+        if (l == (FcObjectTypeList*)_FcUserObjectNames)
+            continue;
+
        for (i = 0; i < l->ntypes; i++)
        {
            t = &l->types[i];
@@ -341,11 +345,11 @@ FcObjectNeededBytesAlign (void)
 void *
 FcObjectDistributeBytes (FcCache * metadata, void * block_ptr)
 {
-    *(int *)block_ptr = biggest_known_ntypes;
     block_ptr = ALIGN (block_ptr, int);
+    *(int *)block_ptr = biggest_known_ntypes;
     block_ptr = (int *) block_ptr + 1;
-    biggest_ptr = block_ptr;
     block_ptr = ALIGN (block_ptr, char);
+    biggest_ptr = block_ptr;
     block_ptr = (char *) block_ptr + biggest_known_count;
     return block_ptr;
 }
@@ -363,10 +367,11 @@ FcObjectSerialize ()
 }
 
 void *
-FcObjectUnserialize (FcCache metadata, void *block_ptr)
+FcObjectUnserialize (FcCache metadata, void *block_ptr)
 {
     int new_biggest;
     new_biggest = *(int *)block_ptr;
+    block_ptr = ALIGN (block_ptr, int);
     block_ptr = (int *) block_ptr + 1;
     if (biggest_known_ntypes < new_biggest)
     {
@@ -409,16 +414,11 @@ FcObjectUnserialize (FcCache metadata, void *block_ptr)
        biggest_known_ntypes = new_biggest;
        biggest_known_types = (const FcObjectType *)bn;
     }
+    block_ptr = ALIGN (block_ptr, char);
     block_ptr = (char *) block_ptr + biggest_known_count;
     return block_ptr;
 }
 
-int
-FcObjectPtrCompare (const FcObjectPtr a, const FcObjectPtr b)
-{
-    return a - b;
-}
-
 static const FcConstant _FcBaseConstants[] = {
     { (FcChar8 *) "thin",          "weight",   FC_WEIGHT_THIN, },
     { (FcChar8 *) "extralight",            "weight",   FC_WEIGHT_EXTRALIGHT, },
@@ -777,7 +777,6 @@ FcNameUnparseString (FcStrBuf           *buf,
 
 static FcBool
 FcNameUnparseValue (FcStrBuf   *buf,
-                   int         bank,
                    FcValue     *v0,
                    FcChar8     *escape)
 {
@@ -818,7 +817,7 @@ FcNameUnparseValueList (FcStrBuf    *buf,
 {
     while (FcValueListPtrU(v))
     {
-       if (!FcNameUnparseValue (buf, v.bank, &FcValueListPtrU(v)->value, escape))
+       if (!FcNameUnparseValue (buf, &FcValueListPtrU(v)->value, escape))
            return FcFalse;
        if (FcValueListPtrU(v = FcValueListPtrU(v)->next))
            if (!FcNameUnparseString (buf, (FcChar8 *) ",", 0))