FcCache *cache;
FcBool allocated = FcFalse;
- if (fd_stat->st_size < sizeof (FcCache))
+ if (fd_stat->st_size < (int) sizeof (FcCache))
return NULL;
cache = FcCacheFindByStat (fd_stat);
if (cache)
}
if (cache->magic != FC_CACHE_MAGIC_MMAP ||
cache->version < FC_CACHE_CONTENT_VERSION ||
- cache->size != fd_stat->st_size ||
+ cache->size != (intptr_t) fd_stat->st_size ||
!FcCacheTimeValid (cache, dir_stat) ||
!FcCacheInsert (cache, fd_stat))
{
FcChar8 *test_dir;
FcCacheSkip *skip;
struct stat cache_stat;
- int magic;
+ unsigned int magic;
int written;
/*
int nstyle_lang = 0;
int nfullname = 0;
int nfullname_lang = 0;
- int p, platform;
- int n, nameid;
+ unsigned int p, n;
+ int platform, nameid;
FcChar8 *style = 0;
int st;
}
else
{
- int sp;
+ unsigned int sp;
for (sp = 0; sp < NUM_PLATFORM_ORDER; sp++)
if (sname.platform_id == platform_order[sp])
} FcStrBuf;
struct _FcCache {
- int magic; /* FC_CACHE_MAGIC_MMAP or FC_CACHE_ALLOC */
+ unsigned int magic; /* FC_CACHE_MAGIC_MMAP or FC_CACHE_ALLOC */
int version; /* FC_CACHE_CONTENT_VERSION */
intptr_t size; /* size of file */
intptr_t dir; /* offset to dir name */
#define FC_CACHE_MAGIC_MMAP 0xFC02FC04
#define FC_CACHE_MAGIC_ALLOC 0xFC02FC05
-#define FC_CACHE_CONTENT_VERSION 3 /* also check FC_CACHE_VERSION */
+#define FC_CACHE_CONTENT_VERSION 3
struct _FcAtomic {
FcChar8 *file; /* original file name */
FcLangSetBitSet (FcLangSet *ls,
unsigned int id)
{
- int bucket;
+ unsigned int bucket;
id = fcLangCharSetIndices[id];
bucket = id >> 5;
FcLangSetBitGet (const FcLangSet *ls,
unsigned int id)
{
- int bucket;
+ unsigned int bucket;
id = fcLangCharSetIndices[id];
bucket = id >> 5;
FcLangSetBitReset (FcLangSet *ls,
unsigned int id)
{
- int bucket;
+ unsigned int bucket;
id = fcLangCharSetIndices[id];
bucket = id >> 5;
return FcTrue;
break;
default:
- if (t->type == -1 || type == t->type)
+ if (t->type == (unsigned int) -1 || type == t->type)
return FcTrue;
break;
}
FcBool
FcObjectInit (void)
{
- int i;
+ unsigned int i;
if (FcObjectsInited)
return FcTrue;
FcObjectBuckets[i] = 0;
}
for (i = 0; i < FcObjectsNumber; i++)
- if (FcObjects[i].type == -1)
+ if (FcObjects[i].type == (unsigned int) -1)
free ((void*) FcObjects[i].object);
if (FcObjects != _FcBaseObjectTypes)
free (FcObjects);
const FcChar8 *name;
FcConfig *config;
XML_Parser parser;
- int pstack_static_used;
+ unsigned int pstack_static_used;
FcPStack pstack_static[8];
- int vstack_static_used;
+ unsigned int vstack_static_used;
FcVStack vstack_static[64];
} FcConfigParse;
if ( stream->read( stream, pos, 0, 0 ) )
error = FT_Err_Invalid_Stream_Operation;
}
- else if ( pos > stream->size )
+ else if ( pos < 0 || (FT_ULong) pos > stream->size )
error = FT_Err_Invalid_Stream_Operation;
if ( !error )