]> git.wh0rd.org - fontconfig.git/blobdiff - src/fccharset.c
Fix hidden variable warning.
[fontconfig.git] / src / fccharset.c
index e152a5a00684b48cdc8fcadadd31b8012b64b35a..85b394743ad2c59b42eb8d3b16cdfc65df80b3f4 100644 (file)
@@ -38,9 +38,9 @@ static int charset_leaf_ptr, charset_leaf_count;
 static int ** leaf_idx = 0;
 static int charset_leaf_idx_ptr, charset_leaf_idx_count;
 
-extern const FcChar16 *langBankNumbers;
-extern const FcCharLeaf        *langBankLeaves;
-extern const int *langBankLeafIdx;
+extern const FcChar16 langBankNumbers[];
+extern const FcCharLeaf        langBankLeaves[];
+extern const int langBankLeafIdx[];
 
 static FcBool
 FcCharSetEnsureBank (int bi);
@@ -48,7 +48,7 @@ FcCharSetEnsureBank (int bi);
 void
 FcLangCharSetPopulate (void)
 {
-    int bi = FcCacheBankToIndex (FC_BANK_LANGS);
+    int bi = FcCacheBankToIndexMTF (FC_BANK_LANGS);
     FcCharSetEnsureBank (bi);
     charsets[bi] = 0;
     numbers[bi] = (FcChar16 *)&langBankNumbers;
@@ -263,7 +263,8 @@ FcCharSetInsertLeaf (FcCharSet *fcs, FcChar32 ucs4, FcCharLeaf *leaf)
        }
        else
        {
-           leaves[fcs->bank][leaf_idx[fcs->bank][fcs->u.stat.leafidx_offset]+pos] = *leaf;
+           int bi = FcCacheBankToIndex(fcs->bank);
+           leaves[bi][leaf_idx[fcs->bank][fcs->u.stat.leafidx_offset]+pos] = *leaf;
        }
        return FcTrue;
     }
@@ -1432,28 +1433,28 @@ FcCharSetSerialize(int bank, FcCharSet *c)
 }
 
 void *
-FcCharSetUnserialize (FcCache metadata, void *block_ptr)
+FcCharSetUnserialize (FcCache *metadata, void *block_ptr)
 {
-    int bi = FcCacheBankToIndex(metadata.bank);
+    int bi = FcCacheBankToIndex(metadata->bank);
     if (!FcCharSetEnsureBank(bi))
        return 0;
 
     block_ptr = ALIGN (block_ptr, FcCharSet);
     charsets[bi] = (FcCharSet *)block_ptr;
     block_ptr = (void *)((char *)block_ptr + 
-                    (sizeof (FcCharSet) * metadata.charset_count));
+                    (sizeof (FcCharSet) * metadata->charset_count));
     block_ptr = ALIGN (block_ptr, FcChar16);
     numbers[bi] = (FcChar16 *)block_ptr;
     block_ptr = (void *)((char *)block_ptr + 
-                    (sizeof(FcChar16) * metadata.charset_numbers_count));
+                    (sizeof(FcChar16) * metadata->charset_numbers_count));
     block_ptr = ALIGN (block_ptr, FcCharLeaf);
     leaves[bi] = (FcCharLeaf *)block_ptr;
     block_ptr = (void *)((char *)block_ptr +
-                    (sizeof(FcCharLeaf) * metadata.charset_leaf_count));
+                    (sizeof(FcCharLeaf) * metadata->charset_leaf_count));
     block_ptr = ALIGN (block_ptr, int);
     leaf_idx[bi] = (int *)block_ptr;
     block_ptr = (void *)((char *)block_ptr +
-                    (sizeof(int) * metadata.charset_leaf_idx_count));
+                    (sizeof(int) * metadata->charset_leaf_idx_count));
 
     return block_ptr;
 }