From 797e336222fd5fd1dc4f5da49131381a3174068c Mon Sep 17 00:00:00 2001 From: svenbarth Date: Wed, 24 Jul 2019 20:32:17 +0000 Subject: [PATCH] * fix writing of floating point attribute parameters git-svn-id: trunk@42489 - --- compiler/ncon.pas | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/compiler/ncon.pas b/compiler/ncon.pas index 149b218151..f51ae9578d 100644 --- a/compiler/ncon.pas +++ b/compiler/ncon.pas @@ -525,17 +525,19 @@ implementation begin case tfloatdef(typedef).floattype of s32real: - tcb.emit_tai(tai_realconst.create_s32real(value_real),s32floattype); + tcb.emit_tai(tai_realconst.create_s32real(value_real),typedef); s64real: - tcb.emit_tai(tai_realconst.create_s64real(value_real),s64floattype); + tcb.emit_tai(tai_realconst.create_s64real(value_real),typedef); s80real: - tcb.emit_tai(tai_realconst.create_s80real(value_real,0),s80floattype); + tcb.emit_tai(tai_realconst.create_s80real(value_real,s80floattype.size),typedef); sc80real: - tcb.emit_tai(tai_const.Create_64bit(round(value_real)),sc80floattype); + tcb.emit_tai(tai_realconst.create_s80real(value_real,sc80floattype.size),typedef); s64comp: - tcb.emit_tai(tai_const.Create_64bit(round(value_real)),s64inttype); + { the round is necessary for native compilers where comp isn't a float } + tcb.emit_tai(tai_realconst.create_s64compreal(round(value_real)),typedef); s64currency: - tcb.emit_tai(tai_const.create_64bit(trunc(value_currency * 10000)),s64currencytype); + { we don't need to multiply by 10000 here } + tcb.emit_tai(tai_realconst.create_s64compreal(round(value_real)),typedef); s128real: internalerror(2019070804); end;