This change reverts
9acc14c34a372b54f9075ec3611588298fb2a501
because it doesn't work as expected when building
with -fshort-enums which is default for older arms ABIs
Thanks for pointing this out, Thomas Klausner, Valery Ushakov, and Martin Husemann
__o__ = va_arg (va, const char *); \
if (!__o__) \
break; \
- __v__.type = va_arg (va, FcType); \
+ __v__.type = va_arg (va, int); \
switch (__v__.type) { \
+ case FcTypeUnknown: \
case FcTypeVoid: \
goto _FcPatternVapBuild_bail1; \
case FcTypeInteger: \
#define FC_LCD_LEGACY 3
typedef enum _FcType {
+ FcTypeUnknown = -1,
FcTypeVoid,
FcTypeInteger,
FcTypeDouble,
FcBool
FcConfigCompareValue (const FcValue *left_o,
- FcOp op_,
+ unsigned int op_,
const FcValue *right_o)
{
FcValue left = FcValueCanonicalize(left_o);
if (left.type == right.type)
{
switch (left.type) {
+ case FcTypeUnknown:
+ break; /* No way to guess how to compare for this object */
case FcTypeInteger:
break; /* FcConfigPromote prevents this from happening */
case FcTypeDouble:
_FcValuePrintFile (FILE *f, const FcValue v)
{
switch (v.type) {
+ case FcTypeUnknown:
+ fprintf (f, "<unknown>");
+ break;
case FcTypeVoid:
fprintf (f, "<void>");
break;
case FcValueBindingSame:
printf ("(=)");
break;
+ default:
+ /* shouldn't be reached */
+ printf ("(?)");
+ break;
}
}
FC_ASSERT_STATIC (sizeof (FcRef) == sizeof (int));
typedef enum _FcValueBinding {
- FcValueBindingWeak, FcValueBindingStrong, FcValueBindingSame
+ FcValueBindingWeak, FcValueBindingStrong, FcValueBindingSame,
+ /* to make sure sizeof (FcValueBinding) == 4 even with -fshort-enums */
+ FcValueBindingEnd = 0xffffffff
} FcValueBinding;
#define FcStrdup(s) ((FcChar8 *) strdup ((const char *) (s)))
FcPrivate FcBool
FcConfigCompareValue (const FcValue *m,
- FcOp op,
+ unsigned int op_,
const FcValue *v);
FcPrivate FcBool
{
FcValue v = FcValueCanonicalize(value);
switch (v.type) {
+ case FcTypeUnknown:
case FcTypeVoid:
return 0;
case FcTypeInteger:
if (t) {
switch ((int) t->type) {
+ case FcTypeUnknown:
+ return FcTrue;
case FcTypeDouble:
case FcTypeInteger:
if (type == FcTypeDouble || type == FcTypeInteger)
return FcTrue;
break;
default:
- if ((unsigned int) t->type == (unsigned int) -1 || type == t->type)
+ if (type == t->type)
return FcTrue;
break;
}
FcValue v = FcValueCanonicalize(v0);
switch (v.type) {
+ case FcTypeUnknown:
case FcTypeVoid:
return FcTrue;
case FcTypeInteger:
return NULL;
ot->object.object = (const char *) FcStrdup (str);
- ot->object.type = -1;
+ ot->object.type = FcTypeUnknown;
ot->id = fc_atomic_int_add (next_id, +1);
ot->next = ots;
return FcFalse;
}
switch (va.type) {
+ case FcTypeUnknown:
+ return FcFalse; /* don't know how to compare this object */
case FcTypeVoid:
return FcTrue;
case FcTypeInteger:
FcValueHash (const FcValue *v)
{
switch (v->type) {
+ case FcTypeUnknown:
case FcTypeVoid:
return 0;
case FcTypeInteger:
case FcTypeLangSet:
return FcLangSetHash (FcValueLangSet(v));
}
- return FcFalse;
+ return 0;
}
static FcBool
FcMatchKind kind,
FcQual qual,
const FcChar8 *field,
- FcOp compare,
+ unsigned int compare,
FcExpr *expr)
{
FcTest *test = (FcTest *) malloc (sizeof (FcTest));