Small fixes in the C backend

This commit is contained in:
Cédric Pasteur 2011-09-07 13:24:33 +02:00
parent 02c350de9a
commit 53043b403c
2 changed files with 3 additions and 1 deletions

View file

@ -242,6 +242,8 @@ and pp_cexpr fmt ce = match ce with
| Cbop (s, l, r) -> fprintf fmt "(%a%s%a)" pp_cexpr l s pp_cexpr r
| Cfun_call (s, el) ->
fprintf fmt "%a(@[%a@])" pp_string s (pp_list1 pp_cexpr ",") el
| Caddrof (Cderef e) -> pp_cexpr fmt e
| Cderef (Caddrof e) -> pp_cexpr fmt e
| Caddrof e -> fprintf fmt "&%a" pp_cexpr e
| Cstructlit (s, el) ->
fprintf fmt "(%a){@[%a@]}" pp_string s (pp_list1 pp_cexpr ",") el

View file

@ -118,7 +118,7 @@ let cvar_of_vd vd =
let inputlist_of_ovarlist vl =
let cvar_of_ovar vd =
let ty = ctype_of_otype vd.v_type in
let ty = if Linearity.is_linear vd.v_linearity then pointer_to ty else ty in
let ty = if vd.v_mutable then pointer_to ty else ty in
name vd.v_ident, ty
in
List.map cvar_of_ovar vl