commit eb82a7ded424d0472ae3154b0f5d9c2f2b876a88
parent cf41f8945f1af8e02d5239172f65115584a796bd
Author: Drew DeVault <sir@cmpwn.com>
Date: Sun, 2 May 2021 13:58:04 -0400
Revert "eval_cast: fix integer -> float casts"
This reverts commit e22381505cb8c9e2d0598d3ff77e342b0376d6cb.
Diffstat:
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/src/eval.c b/src/eval.c
@@ -424,16 +424,7 @@ eval_cast(struct context *ctx, struct expression *in, struct expression *out)
case STORAGE_F32:
case STORAGE_F64:
case STORAGE_FCONST:
- if (type_is_float(val.result)) {
- out->constant.fval = ftrunc(to, val.constant.fval);
- } else if (type_is_signed(val.result)) {
- out->constant.fval =
- ftrunc(to, (double)val.constant.ival);
- } else {
- assert(type_is_integer(val.result));
- out->constant.fval =
- ftrunc(to, (double)val.constant.uval);
- }
+ out->constant.fval = ftrunc(to, val.constant.fval);
return EVAL_OK;
case STORAGE_CHAR:
case STORAGE_ENUM: