Fixing REAL_TO_INT conversion (behaved like a trunc and not like a round)
authorlaurent
Mon, 06 Jun 2011 16:29:08 +0200
changeset 541 24f111835805
parent 540 82fa901a2160
child 542 cce4903be769
Fixing REAL_TO_INT conversion (behaved like a trunc and not like a round)
plcopen/structures.py
--- a/plcopen/structures.py	Tue May 24 19:37:14 2011 +0200
+++ b/plcopen/structures.py	Mon Jun 06 16:29:08 2011 +0200
@@ -422,7 +422,12 @@
 
 ANY_TO_ANY_LIST=[
         # simple type conv are let as C cast
-        (("ANY_NUM","ANY_BIT"),("ANY_NUM","ANY_BIT"), ("return_type", "__move_", "IN_type")),
+        (("ANY_INT","ANY_BIT"),("ANY_NUM","ANY_BIT"), ("return_type", "__move_", "IN_type")),
+        (("ANY_REAL",),("ANY_REAL",), ("return_type", "__move_", "IN_type")),
+        # REAL_TO_INT
+        (("ANY_REAL",),("ANY_SINT",), ("return_type", "__real_to_sint", None)),
+        (("ANY_REAL",),("ANY_UINT",), ("return_type", "__real_to_uint", None)),
+        (("ANY_REAL",),("ANY_BIT",), ("return_type", "__real_to_bit", None)),
         # TO_TIME
         (("ANY_INT","ANY_BIT"),("ANY_DATE","TIME"), ("return_type", "__int_to_time", None)),
         (("ANY_REAL",),("ANY_DATE","TIME"), ("return_type", "__real_to_time", None)),