Change index type to 16 bit and bump cache version to 9

The number of .orth files is now > 256, therefore the index type needs to be 16 bit.
This commit is contained in:
Mike FABIAN 2022-12-05 11:07:59 +01:00
parent 9097ada0ef
commit ce9cbe36d8
2 changed files with 3 additions and 3 deletions

View File

@ -251,7 +251,7 @@ if __name__=='__main__':
print('#define fcLangCharSetIndices (fcLangData.langIndices)') print('#define fcLangCharSetIndices (fcLangData.langIndices)')
print('#define fcLangCharSetIndicesInv (fcLangData.langIndicesInv)') print('#define fcLangCharSetIndicesInv (fcLangData.langIndicesInv)')
assert len(sets) < 256 # FIXME: need to change index type to 16-bit below then assert len(sets) < 65536 # FIXME: need to change index type to 32-bit below then
print(''' print('''
static const struct {{ static const struct {{
@ -262,7 +262,7 @@ static const struct {{
{} langIndices[{}]; {} langIndices[{}];
{} langIndicesInv[{}]; {} langIndicesInv[{}];
}} fcLangData = {{'''.format(len(sets), len(leaves), tn, tn, }} fcLangData = {{'''.format(len(sets), len(leaves), tn, tn,
'FcChar8 ', len(sets), 'FcChar8 ', len(sets))) 'FcChar16 ', len(sets), 'FcChar16 ', len(sets)))
# Dump sets # Dump sets
print('{') print('{')

View File

@ -67,7 +67,7 @@ typedef int FcBool;
* it means multiple copies of the font information. * it means multiple copies of the font information.
*/ */
#define FC_CACHE_VERSION_NUMBER 8 #define FC_CACHE_VERSION_NUMBER 9
#define _FC_STRINGIFY_(s) #s #define _FC_STRINGIFY_(s) #s
#define _FC_STRINGIFY(s) _FC_STRINGIFY_(s) #define _FC_STRINGIFY(s) _FC_STRINGIFY_(s)
#define FC_CACHE_VERSION _FC_STRINGIFY(FC_CACHE_VERSION_NUMBER) #define FC_CACHE_VERSION _FC_STRINGIFY(FC_CACHE_VERSION_NUMBER)