Skip to content

Commit 359b4c0

Browse files
authored
Merge pull request #135 from gaborigloi/remove_warnings
Fix OCaml compiler warnings
2 parents cddd319 + 74c51dc commit 359b4c0

File tree

6 files changed

+6
-8
lines changed

6 files changed

+6
-8
lines changed

example/example.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,3 @@ let _ =
6868
| `Error m ->
6969
Printf.fprintf stderr "Error: %s\n%!" m;
7070
exit 1
71-
()

lib/cohttp_posix_io.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ module Unbuffered_IO = struct
105105
remaining = 0 || (n > 0 && (read_into_exactly ic buf (ofs + n) (len - n)))
106106

107107
let read_exactly ic len =
108-
let buf = String.create len in
108+
let buf = Bytes.create len in
109109
read_into_exactly ic buf 0 len >>= function
110110
| true -> return (Some buf)
111111
| false -> return None
@@ -147,7 +147,7 @@ module Buffered_IO = struct
147147
let read_into_exactly ic buf ofs len = try really_input ic buf ofs len; true with _ -> false
148148

149149
let read_exactly ic len =
150-
let buf = String.create len in
150+
let buf = Bytes.create len in
151151
read_into_exactly ic buf 0 len >>= function
152152
| true -> return (Some buf)
153153
| false -> return None

lib/posix_channel.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module CBuf = struct
1616
}
1717

1818
let empty length = {
19-
buffer = String.create length;
19+
buffer = Bytes.create length;
2020
len = 0;
2121
start = 0;
2222
r_closed = false;

lib/syslog.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ let level_of_string s =
5454
| "emergency" -> Emerg
5555
| "alert" -> Alert
5656
| "critical" -> Crit
57-
| "debug" -> Debug;
5857
| "error" | "err" -> Err
5958
| "warning" | "warn" -> Warning
6059
| "notice" -> Notice

lib_test/debug_test.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ let test_debug_set_level () =
6464

6565

6666
let test_debug_set_level_multiple_loggers () =
67-
let a = (module Debug.Make(struct let name = "aaaa" end) : Debug.DEBUG) in
68-
let b = (module Debug.Make(struct let name = "bbbb" end) : Debug.DEBUG) in
67+
let _ = (module Debug.Make(struct let name = "aaaa" end) : Debug.DEBUG) in
68+
let _ = (module Debug.Make(struct let name = "bbbb" end) : Debug.DEBUG) in
6969
Debug.reset_levels ();
7070

7171
assert_levels "aaaa" (false, false, false, false);

network/network_stats.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ module File_helpers = struct
8888
(** [fd_blocks_fold block_size f start fd] folds [f] over blocks (strings)
8989
from the fd [fd] with initial value [start] *)
9090
let fd_blocks_fold block_size f start fd =
91-
let block = String.create block_size in
91+
let block = Bytes.create block_size in
9292
let rec fold acc =
9393
let n = Unix.read fd block 0 block_size in
9494
(* Consider making the interface explicitly use Substrings *)

0 commit comments

Comments
 (0)