summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-08-22 02:35:24 -0400
committerMatthias Clasen <mclasen@redhat.com>2020-08-25 12:15:45 -0400
commit835f9bbdbe7c023bce27f699c8906ace9b62a051 (patch)
tree9c6059d0c6c95c5531649a9becec850eb09f5a7b
parent148ebf98edb498d786f4c1107ec116e1afdf9541 (diff)
downloadfontconfig-835f9bbdbe7c023bce27f699c8906ace9b62a051.tar.gz
Fixup: Promote ints to ranges when appropriate
Pointed out by Akira Tagoh.
-rw-r--r--src/fccfg.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/fccfg.c b/src/fccfg.c
index 13bd0ff..f86f680 100644
--- a/src/fccfg.c
+++ b/src/fccfg.c
@@ -939,6 +939,13 @@ FcConfigPromote (FcValue v, FcValue u, FcValuePromotionBuffer *buf)
case FcTypeInteger:
v.type = FcTypeDouble;
v.u.d = (double) v.u.i;
+ /* Fallthrough */
+ case FcTypeDouble:
+ if (u.type == FcTypeRange && buf)
+ {
+ v.u.r = FcRangePromote (v.u.d, buf);
+ v.type = FcTypeRange;
+ }
break;
case FcTypeVoid:
if (u.type == FcTypeMatrix)
@@ -964,13 +971,6 @@ FcConfigPromote (FcValue v, FcValue u, FcValuePromotionBuffer *buf)
v.type = FcTypeLangSet;
}
break;
- case FcTypeDouble:
- if (u.type == FcTypeRange && buf)
- {
- v.u.r = FcRangePromote (v.u.d, buf);
- v.type = FcTypeRange;
- }
- break;
default:
break;
}