[Fontconfig] fontconfig: Branch 'master' - 7 commits
Behdad Esfahbod
behdad at kemper.freedesktop.org
Sat Dec 29 19:58:38 PST 2012
src/fcarch.c | 2 +-
src/fccache.c | 8 ++++----
src/fccfg.c | 46 +++++++++++++++++++++++-----------------------
src/fccharset.c | 4 ++--
src/fcdir.c | 6 +++---
src/fcformat.c | 8 ++++----
src/fcfreetype.c | 12 +++++-------
src/fcint.h | 10 ++++++++--
src/fclang.c | 6 +++---
src/fcmatch.c | 23 +++++++++++------------
src/fcname.c | 12 ++++++------
src/fcpat.c | 16 ++++++++--------
src/fcserialize.c | 1 -
src/fcstat.c | 6 ++++--
src/fcstr.c | 2 --
src/fcxml.c | 41 +++++++++++++++++------------------------
src/ftglue.c | 3 +--
17 files changed, 100 insertions(+), 106 deletions(-)
New commits:
commit d823bb3cad1b34d92ca99998a00f35b66666bdf3
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Sat Dec 29 22:57:53 2012 -0500
Fixup from 4f6767470f52b287a2923e7e6d8de5fae1993f67
diff --git a/src/fcxml.c b/src/fcxml.c
index 3ae6b7a..47a327e 100644
--- a/src/fcxml.c
+++ b/src/fcxml.c
@@ -2438,11 +2438,6 @@ FcPopValue (FcConfigParse *parse)
value.u.d = vstack->u._double;
value.type = FcTypeDouble;
break;
- case FcVStackMatrix:
- value.u.m = FcExprMatrixCopyShallow (vstack->u.matrix);
- if (value.u.m)
- value.type = FcTypeMatrix;
- break;
case FcVStackBool:
value.u.b = vstack->u.bool_;
value.type = FcTypeBool;
commit eb9ffac7e5955bcfdf98fa985cc39062d6ea641b
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Sat Dec 29 22:56:14 2012 -0500
Fix more warnings
diff --git a/src/fcserialize.c b/src/fcserialize.c
index e5ec90b..d2f221d 100644
--- a/src/fcserialize.c
+++ b/src/fcserialize.c
@@ -151,6 +151,5 @@ FcStrSerialize (FcSerialize *serialize, const FcChar8 *str)
strcpy ((char *) str_serialize, (const char *) str);
return str_serialize;
}
-#define __fcserialize__
#include "fcaliastail.h"
#undef __fcserialize__
diff --git a/src/ftglue.c b/src/ftglue.c
index ac5f121..0e02bd2 100644
--- a/src/ftglue.c
+++ b/src/ftglue.c
@@ -257,6 +257,5 @@ Exit:
}
#undef QALLOC
-#define __ftglue__
#include "fcaliastail.h"
#undef __ftglue__
commit 1404af312a091b601bca91b791fe4039da8dba8f
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Sat Dec 29 22:55:36 2012 -0500
Fix warning
diff --git a/src/fcstat.c b/src/fcstat.c
index d4431e0..d1730fd 100644
--- a/src/fcstat.c
+++ b/src/fcstat.c
@@ -268,11 +268,11 @@ FcFStatFs (int fd, FcStatFS *statb)
int ret = -1;
FcBool flag = FcFalse;
- memset (statb, 0, sizeof (FcStatFS));
-
#if defined(HAVE_FSTATVFS) && (defined(HAVE_STRUCT_STATVFS_F_BASETYPE) || defined(HAVE_STRUCT_STATVFS_F_FSTYPENAME))
struct statvfs buf;
+ memset (statb, 0, sizeof (FcStatFS));
+
if ((ret = fstatvfs (fd, &buf)) == 0)
{
# if defined(HAVE_STRUCT_STATVFS_F_BASETYPE)
@@ -284,6 +284,8 @@ FcFStatFs (int fd, FcStatFS *statb)
#elif defined(HAVE_FSTATFS) && (defined(HAVE_STRUCT_STATFS_F_FLAGS) || defined(HAVE_STRUCT_STATFS_F_FSTYPENAME) || defined(__linux__))
struct statfs buf;
+ memset (statb, 0, sizeof (FcStatFS));
+
if ((ret = fstatfs (fd, &buf)) == 0)
{
# if defined(HAVE_STRUCT_STATFS_F_FLAGS) && defined(MNT_LOCAL)
commit dd69d96e06b16c37bb87817edd40f6e4040f35ae
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Sat Dec 29 22:47:49 2012 -0500
Fix sign-compare warnings
diff --git a/src/fccache.c b/src/fccache.c
index 3828b61..aace6b3 100644
--- a/src/fccache.c
+++ b/src/fccache.c
@@ -527,7 +527,7 @@ FcDirCacheMapFd (int fd, struct stat *fd_stat, struct stat *dir_stat)
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)
@@ -582,7 +582,7 @@ FcDirCacheMapFd (int fd, struct stat *fd_stat, struct stat *dir_stat)
}
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))
{
@@ -842,7 +842,7 @@ FcDirCacheWrite (FcCache *cache, FcConfig *config)
FcChar8 *test_dir;
FcCacheSkip *skip;
struct stat cache_stat;
- int magic;
+ unsigned int magic;
int written;
/*
diff --git a/src/fcfreetype.c b/src/fcfreetype.c
index f4dfb80..9ac2fa9 100644
--- a/src/fcfreetype.c
+++ b/src/fcfreetype.c
@@ -1117,8 +1117,8 @@ FcFreeTypeQueryFace (const FT_Face face,
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;
@@ -1199,7 +1199,7 @@ FcFreeTypeQueryFace (const FT_Face face,
}
else
{
- int sp;
+ unsigned int sp;
for (sp = 0; sp < NUM_PLATFORM_ORDER; sp++)
if (sname.platform_id == platform_order[sp])
diff --git a/src/fcint.h b/src/fcint.h
index 2cb7805..8b5a104 100644
--- a/src/fcint.h
+++ b/src/fcint.h
@@ -358,7 +358,7 @@ typedef struct _FcStrBuf {
} 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 */
@@ -451,7 +451,7 @@ typedef struct _FcCaseFold {
#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 */
diff --git a/src/fclang.c b/src/fclang.c
index 65d22a9..57183fd 100644
--- a/src/fclang.c
+++ b/src/fclang.c
@@ -51,7 +51,7 @@ static void
FcLangSetBitSet (FcLangSet *ls,
unsigned int id)
{
- int bucket;
+ unsigned int bucket;
id = fcLangCharSetIndices[id];
bucket = id >> 5;
@@ -65,7 +65,7 @@ static FcBool
FcLangSetBitGet (const FcLangSet *ls,
unsigned int id)
{
- int bucket;
+ unsigned int bucket;
id = fcLangCharSetIndices[id];
bucket = id >> 5;
@@ -79,7 +79,7 @@ static void
FcLangSetBitReset (FcLangSet *ls,
unsigned int id)
{
- int bucket;
+ unsigned int bucket;
id = fcLangCharSetIndices[id];
bucket = id >> 5;
diff --git a/src/fcname.c b/src/fcname.c
index 0ad508b..5540b6f 100644
--- a/src/fcname.c
+++ b/src/fcname.c
@@ -307,7 +307,7 @@ FcObjectValidType (FcObject object, FcType type)
return FcTrue;
break;
default:
- if (t->type == -1 || type == t->type)
+ if (t->type == (unsigned int) -1 || type == t->type)
return FcTrue;
break;
}
@@ -343,7 +343,7 @@ FcObjectGetSet (void)
FcBool
FcObjectInit (void)
{
- int i;
+ unsigned int i;
if (FcObjectsInited)
return FcTrue;
@@ -371,7 +371,7 @@ FcObjectFini (void)
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);
diff --git a/src/fcxml.c b/src/fcxml.c
index 3e2a42b..3ae6b7a 100644
--- a/src/fcxml.c
+++ b/src/fcxml.c
@@ -508,9 +508,9 @@ typedef struct _FcConfigParse {
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;
diff --git a/src/ftglue.c b/src/ftglue.c
index 7c643d0..ac5f121 100644
--- a/src/ftglue.c
+++ b/src/ftglue.c
@@ -87,7 +87,7 @@ ftglue_stream_seek( FT_Stream stream,
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 )
commit 4ad3a73691b98781cfd4de789af7d33649ce3023
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Sat Dec 29 22:33:33 2012 -0500
Fix more warnings
diff --git a/src/fcstr.c b/src/fcstr.c
index cc1465c..062c5d1 100644
--- a/src/fcstr.c
+++ b/src/fcstr.c
@@ -78,8 +78,6 @@ FcStrFree (FcChar8 *s)
#define FcCaseFoldUpperCount(cf) \
((cf)->method == FC_CASE_FOLD_FULL ? 1 : (cf)->count)
-#define FC_STR_CANON_BUF_LEN 1024
-
typedef struct _FcCaseWalker {
const FcChar8 *read;
const FcChar8 *src;
diff --git a/src/fcxml.c b/src/fcxml.c
index cc62558..3e2a42b 100644
--- a/src/fcxml.c
+++ b/src/fcxml.c
@@ -1338,9 +1338,7 @@ FcParseString (FcConfigParse *parse, FcVStackTag tag)
static void
FcParseMatrix (FcConfigParse *parse)
{
- FcVStack *vstack;
FcExprMatrix m;
- int i;
m.yy = FcPopExpr (parse);
m.yx = FcPopExpr (parse);
commit 83d8019011232d491df93cda97a2f988ee96005b
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Sat Dec 29 22:32:56 2012 -0500
Fix unused-parameter warnings
diff --git a/src/fcarch.c b/src/fcarch.c
index 44548fc..8e6a8c4 100644
--- a/src/fcarch.c
+++ b/src/fcarch.c
@@ -66,7 +66,7 @@ FC_ASSERT_STATIC (0x08 + 6*SIZEOF_VOID_P == sizeof (FcCache));
int
-main (int argc, char **argv)
+main (int argc FC_UNUSED, char **argv FC_UNUSED)
{
printf ("%s\n", FC_ARCHITECTURE);
return 0;
diff --git a/src/fccache.c b/src/fccache.c
index 81985df..3828b61 100644
--- a/src/fccache.c
+++ b/src/fccache.c
@@ -666,7 +666,7 @@ FcDirCacheLoadFile (const FcChar8 *cache_file, struct stat *file_stat)
* the magic number and the size field
*/
static FcBool
-FcDirCacheValidateHelper (int fd, struct stat *fd_stat, struct stat *dir_stat, void *closure)
+FcDirCacheValidateHelper (int fd, struct stat *fd_stat, struct stat *dir_stat, void *closure FC_UNUSED)
{
FcBool ret = FcTrue;
FcCache c;
diff --git a/src/fccfg.c b/src/fccfg.c
index 038c010..f53be26 100644
--- a/src/fccfg.c
+++ b/src/fccfg.c
@@ -510,7 +510,7 @@ FcConfigGetConfigFiles (FcConfig *config)
}
FcChar8 *
-FcConfigGetCache (FcConfig *config)
+FcConfigGetCache (FcConfig *config FC_UNUSED)
{
return NULL;
}
diff --git a/src/fccharset.c b/src/fccharset.c
index 8c1d858..61489c4 100644
--- a/src/fccharset.c
+++ b/src/fccharset.c
@@ -1190,7 +1190,7 @@ FcCharSetFreezeOrig (FcCharSetFreezer *freezer, const FcCharSet *orig, const FcC
}
static FcCharSet *
-FcCharSetFreezeBase (FcCharSetFreezer *freezer, FcCharSet *fcs, const FcCharSet *orig)
+FcCharSetFreezeBase (FcCharSetFreezer *freezer, FcCharSet *fcs)
{
FcChar32 hash = FcCharSetHash (fcs);
FcCharSetEnt **bucket = &freezer->set_hash_table[hash % FC_CHAR_SET_HASH_SIZE];
@@ -1289,7 +1289,7 @@ FcCharSetFreeze (FcCharSetFreezer *freezer, const FcCharSet *fcs)
if (!FcCharSetInsertLeaf (b, FcCharSetNumbers(fcs)[i] << 8, l))
goto bail1;
}
- n = FcCharSetFreezeBase (freezer, b, fcs);
+ n = FcCharSetFreezeBase (freezer, b);
if (!FcCharSetFreezeOrig (freezer, fcs, n))
{
n = NULL;
diff --git a/src/fcdir.c b/src/fcdir.c
index 6869ea1..dc580bb 100644
--- a/src/fcdir.c
+++ b/src/fcdir.c
@@ -126,10 +126,10 @@ FcFileScanConfig (FcFontSet *set,
FcBool
FcFileScan (FcFontSet *set,
FcStrSet *dirs,
- FcFileCache *cache, /* XXX unused */
+ FcFileCache *cache FC_UNUSED,
FcBlanks *blanks,
const FcChar8 *file,
- FcBool force)
+ FcBool force FC_UNUSED)
{
return FcFileScanConfig (set, dirs, blanks, file, FcConfigGetCurrent ());
}
@@ -316,7 +316,7 @@ FcDirCacheRead (const FcChar8 *dir, FcBool force, FcConfig *config)
}
FcBool
-FcDirSave (FcFontSet *set, FcStrSet * dirs, const FcChar8 *dir)
+FcDirSave (FcFontSet *set FC_UNUSED, FcStrSet * dirs FC_UNUSED, const FcChar8 *dir FC_UNUSED)
{
return FcFalse; /* XXX deprecated */
}
diff --git a/src/fcformat.c b/src/fcformat.c
index 72bf180..a4c72ae 100644
--- a/src/fcformat.c
+++ b/src/fcformat.c
@@ -790,7 +790,7 @@ interpret_simple (FcFormatContext *c,
}
static FcBool
-cescape (FcFormatContext *c,
+cescape (FcFormatContext *c FC_UNUSED,
const FcChar8 *str,
FcStrBuf *buf)
{
@@ -811,7 +811,7 @@ cescape (FcFormatContext *c,
}
static FcBool
-shescape (FcFormatContext *c,
+shescape (FcFormatContext *c FC_UNUSED,
const FcChar8 *str,
FcStrBuf *buf)
{
@@ -829,7 +829,7 @@ shescape (FcFormatContext *c,
}
static FcBool
-xmlescape (FcFormatContext *c,
+xmlescape (FcFormatContext *c FC_UNUSED,
const FcChar8 *str,
FcStrBuf *buf)
{
diff --git a/src/fcint.h b/src/fcint.h
index 9dc1aa7..2cb7805 100644
--- a/src/fcint.h
+++ b/src/fcint.h
@@ -69,6 +69,12 @@ extern pfnSHGetFolderPathA pSHGetFolderPathA;
# define FC_DIR_SEPARATOR_S "/"
#endif
+#if __GNUC__ >= 4
+#define FC_UNUSED __attribute__((unused))
+#else
+#define FC_UNUSED
+#endif
+
#define FC_DBG_MATCH 1
#define FC_DBG_MATCHV 2
#define FC_DBG_EDIT 4
diff --git a/src/fcmatch.c b/src/fcmatch.c
index caa8588..ed245c6 100644
--- a/src/fcmatch.c
+++ b/src/fcmatch.c
@@ -563,8 +563,7 @@ FcFontRenderPrepare (FcConfig *config,
}
static FcPattern *
-FcFontSetMatchInternal (FcConfig *config,
- FcFontSet **sets,
+FcFontSetMatchInternal (FcFontSet **sets,
int nsets,
FcPattern *p,
FcResult *result)
@@ -658,7 +657,7 @@ FcFontSetMatch (FcConfig *config,
if (!config)
return 0;
}
- best = FcFontSetMatchInternal (config, sets, nsets, p, result);
+ best = FcFontSetMatchInternal (sets, nsets, p, result);
if (best)
return FcFontRenderPrepare (config, p, best);
else
@@ -691,7 +690,7 @@ FcFontMatch (FcConfig *config,
if (config->fonts[FcSetApplication])
sets[nsets++] = config->fonts[FcSetApplication];
- best = FcFontSetMatchInternal (config, sets, nsets, p, result);
+ best = FcFontSetMatchInternal (sets, nsets, p, result);
if (best)
return FcFontRenderPrepare (config, p, best);
else
@@ -794,7 +793,7 @@ FcFontSetSortDestroy (FcFontSet *fs)
}
FcFontSet *
-FcFontSetSort (FcConfig *config,
+FcFontSetSort (FcConfig *config FC_UNUSED,
FcFontSet **sets,
int nsets,
FcPattern *p,
diff --git a/src/fcxml.c b/src/fcxml.c
index 34b4b36..cc62558 100644
--- a/src/fcxml.c
+++ b/src/fcxml.c
@@ -2541,7 +2541,7 @@ FcParsePattern (FcConfigParse *parse)
}
static void
-FcEndElement(void *userData, const XML_Char *name)
+FcEndElement(void *userData, const XML_Char *name FC_UNUSED)
{
FcConfigParse *parse = userData;
FcChar8 *data;
@@ -2733,9 +2733,9 @@ FcCharacterData (void *userData, const XML_Char *s, int len)
static void
FcStartDoctypeDecl (void *userData,
const XML_Char *doctypeName,
- const XML_Char *sysid,
- const XML_Char *pubid,
- int has_internal_subset)
+ const XML_Char *sysid FC_UNUSED,
+ const XML_Char *pubid FC_UNUSED,
+ int has_internal_subset FC_UNUSED)
{
FcConfigParse *parse = userData;
@@ -2766,7 +2766,7 @@ FcExternalSubsetDecl (void *userData,
#else /* ENABLE_LIBXML2 */
static void
-FcEndDoctypeDecl (void *userData)
+FcEndDoctypeDecl (void *userData FC_UNUSED)
{
}
commit 24cdcf52ab7f83b329072efacbdd9253991579c0
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Sat Dec 29 22:11:09 2012 -0500
Fix compiler warnings
diff --git a/src/fccfg.c b/src/fccfg.c
index 68f9946..038c010 100644
--- a/src/fccfg.c
+++ b/src/fccfg.c
@@ -708,7 +708,7 @@ FcConfigCompareValue (const FcValue *left_o,
case FcTypeInteger:
break; /* FcConfigPromote prevents this from happening */
case FcTypeDouble:
- switch (op) {
+ switch ((int) op) {
case FcOpEqual:
case FcOpContains:
case FcOpListing:
@@ -735,7 +735,7 @@ FcConfigCompareValue (const FcValue *left_o,
}
break;
case FcTypeBool:
- switch (op) {
+ switch ((int) op) {
case FcOpEqual:
case FcOpContains:
case FcOpListing:
@@ -750,7 +750,7 @@ FcConfigCompareValue (const FcValue *left_o,
}
break;
case FcTypeString:
- switch (op) {
+ switch ((int) op) {
case FcOpEqual:
case FcOpListing:
if (flags & FcOpFlagIgnoreBlanks)
@@ -775,7 +775,7 @@ FcConfigCompareValue (const FcValue *left_o,
}
break;
case FcTypeMatrix:
- switch (op) {
+ switch ((int) op) {
case FcOpEqual:
case FcOpContains:
case FcOpListing:
@@ -790,7 +790,7 @@ FcConfigCompareValue (const FcValue *left_o,
}
break;
case FcTypeCharSet:
- switch (op) {
+ switch ((int) op) {
case FcOpContains:
case FcOpListing:
/* left contains right if right is a subset of left */
@@ -811,7 +811,7 @@ FcConfigCompareValue (const FcValue *left_o,
}
break;
case FcTypeLangSet:
- switch (op) {
+ switch ((int) op) {
case FcOpContains:
case FcOpListing:
ret = FcLangSetContains (left.u.l, right.u.l);
@@ -830,7 +830,7 @@ FcConfigCompareValue (const FcValue *left_o,
}
break;
case FcTypeVoid:
- switch (op) {
+ switch ((int) op) {
case FcOpEqual:
case FcOpContains:
case FcOpListing:
@@ -841,7 +841,7 @@ FcConfigCompareValue (const FcValue *left_o,
}
break;
case FcTypeFTFace:
- switch (op) {
+ switch ((int) op) {
case FcOpEqual:
case FcOpContains:
case FcOpListing:
@@ -882,7 +882,7 @@ FcConfigEvaluate (FcPattern *p, FcExpr *e)
FcChar8 *str;
FcOp op = FC_OP_GET_OP (e->op);
- switch (op) {
+ switch ((int) op) {
case FcOpInteger:
v.type = FcTypeInteger;
v.u.i = e->u.ival;
@@ -899,8 +899,8 @@ FcConfigEvaluate (FcPattern *p, FcExpr *e)
case FcOpMatrix:
{
FcMatrix m;
- v.type = FcTypeMatrix;
FcValue xx, xy, yx, yy;
+ v.type = FcTypeMatrix;
xx = FcConfigPromote (FcConfigEvaluate (p, e->u.mexpr->xx), v);
xy = FcConfigPromote (FcConfigEvaluate (p, e->u.mexpr->xy), v);
yx = FcConfigPromote (FcConfigEvaluate (p, e->u.mexpr->yx), v);
@@ -986,9 +986,9 @@ FcConfigEvaluate (FcPattern *p, FcExpr *e)
vr = FcConfigPromote (vr, vl);
if (vl.type == vr.type)
{
- switch (vl.type) {
+ switch ((int) vl.type) {
case FcTypeDouble:
- switch (op) {
+ switch ((int) op) {
case FcOpPlus:
v.type = FcTypeDouble;
v.u.d = vl.u.d + vr.u.d;
@@ -1017,7 +1017,7 @@ FcConfigEvaluate (FcPattern *p, FcExpr *e)
}
break;
case FcTypeBool:
- switch (op) {
+ switch ((int) op) {
case FcOpOr:
v.type = FcTypeBool;
v.u.b = vl.u.b || vr.u.b;
@@ -1032,7 +1032,7 @@ FcConfigEvaluate (FcPattern *p, FcExpr *e)
}
break;
case FcTypeString:
- switch (op) {
+ switch ((int) op) {
case FcOpPlus:
v.type = FcTypeString;
str = FcStrPlus (vl.u.s, vr.u.s);
@@ -1048,7 +1048,7 @@ FcConfigEvaluate (FcPattern *p, FcExpr *e)
}
break;
case FcTypeMatrix:
- switch (op) {
+ switch ((int) op) {
case FcOpTimes:
v.type = FcTypeMatrix;
m = malloc (sizeof (FcMatrix));
@@ -1069,7 +1069,7 @@ FcConfigEvaluate (FcPattern *p, FcExpr *e)
}
break;
case FcTypeCharSet:
- switch (op) {
+ switch ((int) op) {
case FcOpPlus:
v.type = FcTypeCharSet;
v.u.c = FcCharSetUnion (vl.u.c, vr.u.c);
@@ -1088,7 +1088,7 @@ FcConfigEvaluate (FcPattern *p, FcExpr *e)
}
break;
case FcTypeLangSet:
- switch (op) {
+ switch ((int) op) {
case FcOpPlus:
v.type = FcTypeLangSet;
v.u.l = FcLangSetUnion (vl.u.l, vr.u.l);
@@ -1118,7 +1118,7 @@ FcConfigEvaluate (FcPattern *p, FcExpr *e)
break;
case FcOpNot:
vl = FcConfigEvaluate (p, e->u.tree.left);
- switch (vl.type) {
+ switch ((int) vl.type) {
case FcTypeBool:
v.type = FcTypeBool;
v.u.b = !vl.u.b;
@@ -1131,7 +1131,7 @@ FcConfigEvaluate (FcPattern *p, FcExpr *e)
break;
case FcOpFloor:
vl = FcConfigEvaluate (p, e->u.tree.left);
- switch (vl.type) {
+ switch ((int) vl.type) {
case FcTypeInteger:
v = vl;
break;
@@ -1147,7 +1147,7 @@ FcConfigEvaluate (FcPattern *p, FcExpr *e)
break;
case FcOpCeil:
vl = FcConfigEvaluate (p, e->u.tree.left);
- switch (vl.type) {
+ switch ((int) vl.type) {
case FcTypeInteger:
v = vl;
break;
@@ -1163,7 +1163,7 @@ FcConfigEvaluate (FcPattern *p, FcExpr *e)
break;
case FcOpRound:
vl = FcConfigEvaluate (p, e->u.tree.left);
- switch (vl.type) {
+ switch ((int) vl.type) {
case FcTypeInteger:
v = vl;
break;
@@ -1179,7 +1179,7 @@ FcConfigEvaluate (FcPattern *p, FcExpr *e)
break;
case FcOpTrunc:
vl = FcConfigEvaluate (p, e->u.tree.left);
- switch (vl.type) {
+ switch ((int) vl.type) {
case FcTypeInteger:
v = vl;
break;
diff --git a/src/fcformat.c b/src/fcformat.c
index 8eef7bb..72bf180 100644
--- a/src/fcformat.c
+++ b/src/fcformat.c
@@ -358,7 +358,7 @@ skip_percent (FcFormatContext *c)
/* skip an optional width specifier */
if (strtol ((const char *) c->format, (char **) &c->format, 10))
- /* don't care */;
+ {/* don't care */}
if (!expect_char (c, '{'))
return FcFalse;
diff --git a/src/fcfreetype.c b/src/fcfreetype.c
index fb2b0f2..f4dfb80 100644
--- a/src/fcfreetype.c
+++ b/src/fcfreetype.c
@@ -1005,7 +1005,6 @@ static const FcStringConst slantConsts[] = {
#define NUM_SLANT_CONSTS (int) (sizeof (slantConsts) / sizeof (slantConsts[0]))
-#define FcIsSlant(s) FcStringIsConst(s,slantConsts,NUM_SLANT_CONSTS)
#define FcContainsSlant(s) FcStringContainsConst (s,slantConsts,NUM_SLANT_CONSTS)
static const FcStringConst decorativeConsts[] = {
@@ -1019,7 +1018,6 @@ static const FcStringConst decorativeConsts[] = {
#define NUM_DECORATIVE_CONSTS (int) (sizeof (decorativeConsts) / sizeof (decorativeConsts[0]))
-#define FcIsDecorative(s) FcStringIsConst(s,decorativeConsts,NUM_DECORATIVE_CONSTS)
#define FcContainsDecorative(s) FcStringContainsConst (s,decorativeConsts,NUM_DECORATIVE_CONSTS)
static double
@@ -2262,7 +2260,7 @@ FcFreeTypeCheckGlyph (FT_Face face, FcChar32 ucs4,
*advance = slot->metrics.horiAdvance;
- switch (slot->format) {
+ switch ((int) slot->format) {
case ft_glyph_format_bitmap:
/*
* Bitmaps are assumed to be reasonable; if
@@ -2598,7 +2596,7 @@ addtag(FcChar8 *complex_, FT_ULong tag)
if (*complex_ != '\0')
strcat ((char *) complex_, " ");
- strcat ((char *) complex_, "otlayout:");
+ strcat ((char *) complex_, OTLAYOUT_HEAD);
strcat ((char *) complex_, (char *) tagstring);
}
diff --git a/src/fcmatch.c b/src/fcmatch.c
index 9703392..caa8588 100644
--- a/src/fcmatch.c
+++ b/src/fcmatch.c
@@ -33,7 +33,7 @@ FcCompareNumber (FcValue *value1, FcValue *value2)
{
double v1, v2, v;
- switch (value1->type) {
+ switch ((int) value1->type) {
case FcTypeInteger:
v1 = (double) value1->u.i;
break;
@@ -43,7 +43,7 @@ FcCompareNumber (FcValue *value1, FcValue *value2)
default:
return -1.0;
}
- switch (value2->type) {
+ switch ((int) value2->type) {
case FcTypeInteger:
v2 = (double) value2->u.i;
break;
@@ -86,9 +86,9 @@ FcCompareLang (FcValue *v1, FcValue *v2)
FcLangResult result;
FcValue value1 = FcValueCanonicalize(v1), value2 = FcValueCanonicalize(v2);
- switch (value1.type) {
+ switch ((int) value1.type) {
case FcTypeLangSet:
- switch (value2.type) {
+ switch ((int) value2.type) {
case FcTypeLangSet:
result = FcLangSetCompare (value1.u.l, value2.u.l);
break;
@@ -101,7 +101,7 @@ FcCompareLang (FcValue *v1, FcValue *v2)
}
break;
case FcTypeString:
- switch (value2.type) {
+ switch ((int) value2.type) {
case FcTypeLangSet:
result = FcLangSetHasLang (value2.u.l, value1.u.s);
break;
@@ -146,7 +146,7 @@ FcCompareSize (FcValue *value1, FcValue *value2)
{
double v1, v2, v;
- switch (value1->type) {
+ switch ((int) value1->type) {
case FcTypeInteger:
v1 = value1->u.i;
break;
@@ -156,7 +156,7 @@ FcCompareSize (FcValue *value1, FcValue *value2)
default:
return -1;
}
- switch (value2->type) {
+ switch ((int) value2->type) {
case FcTypeInteger:
v2 = value2->u.i;
break;
diff --git a/src/fcname.c b/src/fcname.c
index 6a1fc12..0ad508b 100644
--- a/src/fcname.c
+++ b/src/fcname.c
@@ -296,7 +296,7 @@ FcObjectValidType (FcObject object, FcType type)
FcObjectType *t = FcObjectFindById (object);
if (t) {
- switch (t->type) {
+ switch ((int) t->type) {
case FcTypeDouble:
case FcTypeInteger:
if (type == FcTypeDouble || type == FcTypeInteger)
@@ -579,7 +579,7 @@ FcNameConvert (FcType type, FcChar8 *string)
FcMatrix m;
v.type = type;
- switch (v.type) {
+ switch ((int) v.type) {
case FcTypeInteger:
if (!FcNameConstant (string, &v.u.i))
v.u.i = atoi ((char *) string);
@@ -717,7 +717,7 @@ FcNameParse (const FcChar8 *name)
if ((c = FcNameGetConstant (save)))
{
t = FcNameGetObjectType ((char *) c->object);
- switch (t->type) {
+ switch ((int) t->type) {
case FcTypeInteger:
case FcTypeDouble:
if (!FcPatternAddInteger (pat, c->object, c->value))
diff --git a/src/fcpat.c b/src/fcpat.c
index 62e47ca..fe43d3a 100644
--- a/src/fcpat.c
+++ b/src/fcpat.c
@@ -45,7 +45,7 @@ FcPatternCreate (void)
void
FcValueDestroy (FcValue v)
{
- switch (v.type) {
+ switch ((int) v.type) {
case FcTypeString:
if (!FcSharedStrFree (v.u.s))
FcStrFree ((FcChar8 *) v.u.s);
@@ -69,7 +69,7 @@ FcValueCanonicalize (const FcValue *v)
{
FcValue new;
- switch (v->type)
+ switch ((int) v->type)
{
case FcTypeString:
new.u.s = FcValueString(v);
@@ -93,7 +93,7 @@ FcValueCanonicalize (const FcValue *v)
FcValue
FcValueSave (FcValue v)
{
- switch (v.type) {
+ switch ((int) v.type) {
case FcTypeString:
v.u.s = FcSharedStr (v.u.s);
if (!v.u.s)
@@ -140,7 +140,7 @@ FcValueListDestroy (FcValueListPtr l)
FcValueListPtr next;
for (; l; l = next)
{
- switch (l->value.type) {
+ switch ((int) l->value.type) {
case FcTypeString:
if (!FcSharedStrFree ((FcChar8 *)l->value.u.s))
FcStrFree ((FcChar8 *)l->value.u.s);
@@ -892,7 +892,7 @@ FcPatternObjectGetInteger (const FcPattern *p, FcObject object, int id, int *i)
r = FcPatternObjectGet (p, object, id, &v);
if (r != FcResultMatch)
return r;
- switch (v.type) {
+ switch ((int) v.type) {
case FcTypeDouble:
*i = (int) v.u.d;
break;
@@ -921,7 +921,7 @@ FcPatternObjectGetDouble (const FcPattern *p, FcObject object, int id, double *d
r = FcPatternObjectGet (p, object, id, &v);
if (r != FcResultMatch)
return r;
- switch (v.type) {
+ switch ((int) v.type) {
case FcTypeDouble:
*d = v.u.d;
break;
@@ -1293,7 +1293,7 @@ FcValueListSerializeAlloc (FcSerialize *serialize, const FcValueList *vl)
{
if (!FcSerializeAlloc (serialize, vl, sizeof (FcValueList)))
return FcFalse;
- switch (vl->value.type) {
+ switch ((int) vl->value.type) {
case FcTypeString:
if (!FcStrSerializeAlloc (serialize, vl->value.u.s))
return FcFalse;
@@ -1339,7 +1339,7 @@ FcValueListSerialize (FcSerialize *serialize, const FcValueList *vl)
vl_serialized->next = NULL;
vl_serialized->value.type = vl->value.type;
- switch (vl->value.type) {
+ switch ((int) vl->value.type) {
case FcTypeInteger:
vl_serialized->value.u.i = vl->value.u.i;
break;
diff --git a/src/fcxml.c b/src/fcxml.c
index 0ab590b..34b4b36 100644
--- a/src/fcxml.c
+++ b/src/fcxml.c
@@ -1175,7 +1175,7 @@ FcParseBlank (FcConfigParse *parse)
if (!parse->config->blanks)
goto bail;
}
- switch (v->tag) {
+ switch ((int) v->tag) {
case FcVStackInteger:
if (!FcBlanksAdd (parse->config->blanks, v->u.integer))
goto bail;
@@ -1368,7 +1368,7 @@ FcParseRange (FcConfigParse *parse)
FcConfigMessage (parse, FcSevereError, "too many elements in range");
return;
}
- switch (vstack->tag) {
+ switch ((int) vstack->tag) {
case FcVStackInteger:
n = vstack->u.integer;
break;
@@ -1435,7 +1435,7 @@ FcParseCharSet (FcConfigParse *parse)
while ((vstack = FcVStackPeek (parse)))
{
- switch (vstack->tag) {
+ switch ((int) vstack->tag) {
case FcVStackInteger:
if (!FcCharSetAddChar (charset, vstack->u.integer))
{
@@ -1479,7 +1479,7 @@ FcParseLangSet (FcConfigParse *parse)
while ((vstack = FcVStackPeek (parse)))
{
- switch (vstack->tag) {
+ switch ((int) vstack->tag) {
case FcVStackString:
if (!FcLangSetAdd (langset, vstack->u.string))
{
@@ -1602,7 +1602,7 @@ FcParseAlias (FcConfigParse *parse)
return;
while ((vstack = FcVStackPeek (parse)))
{
- switch (vstack->tag) {
+ switch ((int) vstack->tag) {
case FcVStackFamily:
if (family)
{
@@ -1731,7 +1731,7 @@ FcPopExpr (FcConfigParse *parse)
FcExpr *expr = 0;
if (!vstack)
return 0;
- switch (vstack->tag) {
+ switch ((int) vstack->tag) {
case FcVStackNone:
break;
case FcVStackString:
@@ -2349,7 +2349,7 @@ FcParseMatch (FcConfigParse *parse)
}
while ((vstack = FcVStackPeek (parse)))
{
- switch (vstack->tag) {
+ switch ((int) vstack->tag) {
case FcVStackTest:
vstack->u.test->next = test;
test = vstack->u.test;
@@ -2383,7 +2383,7 @@ FcParseAcceptRejectFont (FcConfigParse *parse, FcElement element)
while ((vstack = FcVStackPeek (parse)))
{
- switch (vstack->tag) {
+ switch ((int) vstack->tag) {
case FcVStackGlob:
if (!FcConfigGlobAdd (parse->config,
vstack->u.string,
@@ -2422,7 +2422,7 @@ FcPopValue (FcConfigParse *parse)
if (!vstack)
return value;
- switch (vstack->tag) {
+ switch ((int) vstack->tag) {
case FcVStackString:
value.u.s = FcSharedStr (vstack->u.string);
if (value.u.s)
@@ -2521,7 +2521,7 @@ FcParsePattern (FcConfigParse *parse)
while ((vstack = FcVStackPeek (parse)))
{
- switch (vstack->tag) {
+ switch ((int) vstack->tag) {
case FcVStackPattern:
if (!FcPatternAppend (pattern, vstack->u.pattern))
{
More information about the Fontconfig
mailing list