Parcourir la source

[cpp] Add explicit cast to Float

Hugh Sanderson il y a 6 ans
Parent
commit
0c73f5d676
1 fichiers modifiés avec 4 ajouts et 0 suppressions
  1. 4 0
      src/generators/gencpp.ml

+ 4 - 0
src/generators/gencpp.ml

@@ -7976,6 +7976,10 @@ class script_writer ctx filename asciiOut =
              this#writeOpLine IaCastInt;
              gen_expression expr;
 
+         | CppCastScalar(expr,"Float") ->
+            this#write ((this#op IaTCast) ^ (this#astType (TCppScalar("Float"))) ^ "\n");
+            gen_expression expr;
+
          | CppCastScalar(expr,_) -> match_expr expr
          | CppCastVariant(expr) -> match_expr expr
          | CppCastStatic(expr,_) -> match_expr expr