commit 0b334159ce567557c9b6fd2ad702d633f57d01a0
parent 5abe0fb26cf641d69178d5aa1a89e69cb1400071
Author: Drew DeVault <sir@cmpwn.com>
Date: Mon, 25 Jan 2021 16:30:21 -0500
eval: don't use itrunc for f32/f64
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/eval.c b/src/eval.c
@@ -307,8 +307,6 @@ eval_cast(struct context *ctx, struct expression *in, struct expression *out)
return EVAL_OK;
}
assert(0); // TODO
- case TYPE_STORAGE_F32:
- case TYPE_STORAGE_F64:
case TYPE_STORAGE_I16:
case TYPE_STORAGE_I32:
case TYPE_STORAGE_I64:
@@ -323,6 +321,8 @@ eval_cast(struct context *ctx, struct expression *in, struct expression *out)
case TYPE_STORAGE_SIZE:
out->constant.uval = itrunc(to, in->constant.uval);
return EVAL_OK;
+ case TYPE_STORAGE_F32:
+ case TYPE_STORAGE_F64:
case TYPE_STORAGE_CHAR:
case TYPE_STORAGE_ENUM:
case TYPE_STORAGE_NULL: