Skip to content

Commit

Permalink
Fix deprecation warnings on newer OCaml compiler.
Browse files Browse the repository at this point in the history
  • Loading branch information
nadako committed Mar 1, 2014
1 parent 10b3ef8 commit 16e8308
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion gencommon.ml
Expand Up @@ -2177,7 +2177,7 @@ struct
| OpNotEq -> (* != -> !equals() *)
mk_paren { eexpr = TUnop(Ast.Not, Prefix, (equals_handler (run e1) (run e2))); etype = gen.gcon.basic.tbool; epos = e.epos }
| OpAdd ->
if handle_strings && (is_string e.etype or is_string e1.etype or is_string e2.etype) then
if handle_strings && (is_string e.etype || is_string e1.etype || is_string e2.etype) then
{ e with eexpr = TBinop(op, mk_cast gen.gcon.basic.tstring (run e1), mk_cast gen.gcon.basic.tstring (run e2)) }
else
dyn_plus_handler e (run e1) (run e2)
Expand Down
10 changes: 5 additions & 5 deletions gencs.ml
Expand Up @@ -1976,7 +1976,7 @@ let configure gen =
in

let module_gen w md_def =
List.fold_left (fun should md -> module_type_gen w md or should) false md_def.m_types
List.fold_left (fun should md -> module_type_gen w md || should) false md_def.m_types
in

(* generate source code *)
Expand Down Expand Up @@ -2307,16 +2307,16 @@ let configure gen =
| _, TConst(TNull) when is_null_expr e1 ->
false
| _ ->
should_handle_opeq e1.etype or should_handle_opeq e2.etype
should_handle_opeq e1.etype || should_handle_opeq e2.etype
)
| TBinop (Ast.OpAssignOp Ast.OpAdd, e1, e2) ->
is_dynamic_expr e1 || is_null_expr e1 || is_string e.etype
| TBinop (Ast.OpAdd, e1, e2) -> is_dynamic e1.etype or is_dynamic e2.etype or is_type_param e1.etype or is_type_param e2.etype or is_string e1.etype or is_string e2.etype or is_string e.etype
| TBinop (Ast.OpAdd, e1, e2) -> is_dynamic e1.etype || is_dynamic e2.etype || is_type_param e1.etype || is_type_param e2.etype || is_string e1.etype || is_string e2.etype || is_string e.etype
| TBinop (Ast.OpLt, e1, e2)
| TBinop (Ast.OpLte, e1, e2)
| TBinop (Ast.OpGte, e1, e2)
| TBinop (Ast.OpGt, e1, e2) -> is_dynamic e.etype or is_dynamic_expr e1 or is_dynamic_expr e2 or is_string e1.etype or is_string e2.etype
| TBinop (_, e1, e2) -> is_dynamic e.etype or is_dynamic_expr e1 or is_dynamic_expr e2
| TBinop (Ast.OpGt, e1, e2) -> is_dynamic e.etype || is_dynamic_expr e1 || is_dynamic_expr e2 || is_string e1.etype || is_string e2.etype
| TBinop (_, e1, e2) -> is_dynamic e.etype || is_dynamic_expr e1 || is_dynamic_expr e2
| TUnop (_, _, e1) -> is_dynamic_expr e1 || is_null_expr e1 (* we will see if the expression is Null<T> also, as the unwrap from Unop will be the same *)
| _ -> false)
(fun e1 e2 ->
Expand Down
6 changes: 3 additions & 3 deletions genjava.ml
Expand Up @@ -1951,12 +1951,12 @@ let configure gen =
(DynamicOperators.abstract_implementation gen (fun e -> match e.eexpr with
| TBinop (Ast.OpEq, e1, e2)
| TBinop (Ast.OpAdd, e1, e2)
| TBinop (Ast.OpNotEq, e1, e2) -> is_dynamic e1.etype or is_dynamic e2.etype or is_type_param e1.etype or is_type_param e2.etype
| TBinop (Ast.OpNotEq, e1, e2) -> is_dynamic e1.etype || is_dynamic e2.etype || is_type_param e1.etype || is_type_param e2.etype
| TBinop (Ast.OpLt, e1, e2)
| TBinop (Ast.OpLte, e1, e2)
| TBinop (Ast.OpGte, e1, e2)
| TBinop (Ast.OpGt, e1, e2) -> is_dynamic e.etype or is_dynamic_expr e1 or is_dynamic_expr e2 or is_string e1.etype or is_string e2.etype
| TBinop (_, e1, e2) -> is_dynamic e.etype or is_dynamic_expr e1 or is_dynamic_expr e2
| TBinop (Ast.OpGt, e1, e2) -> is_dynamic e.etype || is_dynamic_expr e1 || is_dynamic_expr e2 || is_string e1.etype || is_string e2.etype
| TBinop (_, e1, e2) -> is_dynamic e.etype || is_dynamic_expr e1 || is_dynamic_expr e2
| TUnop (_, _, e1) -> is_dynamic_expr e1
| _ -> false)
(fun e1 e2 ->
Expand Down
6 changes: 3 additions & 3 deletions genphp.ml
Expand Up @@ -288,7 +288,7 @@ let escape_bin s =
let b = Buffer.create 0 in
for i = 0 to String.length s - 1 do
match Char.code (String.unsafe_get s i) with
| c when c = Char.code('\\') or c = Char.code('"') or c = Char.code('$') ->
| c when c = Char.code('\\') || c = Char.code('"') || c = Char.code('$') ->
Buffer.add_string b "\\";
Buffer.add_char b (Char.chr c)
| c when c < 32 ->
Expand Down Expand Up @@ -2221,7 +2221,7 @@ let generate com =
if static then
(n = (prefixed_name false))
else
((n = (prefixed_name false)) or (n = (prefixed_name true)))
((n = (prefixed_name false)) || (n = (prefixed_name true)))
) !lc_names in
unsupported ("method '" ^ (s_type_path c.cl_path) ^ "." ^ cf.cf_name ^ "' already exists here '" ^ (fst lc) ^ "' (different case?)") c.cl_pos
with Not_found ->
Expand Down Expand Up @@ -2300,7 +2300,7 @@ let generate com =
newline ctx;
gen_expr ctx e);
List.iter (generate_static_field_assign ctx c.cl_path) c.cl_ordered_statics;
if c.cl_path = (["php"], "Boot") & com.debug then begin
if c.cl_path = (["php"], "Boot") && com.debug then begin
newline ctx;
print ctx "$%s = new _hx_array(array())" ctx.stack.Codegen.stack_var;
newline ctx;
Expand Down

0 comments on commit 16e8308

Please sign in to comment.