X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=matita%2Fcomponents%2Fextlib%2FhMarshal.ml;h=c61977894196571ed0dcd0f19653c5dfb2414342;hb=f34f2623a3133e235331d0c0c1830ec213dd09f1;hp=cb4976e7d42cebf853748145e98ff0c3b17669b5;hpb=7e6fea0332e132a8cb89c689ba68c5e884c4354c;p=helm.git diff --git a/matita/components/extlib/hMarshal.ml b/matita/components/extlib/hMarshal.ml index cb4976e7d..c61977894 100644 --- a/matita/components/extlib/hMarshal.ml +++ b/matita/components/extlib/hMarshal.ml @@ -46,8 +46,8 @@ let save ~fmt ~version ~fname data = HExtlib.chmod 0o664 fname let expect ic fname s = - let len = String.length s in - let buf = String.create len in + let len = Bytes.length s in + let buf = Bytes.create len in really_input ic buf 0 len; if buf <> s then raise (Corrupt_file fname) @@ -61,8 +61,8 @@ let load ~fmt ~version ~fname = if fmt' <> Hashtbl.hash fmt then raise (Format_mismatch fname); let version' = input_binary_int ic in (* field 2 *) if version' <> version then raise (Version_mismatch fname); - expect ic fname fmt; (* field 3 *) - expect ic fname (string_of_int version); (* field 4 *) + expect ic fname (Bytes.of_string fmt); (* field 3 *) + expect ic fname (Bytes.of_string (string_of_int version)); (* field 4 *) let checksum' = input_binary_int ic in (* field 5 *) let marshalled' = HExtlib.input_all ic in (* field 6 *) if checksum' <> Hashtbl.hash marshalled' then