Project

General

Profile

Revision 7ab1c5bd src/backends/C/c_backend_common.ml

View differences:

src/backends/C/c_backend_common.ml
647 647
    aux [] fmt (List.hd inputs).value_type
648 648
  end
649 649

  
650

  
651
(*** Common functions for main ***)
652

  
653
let print_put_var fmt file_suffix name var_type var_id =
654
  match (Types.unclock_type var_type).Types.tdesc with
655
  | Types.Tint -> fprintf fmt "_put_int(f_out%s, \"%s\", %s)" file_suffix name var_id
656
  | Types.Tbool -> fprintf fmt "_put_bool(f_out%s, \"%s\", %s)" file_suffix name var_id
657
  | 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
658
  | Types.Treal -> fprintf fmt "_put_double(f_out%s, \"%s\", %s, %i)" file_suffix name var_id !Options.print_prec_double
659
  | _ -> Format.eprintf "Impossible to print the _put_xx for type %a@.@?" Types.print_ty var_type; assert false
660

  
650 661
(* Local Variables: *)
651 662
(* compile-command:"make -C ../../.." *)
652 663
(* End: *)

Also available in: Unified diff