Reduce number of places that cache version is specified to 1
This commit is contained in:
parent
5bad26ccb6
commit
ee2d1da2d2
|
@ -66,7 +66,10 @@ typedef int FcBool;
|
|||
* it means multiple copies of the font information.
|
||||
*/
|
||||
|
||||
#define FC_CACHE_VERSION "5"
|
||||
#define FC_CACHE_VERSION_NUMBER 5
|
||||
#define _FC_STRINGIFY_(s) #s
|
||||
#define _FC_STRINGIFY(s) _FC_STRINGIFY_(s)
|
||||
#define FC_CACHE_VERSION _FC_STRINGIFY(FC_CACHE_VERSION_NUMBER)
|
||||
|
||||
#define FcTrue 1
|
||||
#define FcFalse 0
|
||||
|
|
|
@ -655,7 +655,7 @@ FcDirCacheMapFd (FcConfig *config, int fd, struct stat *fd_stat, struct stat *di
|
|||
allocated = FcTrue;
|
||||
}
|
||||
if (cache->magic != FC_CACHE_MAGIC_MMAP ||
|
||||
cache->version < FC_CACHE_CONTENT_VERSION ||
|
||||
cache->version < FC_CACHE_VERSION_NUMBER ||
|
||||
cache->size != (intptr_t) fd_stat->st_size ||
|
||||
!FcCacheTimeValid (config, cache, dir_stat) ||
|
||||
!FcCacheDirsValid (config, cache) ||
|
||||
|
@ -751,7 +751,7 @@ FcDirCacheValidateHelper (FcConfig *config, int fd, struct stat *fd_stat, struct
|
|||
ret = FcFalse;
|
||||
else if (c.magic != FC_CACHE_MAGIC_MMAP)
|
||||
ret = FcFalse;
|
||||
else if (c.version < FC_CACHE_CONTENT_VERSION)
|
||||
else if (c.version < FC_CACHE_VERSION_NUMBER)
|
||||
ret = FcFalse;
|
||||
else if (fd_stat->st_size != c.size)
|
||||
ret = FcFalse;
|
||||
|
@ -828,7 +828,7 @@ FcDirCacheBuild (FcFontSet *set, const FcChar8 *dir, struct stat *dir_stat, FcSt
|
|||
serialize->linear = cache;
|
||||
|
||||
cache->magic = FC_CACHE_MAGIC_ALLOC;
|
||||
cache->version = FC_CACHE_CONTENT_VERSION;
|
||||
cache->version = FC_CACHE_VERSION_NUMBER;
|
||||
cache->size = serialize->size;
|
||||
cache->checksum = (int) dir_stat->st_mtime;
|
||||
|
||||
|
|
|
@ -361,7 +361,7 @@ typedef struct _FcStrBuf {
|
|||
|
||||
struct _FcCache {
|
||||
unsigned int magic; /* FC_CACHE_MAGIC_MMAP or FC_CACHE_ALLOC */
|
||||
int version; /* FC_CACHE_CONTENT_VERSION */
|
||||
int version; /* FC_CACHE_VERSION_NUMBER */
|
||||
intptr_t size; /* size of file */
|
||||
intptr_t dir; /* offset to dir name */
|
||||
intptr_t dirs; /* offset to subdirs */
|
||||
|
@ -453,7 +453,6 @@ typedef struct _FcCaseFold {
|
|||
|
||||
#define FC_CACHE_MAGIC_MMAP 0xFC02FC04
|
||||
#define FC_CACHE_MAGIC_ALLOC 0xFC02FC05
|
||||
#define FC_CACHE_CONTENT_VERSION 5
|
||||
|
||||
struct _FcAtomic {
|
||||
FcChar8 *file; /* original file name */
|
||||
|
|
Loading…
Reference in New Issue