Skip to content

Commit

Permalink
Merge remote-tracking branch 'ygrek/warnings'
Browse files Browse the repository at this point in the history
Conflicts:
	compiler/gen_OCaml.ml

close #34
  • Loading branch information
mfp committed Feb 14, 2021
2 parents 7b79645 + 56a188a commit c69eb66
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 67 deletions.
2 changes: 1 addition & 1 deletion OMakefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ case $"\([0-9]\)\.\([0-9]+\)\."
OCAML_MINOR = $2
export

OCAMLFLAGS = -w +a-3-4-32-44-48 -warn-error +a-3-4-6-7-9-18-27..29-32..99
OCAMLFLAGS = -w +a-4-32-44-48 -warn-error +a-3-4-6-7-9-18-27..29-32..99
OCAMLOPTFLAGS = -g -inline 100
OCAMLCFLAGS += -g

Expand Down
2 changes: 1 addition & 1 deletion compiler/extprotc.ml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ let () =
let global_opts = if !nolocs then ["locs", "false"] else [] in
let global_opts = match !fieldmod with
| "" -> global_opts
| s -> ("field-module", String.capitalize s) :: global_opts in
| s -> ("field-module", String.capitalize_ascii s) :: global_opts in
let global_opts = if !export_tys then ("export_tys", "") :: global_opts else global_opts in
let global_opts = ("assume_subsets", !assume_subsets) :: global_opts in
let () =
Expand Down
120 changes: 61 additions & 59 deletions compiler/gen_OCaml.ml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion opam
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ depends: [
"ounit" {with-test}
"base64" {with-test}
"camlp4" {build}
("extlib" | "extlib-compat")
("extlib" {>= "1.7.7"} | "extlib-compat" {>="1.7.7"})
"base-bytes"
]
synopsis:
Expand Down
4 changes: 2 additions & 2 deletions runtime/error.ml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ let rec pp_location pp = function
| Field (field, loc) ->
PP.fprintf pp "@[<1>%s.@,%a@]" field pp_location loc
| Message (msg, constr, loc) -> match constr with
None -> PP.fprintf pp "@[<1>%s.@,%a@]" (String.capitalize msg) pp_location loc
None -> PP.fprintf pp "@[<1>%s.@,%a@]" (String.capitalize_ascii msg) pp_location loc
| Some c -> PP.fprintf pp "@[<1>%s_%s.@,%a@]"
(String.capitalize msg) (String.capitalize c) pp_location loc
(String.capitalize_ascii msg) (String.capitalize_ascii c) pp_location loc

let pp_format_error pp = function
| Bad_wire_type ty ->
Expand Down
2 changes: 1 addition & 1 deletion runtime/msg_buffer.ml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ let resize b more =
let add_char b c =
let pos = b.position in
if pos >= b.length then resize b 1;
b.buffer.[pos] <- c;
Bytes.set b.buffer pos c;
b.position <- pos + 1

let add_substring b s offset len =
Expand Down
4 changes: 2 additions & 2 deletions runtime/random_gen.ml
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ struct
let s = Bytes.create n in
let rec loop = function
n when n < 0 -> return @@ Bytes.unsafe_to_string s
| n -> rand_integer 255 >>= fun c -> s.[n] <- Char.chr c; loop (n - 1)
| n -> rand_integer 255 >>= fun c -> Bytes.set s n (Char.chr c); loop (n - 1)
in loop (n - 1)

let rand_readable_string len =
len >>= fun n ->
let s = Bytes.create n in
let rec loop = function
n when n < 0 -> return @@ Bytes.unsafe_to_string s
| n -> rand_integer (127 - 32) >>= fun c -> s.[n] <- Char.chr (32 + c); loop (n - 1)
| n -> rand_integer (127 - 32) >>= fun c -> Bytes.set s n (Char.chr (32 + c)); loop (n - 1)
in loop (n - 1)

let rand_int =
Expand Down

0 comments on commit c69eb66

Please sign in to comment.