1 // run with the options -no_show_diff and -dir {directory}
7 let tbl = Hashtbl.create(100)
9 let add_if_not_present from f file =
10 try let _ = Hashtbl.find tbl (f,file) in ()
12 Hashtbl.add tbl (f,file) file;
13 let it = new iteration() in
15 Some fl -> it#set_files [fl]
17 it#add_virtual_rule After_start;
18 it#add_virtual_identifier Err_ptr_function f;
21 @r depends on !after_start exists@
26 fn@p(...) { <+... return (ERR_PTR(...)); ...+> }
33 static fn@p(...) { ... }
35 @script:ocaml depends on statfns@
40 add_if_not_present "ERR_PTR" fn (Some ((List.hd p).file))
42 @script:ocaml depends on !statfns@
47 add_if_not_present "ERR_PTR" fn None
49 // -----------------------------------------------------------------------
52 @s depends on after_start exists@
53 identifier virtual.err_ptr_function, fn;
57 fn@p(...) { <+... return err_ptr_function(...); ...+> }
64 static fn@p(...) { ... }
66 @script:ocaml depends on statfns_call@
69 err_ptr_function << virtual.err_ptr_function;
72 add_if_not_present err_ptr_function fn (Some ((List.hd p).file))
74 @script:ocaml depends on !statfns_call@
77 err_ptr_function << virtual.err_ptr_function;
80 add_if_not_present err_ptr_function fn None
82 // -----------------------------------------------------------------------
85 @e depends on after_start exists@
86 identifier virtual.err_ptr_function;
93 IS_ERR(x = err_ptr_function(...))
95 x@p1 = err_ptr_function(...)
109 cocci.print_main("def",p1)
110 cocci.print_secs("ref",p2)