From 5b842da394beaca4e8f2b45261bc10e88454c322 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Mon, 4 Jan 2021 00:21:48 +0900 Subject: [PATCH] [util] Fix types for double and float constants --- libs/util/cexpr-lex.l | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/util/cexpr-lex.l b/libs/util/cexpr-lex.l index cdae1ee04..2cbbdaa79 100644 --- a/libs/util/cexpr-lex.l +++ b/libs/util/cexpr-lex.l @@ -241,14 +241,14 @@ static exprval_t *parse_uint (const char *str, exprctx_t *context) static exprval_t *parse_float (const char *str, exprctx_t *context) { - exprval_t *val = cexpr_value (&cexpr_int, context); + exprval_t *val = cexpr_value (&cexpr_float, context); *(float *) val->value = strtof (str, 0); return val; } static exprval_t *parse_double (const char *str, exprctx_t *context) { - exprval_t *val = cexpr_value (&cexpr_int, context); + exprval_t *val = cexpr_value (&cexpr_double, context); *(double *) val->value = strtod (str, 0); return val; }