This is an example spatch which was used to remove the global Mach usage
It's no longer needed but it's useful to keep around.
It finds usages of waserror, ! waserror, or variables of type M
and inserts
Mach *m = machp();
in functions using those things.
Note for the variable case we assume it's named m; we were lucky in that
the Plan 9 source was consistent this way, due to the global declaration
in dat.h.
Note that there needs to be a
extern Mach *m;
somewhere in the file or spatch will not find variables of type Mach, hence
the Go program that finds files using m and inserts the declaration.
Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>