3 # Add include for mandatory header file
4 print "#include <smpi_cocci.h>\n";
6 # FIXME: here we make the assumption that people don't do things like put
7 # multiple statements on the same line after a declaration, but separated by
8 # semicolons. It's a reasonable assumption for the time being, but technically
9 # it could cause problems for some code.
11 OUTER: while ($line = <STDIN>) {
12 if ($line =~ /SMPI_VARINIT/) {
14 chomp $line; # kill carriage return
15 $line =~ s/\s+/ /g; # remove excessive whitespace added by spatch
16 while ($line =~ s/(SMPI_VARINIT[A-Z0-9_]*?\(.*?\))//) {
20 # if varinit continues on to next line
21 if ($line =~ /SMPI_VARINIT/) {
22 # should only happen for bad code...
23 if (!($nextline = <STDIN>)) {
29 } while ($line =~ /SMPI_VARINIT/);