Release coccinelle-0.2.4
[bpt/coccinelle.git] / parsing_cocci / function_prototypes.ml
index 1bf76d7..a6c9a7b 100644 (file)
@@ -1,4 +1,30 @@
 (*
+ * Copyright 2010, INRIA, University of Copenhagen
+ * Julia Lawall, Rene Rydhof Hansen, Gilles Muller, Nicolas Palix
+ * Copyright 2005-2009, Ecole des Mines de Nantes, University of Copenhagen
+ * Yoann Padioleau, Julia Lawall, Rene Rydhof Hansen, Henrik Stuart, Gilles Muller, Nicolas Palix
+ * This file is part of Coccinelle.
+ *
+ * Coccinelle is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, according to version 2 of the License.
+ *
+ * Coccinelle is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Coccinelle.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * The authors reserve the right to distribute this or future versions of
+ * Coccinelle under other licenses.
+ *)
+
+
+(*
+ * Copyright 2010, INRIA, University of Copenhagen
+ * Julia Lawall, Rene Rydhof Hansen, Gilles Muller, Nicolas Palix
  * Copyright 2005-2009, Ecole des Mines de Nantes, University of Copenhagen
  * Yoann Padioleau, Julia Lawall, Rene Rydhof Hansen, Henrik Stuart, Gilles Muller, Nicolas Palix
  * This file is part of Coccinelle.
@@ -25,7 +51,7 @@ module Ast = Ast_cocci
 module V0 = Visitor_ast0
 module VT0 = Visitor_ast0_types
 
-type id = Id of string | Meta of (string * string)
+type id = Id of string | Meta of Ast.meta_name
 
 let rec get_name name =
   match Ast0.unwrap name with
@@ -233,7 +259,8 @@ let rec rename_param old_name all param =
          let new_id =
            Ast0.rewrap id
              (Ast0.MetaId
-                ((nm,arity,info,mcodekind,pos,adj),constraints,Ast0.Pure)) in
+                ((nm,arity,info,mcodekind,pos,adj),constraints,
+                 Ast0.Pure)) in
          ([Ast.MetaIdDecl(Ast.NONE,nm)],
           Ast0.rewrap param (Ast0.Param(ty,Some new_id)))
       |        _ -> ([],param))
@@ -243,9 +270,10 @@ let rec rename_param old_name all param =
       let new_id =
        Ast0.rewrap param
          (Ast0.MetaParamList(Ast0.rewrap_mcode d nm,
-                             Some (Ast0.rewrap_mcode d nml),
+                             Ast0.MetaListLen (Ast0.rewrap_mcode d nml),
                              Ast0.Pure)) in
-      ([Ast.MetaParamListDecl(Ast.NONE,nm,Some nml);Ast.MetaListlenDecl(nml)],
+      ([Ast.MetaParamListDecl(Ast.NONE,nm,Ast.MetaLen nml);
+        Ast.MetaListlenDecl(nml)],
        new_id)
   | Ast0.OptParam(p) ->
       let (metavars,p) = rename_param old_name all p in