From 835f9bbdbe7c023bce27f699c8906ace9b62a051 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sat, 22 Aug 2020 02:35:24 -0400 Subject: [PATCH] Fixup: Promote ints to ranges when appropriate Pointed out by Akira Tagoh. --- src/fccfg.c | 14 +++++++------- 1 file 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; }