]> git.wh0rd.org - fontconfig.git/blobdiff - src/fcname.c
Inline the *PtrU functions to gain perf. Remove unneeded params for the
[fontconfig.git] / src / fcname.c
index 0767e114d2fe14b1d3440bb4a9131dda7559fc6a..2fc411f995b39c95b17a888e7760787f70710d8c 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;
@@ -332,11 +333,19 @@ FcObjectNeededBytes ()
     return num + sizeof(int);
 }
 
+int
+FcObjectNeededBytesAlign (void)
+{
+    return __alignof__ (int) + __alignof__ (char);
+}
+
 void *
 FcObjectDistributeBytes (FcCache * metadata, void * block_ptr)
 {
+    block_ptr = ALIGN (block_ptr, int);
     *(int *)block_ptr = biggest_known_ntypes;
     block_ptr = (int *) block_ptr + 1;
+    block_ptr = ALIGN (block_ptr, char);
     biggest_ptr = block_ptr;
     block_ptr = (char *) block_ptr + biggest_known_count;
     return block_ptr;
@@ -359,6 +368,7 @@ 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)
     {
@@ -401,16 +411,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, },
@@ -769,7 +774,6 @@ FcNameUnparseString (FcStrBuf           *buf,
 
 static FcBool
 FcNameUnparseValue (FcStrBuf   *buf,
-                   int         bank,
                    FcValue     *v0,
                    FcChar8     *escape)
 {
@@ -810,7 +814,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))