Here's the .spatch I've used:

_________________
@@
identifier a;
@@
- struct old_thing a;
+ struct new_thing a;

@@
identifier b;
@@
- struct old_thing *b;
+ struct new_thing *b;

@@
function f;
identifier c;
@@
- f(... struct old_thing *c ...);
+ f(... struct new_thing *c ...);

_________________

I've run it as "spatch --in-place --sp-file test.spatch -I include --dir src" to apply to all source and include files at the same time.

The first 2 patchers work fine replacing all the variable declarations inside functions and structs as expected. But they do not affect function type signature which I'm trying to correct with the 3rd patcher but it gives me exception Lexer_cocci.Lexical("invalid in a + context: ...") error.

I've tried using expression instead of function but it seems like I'm applying "..." operator wrong. I've seen example doing somewhat similar with elementary types but I'm at loss as to how to apply this to struct pointers.

--
- Max Suraev <[email protected]>       http://www.sysmocom.de/
=======================================================================
* sysmocom - systems for mobile communications GmbH
* Alt-Moabit 93
* 10559 Berlin, Germany
* Sitz / Registered office: Berlin, HRB 134158 B
* Geschaeftsfuehrer / Managing Directors: Harald Welte

_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to