From e12f9ca68d778c86382cbc16d33b6a9e4305ddd3 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Wed, 10 Sep 2014 15:03:55 +0200 Subject: [PATCH 1/2] Wrong type in ocaml --- src/ezfio.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ezfio.ml b/src/ezfio.ml index 537883e..dfc469e 100644 --- a/src/ezfio.ml +++ b/src/ezfio.ml @@ -273,7 +273,7 @@ let ezfio_array_of_list ~rank ~dim ~data = (Ezfio_data data,rest) in let (result,_) = read_nd data rank in - result + { rank=rank ; dim=dim ; data=result } ;; From 088c5ab63d51724de5502d93011126a8a296e482 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Mon, 15 Sep 2014 16:11:21 +0200 Subject: [PATCH 2/2] Added Int64 in ocaml --- src/ezfio.ml | 11 ++++++++--- src/f_types.py | 2 +- version | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/ezfio.ml b/src/ezfio.ml index dfc469e..72985eb 100644 --- a/src/ezfio.ml +++ b/src/ezfio.ml @@ -193,6 +193,7 @@ let fortran_string_of_bool = function ;; let read_int = read_scalar int_of_string ;; +let read_int64 = read_scalar Int64.of_string ;; let read_float = read_scalar float_of_string ;; let read_string= read_scalar (fun (x:string) -> x);; let read_bool = read_scalar fortran_bool_of_string;; @@ -202,10 +203,11 @@ Write ----- *) -let print_int out_channel i = Printf.fprintf out_channel "%16d\n" i -and print_float out_channel f = Printf.fprintf out_channel "%24.15e\n" f +let print_int out_channel i = Printf.fprintf out_channel "%16d\n" i +and print_int64 out_channel i = Printf.fprintf out_channel "%16Ld\n" i +and print_float out_channel f = Printf.fprintf out_channel "%24.15e\n" f and print_string out_channel s = Printf.fprintf out_channel "%s\n" s -and print_bool out_channel b = Printf.fprintf out_channel "%s\n" (fortran_string_of_bool b);; +and print_bool out_channel b = Printf.fprintf out_channel "%s\n" (fortran_string_of_bool b);; let write_scalar print_fun group name s = check_readonly; @@ -219,6 +221,7 @@ let write_scalar print_fun group name s = ;; let write_int = write_scalar print_int +and write_int64 = write_scalar print_int64 and write_float = write_scalar print_float and write_bool = write_scalar print_bool and write_string = write_scalar print_string @@ -391,6 +394,7 @@ let read_array type_conversion group name : 'a ezfio_array = ;; let read_int_array = read_array int_of_string +and read_int64_array = read_array Int64.of_string and read_float_array = read_array float_of_string and read_bool_array = read_array fortran_bool_of_string and read_string_array = read_array (fun (x:string) -> x) @@ -426,6 +430,7 @@ let write_array print_fun group name a = ;; let write_int_array = write_array print_int +and write_int64_array = write_array print_int64 and write_float_array = write_array print_float and write_string_array = write_array print_string and write_bool_array = write_array print_bool;; diff --git a/src/f_types.py b/src/f_types.py index 33838cb..d1c5d43 100644 --- a/src/f_types.py +++ b/src/f_types.py @@ -58,7 +58,7 @@ f2c = { f2ocaml = { 'in' : 'int', 're' : 'float', -'i8' : 'int', +'i8' : 'int64', 'do' : 'float', 'ch' : 'string', 'lo' : 'bool' diff --git a/version b/version index bd2a41c..bce4aa5 100644 --- a/version +++ b/version @@ -1 +1 @@ -VERSION=1.1.5 +VERSION=1.1.6