Browse Source

* Prevent warning about automatic type conversion when using VAL with COMP type on x86.

git-svn-id: trunk@9540 -
yury 17 years ago
parent
commit
e5f8426f61
1 changed files with 8 additions and 3 deletions
  1. 8 3
      compiler/ninl.pas

+ 8 - 3
compiler/ninl.pas

@@ -1256,9 +1256,14 @@ implementation
 
 
           The implicit conversion is avoided for enums because implicit conversion between
           The implicit conversion is avoided for enums because implicit conversion between
           longint (which is what fpc_val_enum_shortstr returns) and enumerations is not
           longint (which is what fpc_val_enum_shortstr returns) and enumerations is not
-          possible. (DM).}
-        if destpara.resultdef.typ=enumdef then
-          tc:=ccallnode.createintern(procname,newparas)
+          possible. (DM).
+          
+          The implicit conversion is also avoided for COMP type if it is handled by FPU (x86)
+          to prevent warning about automatic type conversion. }
+        if (destpara.resultdef.typ=enumdef) or
+           ((destpara.resultdef.typ=floatdef) and (tfloatdef(destpara.resultdef).floattype=s64comp))
+          then
+            tc:=ccallnode.createintern(procname,newparas)
         else
         else
           tc:=ctypeconvnode.create(ccallnode.createintern(procname,newparas),destpara.left.resultdef);
           tc:=ctypeconvnode.create(ccallnode.createintern(procname,newparas),destpara.left.resultdef);
         addstatement(newstatement,cassignmentnode.create(
         addstatement(newstatement,cassignmentnode.create(