Skip to content

Commit c36e48c

Browse files
authored
Merge pull request #53 from freddy77/minor
Miscellaneous minor changes
2 parents cc9d7d9 + d423cb0 commit c36e48c

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

client_unix/xs_client_unix.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ module Client = functor(IO: IO with type 'a t = 'a) -> struct
152152
let error fmt = Printf.ksprintf !logger fmt
153153
let set_logger f = logger := f
154154

155-
(* Represents a single acive connection to a server *)
155+
(* Represents a single active connection to a server *)
156156
type client = {
157157
transport: IO.channel;
158158
ps: PS.stream;

core/xs_protocol.ml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ module Op = struct
7272
| Restrict -> "restrict"
7373
end
7474

75-
let split_string ?limit:(limit=max_int) c s =
75+
let split_string ~limit c s =
7676
let len = String.length s in
7777
let next_c from =
7878
try
@@ -133,7 +133,7 @@ module ACL = struct
133133
if String.length s < 2
134134
then invalid_arg (Printf.sprintf "Permission string too short: '%s'" s);
135135
int_of_string (String.sub s 1 (String.length s - 1)), perm_of_char_exn s.[0] in
136-
let l = List.map perm_of_string (split_string '\000' s) in
136+
let l = List.map perm_of_string (String.split_on_char '\000' s) in
137137
match l with
138138
| (owner, other) :: l -> Some { owner = owner; other = other; acl = l }
139139
| [] -> Some { owner = 0; other = NONE; acl = [] }
@@ -174,7 +174,7 @@ let to_bytes pkt =
174174
set_header_rid result pkt.rid ;
175175
set_header_tid result pkt.tid ;
176176
set_header_len result (Int32.of_int len) ;
177-
Bytes.blit (Buffer.to_bytes pkt.data) 0 result sizeof_header len ;
177+
Buffer.blit pkt.data 0 result sizeof_header len ;
178178
result
179179

180180
let get_tid pkt = pkt.tid
@@ -489,7 +489,7 @@ module Request = struct
489489

490490
exception Parse_failure
491491

492-
let strings data = split_string '\000' data
492+
let strings data = String.split_on_char '\000' data
493493

494494
let one_string data =
495495
let args = split_string ~limit:2 '\000' data in
@@ -502,7 +502,7 @@ module Request = struct
502502
let args = split_string ~limit:2 '\000' data in
503503
match args with
504504
| a :: b :: [] -> a, b
505-
| a :: [] -> a, "" (* terminating NULL removed by get_data *)
505+
| a :: [] -> a, "" (* terminating NUL removed by get_data *)
506506
| _ ->
507507
raise Parse_failure
508508

@@ -619,7 +619,7 @@ module Request = struct
619619

620620
let data_of_payload = function
621621
| PathOp(path, Write value) ->
622-
path ^ "\000" ^ value (* no NULL at the end *)
622+
path ^ "\000" ^ value (* no NUL at the end *)
623623
| PathOp(path, Setperms perms) ->
624624
data_concat [ path; ACL.to_string perms ]
625625
| PathOp(path, _) -> data_concat [ path ]
@@ -663,7 +663,7 @@ module Unmarshal = struct
663663
let ok x = if x = "OK" then Some () else None
664664

665665
let string = some ++ get_data
666-
let list = some ++ split_string '\000' ++ get_data
666+
let list = some ++ String.split_on_char '\000' ++ get_data
667667
let acl = ACL.of_string ++ get_data
668668
let int = int_of_string_opt ++ get_data
669669
let int32 = int32_of_string_opt ++ get_data

server/store.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ module Node = struct
5353

5454
let replace_child node child nchild =
5555
(* this is the on-steroid version of the filter one-replace one *)
56-
let rec replace_one_in_list l =
56+
let[@tail_mod_cons] rec replace_one_in_list l =
5757
match l with
5858
| [] -> []
5959
| h :: tl when h.name = child.name -> nchild :: tl
@@ -63,7 +63,7 @@ module Node = struct
6363

6464
let del_childname node childname =
6565
let sym = Symbol.of_string childname in
66-
let rec delete_one_in_list l =
66+
let[@tail_mod_cons] rec delete_one_in_list l =
6767
match l with
6868
| [] -> raise Not_found
6969
| h :: tl when h.name = sym -> tl

0 commit comments

Comments
 (0)