From 4d542bc7eafadb16b845cf05d1eb4988eb55ed0f Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Tue, 20 Oct 2015 13:32:18 +0200 Subject: Updated PR by removing whitespaces. Bug 17450. --- cparser/Rename.ml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'cparser/Rename.ml') diff --git a/cparser/Rename.ml b/cparser/Rename.ml index b0dc120f..4b387b0d 100644 --- a/cparser/Rename.ml +++ b/cparser/Rename.ml @@ -42,20 +42,20 @@ let enter_public env id = { re_id = IdentMap.add id id env.re_id; re_public = StringMap.add id.name id env.re_public; re_used = StringSet.add id.name env.re_used } - + let enter_static env id file = try let id' = StringMap.find id.name env.re_public in { env with re_id = IdentMap.add id id' env.re_id } with Not_found -> let file = String.map (fun a -> match a with 'a'..'z' | 'A'..'Z' | '0'..'9' -> a | _ -> '_') file in - let id' = {id with name = Printf.sprintf "_%s_%s" file id.name} in + let id' = {id with name = Printf.sprintf "_%s_%s" file id.name} in { re_id = IdentMap.add id id' env.re_id; re_public = env.re_public; re_used = StringSet.add id'.name env.re_used } (* For static or local identifiers, we make up a new name if needed *) -(* If the same identifier has already been declared, +(* If the same identifier has already been declared, don't rename a second time *) let rename env id = @@ -94,7 +94,7 @@ let ident env id = try IdentMap.find id env.re_id with Not_found -> - Cerrors.fatal_error "Internal error: Rename: %s__%d unbound" + Cerrors.fatal_error "Internal error: Rename: %s__%d unbound" id.name id.stamp let rec typ env = function @@ -111,7 +111,7 @@ let rec typ env = function | ty -> ty and param env (id, ty) = - if id.name = "" then + if id.name = "" then ((id, typ env ty), env) else let (id', env') = rename env id in ((id', typ env' ty), env') @@ -216,7 +216,7 @@ let fundef env f = fd_body = stmt env2 f.fd_body }, env0 ) -let enum env (id, v, opte) = +let enum env (id, v, opte) = let (id', env') = rename env id in ((id', v, optexp env' opte), env') @@ -269,7 +269,7 @@ let rec reserve_public env file = function begin match sto with | Storage_default | Storage_extern -> enter_public env id | Storage_static -> if !Clflags.option_rename_static then - enter_static env id file + enter_static env id file else env | _ -> assert false @@ -292,4 +292,4 @@ let program p file = globdecls (reserve_public (reserve_builtins()) file p) [] p - + -- cgit