]> git.wh0rd.org - fontconfig.git/blobdiff - src/fccharset.c
src/fccharset.c (FcLangCharSetPopulate, FcCharSetInsertLeaf)
[fontconfig.git] / src / fccharset.c
index 11e8763304b87bf255de6ca5f16467cb1406e376..e42b82d329359743aaa6d7a5a53e79be85f124e0 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,12 +48,12 @@ 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;
-    leaves[bi] = (FcCharLeaf *)&langBankLeaves;
-    leaf_idx[bi] = (int *)&langBankLeafIdx;
+    numbers[bi] = (FcChar16 *)langBankNumbers;
+    leaves[bi] = (FcCharLeaf *)langBankLeaves;
+    leaf_idx[bi] = (int *)langBankLeafIdx;
 }
 
 FcCharSet *
@@ -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;
     }