From: Stephane Glondu <steph@glondu.net>
Date: Mon, 11 Nov 2019 16:06:21 +0100
Subject: Fix compilation with -safe-string

---
 concrete/mps.ml | 9 +++++----
 file.ml         | 2 +-
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/concrete/mps.ml b/concrete/mps.ml
index 708b20c..a2ed336 100644
--- a/concrete/mps.ml
+++ b/concrete/mps.ml
@@ -406,10 +406,10 @@ module BitMap = struct
   (* FIXME replace me by something more efficient *)
 
   (* encode our bitmap as a string (array of chars) *)
-  type t = string
+  type t = bytes
   (* a char '0' corresponds to '0', a char '1' corresponds to '1' *)
 
-  let mk n = String.make n '0'
+  let mk n = Bytes.make n '0'
 
   let set t n = t.[n] <- '1'
   let get t n = t.[n]
@@ -422,11 +422,11 @@ module BitMap = struct
     let l = String.length s in
     if i + my_len <= l then String.sub s i my_len
     else
-      let buf = String.make my_len '0' in
+      let buf = Bytes.make my_len '0' in
       for j = i to l - 1 do
         buf.[j-i] <- s.[j]
       done;
-      buf
+      Bytes.to_string buf
 
   let one_char t i =
     match safe_sub_four t i with
@@ -449,6 +449,7 @@ module BitMap = struct
     | _ -> assert false
 
   let chars t =
+    let t = Bytes.to_string t in
     let b = Buffer.create 5 in
     let rec aux k =
       let c = one_char t k in
diff --git a/file.ml b/file.ml
index 07d58ca..69ed7a9 100644
--- a/file.ml
+++ b/file.ml
@@ -8,7 +8,7 @@ module LowLevel = struct
   let copy src dest =
     let cin = open_in src
     and cout = open_out dest
-    and buff = String.make 1024 ' '
+    and buff = Bytes.make 1024 ' '
     and n = ref 0
     in
     while n := input cin buff 0 1024; !n <> 0 do
