Pārlūkot izejas kodu

fixed Y warnings.

Nicolas Cannasse 20 gadi atpakaļ
vecāks
revīzija
b8da815cf3
2 mainītis faili ar 3 papildinājumiem un 14 dzēšanām
  1. 1 3
      genswf8.ml
  2. 2 11
      typer.ml

+ 1 - 3
genswf8.ml

@@ -255,7 +255,6 @@ let func ctx need_super args =
 	} in
 	write ctx (AFunction2 f);
 	let start_pos = ctx.code_pos in
-	let op_pos = DynArray.length ctx.opcodes - 1 in
 	let old_stack = ctx.fun_stack in
 	let old_rmax = ctx.reg_max in
 	ctx.fun_stack <- ctx.stack_size;
@@ -282,7 +281,6 @@ let open_block ctx =
 let begin_loop ctx =
 	let old_breaks = ctx.breaks in
 	let old_cont = ctx.continues in
-	let old_stack = ctx.loop_stack in
 	ctx.breaks <- [];
 	ctx.continues <- [];
 	ctx.loop_stack <- ctx.stack_size;
@@ -760,7 +758,7 @@ and gen_unop ctx retval op flag e =
 			let k = gen_access ctx false e in
 			getvar ctx k
 		end;
-		let k = gen_access ctx false e in
+		ignore(gen_access ctx false e);
 		let k = gen_access ctx false e in
 		getvar ctx k;
 		write ctx (match op with Increment -> AIncrement | Decrement -> ADecrement | _ -> assert false);

+ 2 - 11
typer.ml

@@ -537,15 +537,6 @@ and type_unop ctx op flag e p =
 and type_switch ctx e cases def need_val p =
 	let e = type_expr ctx e in
 	let t = (if need_val then mk_mono() else t_void ctx) in
-	let constr name = 
-		let rec loop l =
-			match l with
-			| [] -> raise Not_found
-			| (_,TEnumDecl e) :: l -> if PMap.mem name e.e_constrs then e else loop l
-			| _ :: l -> loop l
-		in
-		loop ctx.local_types
-	in
 	let rec lookup_enum l =
 		match l with
 		| [] -> None
@@ -1013,11 +1004,11 @@ let type_module ctx m tdecls =
 			let m = load ctx t p in
 			ctx.local_types <- ctx.local_types @ m.mtypes
 		| EClass (name,types,herits,fields) ->
-			let c = List.find (fun (_,d) -> match d with TClassDecl ({ cl_path = _ , n } as c) -> n = name | _ -> false) m.mtypes in
+			let c = List.find (fun (_,d) -> match d with TClassDecl { cl_path = _ , n } -> n = name | _ -> false) m.mtypes in
 			let c = (match snd c with TClassDecl c -> c | _ -> assert false) in
 			delays := !delays @ check_overloading c p :: check_interfaces c p :: init_class ctx c p types herits fields
 		| EEnum (name,types,constrs) ->
-			let e = List.find (fun (_,d) -> match d with TEnumDecl ({ e_path = _ , n } as e) -> n = name | _ -> false) m.mtypes in
+			let e = List.find (fun (_,d) -> match d with TEnumDecl { e_path = _ , n } -> n = name | _ -> false) m.mtypes in
 			let e = (match snd e with TEnumDecl e -> e | _ -> assert false) in
 			ctx.type_params <- [];
 			e.e_types <- List.map (type_type_params ctx e.e_path p) types;