2
0
Эх сурвалжийг харах

* fix writing of floating point attribute parameters

git-svn-id: trunk@42489 -
svenbarth 6 жил өмнө
parent
commit
797e336222

+ 8 - 6
compiler/ncon.pas

@@ -525,17 +525,19 @@ implementation
       begin
       begin
         case tfloatdef(typedef).floattype of
         case tfloatdef(typedef).floattype of
           s32real:
           s32real:
-            tcb.emit_tai(tai_realconst.create_s32real(value_real),s32floattype);
+            tcb.emit_tai(tai_realconst.create_s32real(value_real),typedef);
           s64real:
           s64real:
-            tcb.emit_tai(tai_realconst.create_s64real(value_real),s64floattype);
+            tcb.emit_tai(tai_realconst.create_s64real(value_real),typedef);
           s80real:
           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:
           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:
           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:
           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:
           s128real:
             internalerror(2019070804);
             internalerror(2019070804);
         end;
         end;