From a52704e8cad20d6aace53b8aa4fb695ba7bf677d Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sun, 24 Apr 2022 16:45:39 +0900 Subject: [PATCH] [cexpr] Allow assignment of double to float I didn't really want this, but it's needed for cvar support. --- libs/util/cexpr-type.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libs/util/cexpr-type.c b/libs/util/cexpr-type.c index cf622e786..97c15606f 100644 --- a/libs/util/cexpr-type.c +++ b/libs/util/cexpr-type.c @@ -328,6 +328,7 @@ float_div_quat (const exprval_t *val1, const exprval_t *val2, CASTOP (float, int) CASTOP (float, uint) +CASTOP (float, double) UNOP(float, pos, float, +) UNOP(float, neg, float, -) @@ -351,6 +352,7 @@ binop_t float_binops[] = { { MOD, &cexpr_float, &cexpr_float, float_mod }, { '=', &cexpr_int, &cexpr_float, float_cast_int }, { '=', &cexpr_uint, &cexpr_float, float_cast_uint }, + { '=', &cexpr_double, &cexpr_float, float_cast_double }, { '=', &cexpr_plitem, &cexpr_float, cexpr_cast_plitem }, {} };