Revision 65de9931
Added by Pierre-Loïc Garoche about 5 years ago
src/backends/C/c_backend_common.ml | ||
---|---|---|
646 | 646 |
aux [] fmt (List.hd inputs).value_type |
647 | 647 |
end |
648 | 648 |
|
649 |
|
|
650 |
(*** Common functions for main ***) |
|
651 |
|
|
652 |
let print_put_var fmt file_suffix name var_type var_id = |
|
653 |
match (Types.unclock_type var_type).Types.tdesc with |
|
654 |
| Types.Tint -> fprintf fmt "_put_int(f_out%s, \"%s\", %s)" file_suffix name var_id |
|
655 |
| Types.Tbool -> fprintf fmt "_put_bool(f_out%s, \"%s\", %s)" file_suffix name var_id |
|
656 |
| Types.Treal when !Options.mpfr -> fprintf fmt "_put_double(f_out%s, \"%s\", mpfr_get_d(%s, %s), %i)" file_suffix name var_id (Mpfr.mpfr_rnd ()) !Options.print_prec_double |
|
657 |
| Types.Treal -> fprintf fmt "_put_double(f_out%s, \"%s\", %s, %i)" file_suffix name var_id !Options.print_prec_double |
|
658 |
| _ -> Format.eprintf "Impossible to print the _put_xx for type %a@.@?" Types.print_ty var_type; assert false |
|
659 |
|
|
649 | 660 |
(* Local Variables: *) |
650 | 661 |
(* compile-command:"make -C ../../.." *) |
651 | 662 |
(* End: *) |
Also available in: Unified diff
New feature to specify the number of digits to be printed