ソースを参照

Cast int constants to int

Hugh Sanderson 14 年 前
コミット
3276c8d705
1 ファイル変更1 行追加1 行削除
  1. 1 1
      gencpp.ml

+ 1 - 1
gencpp.ml

@@ -1270,7 +1270,7 @@ and gen_expression ctx retval expression =
 
 	| TConst const ->
 		(match const with
-		| TInt i -> output (Printf.sprintf "%ld" i)
+		| TInt i -> output (Printf.sprintf "(int)%ld" i)
 		| TFloat float_as_string -> output float_as_string
 		| TString s -> output (str s)
 		| TBool b -> output (if b then "true" else "false")