summaryrefslogtreecommitdiff
path: root/lib/sbin/c_file_processor.pl
diff options
context:
space:
mode:
authorschnetter <schnetter@17b73243-c579-4c4c-a9d2-2d5706c11dac>2008-09-20 18:39:21 +0000
committerschnetter <schnetter@17b73243-c579-4c4c-a9d2-2d5706c11dac>2008-09-20 18:39:21 +0000
commit146c919b64d22ebf8c001388cb84b9b9420165d1 (patch)
treecbf8da0b2dd862ee3a2236648ae6b6ff655ea355 /lib/sbin/c_file_processor.pl
parentcf8d812cd25765755d174f24b0416498bab35d63 (diff)
Do not set the perl variable $* (turn all regexp matches into
multi-line matches), since this it not supported in Perl 5.10 any more. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4507 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/sbin/c_file_processor.pl')
-rw-r--r--lib/sbin/c_file_processor.pl29
1 files changed, 14 insertions, 15 deletions
diff --git a/lib/sbin/c_file_processor.pl b/lib/sbin/c_file_processor.pl
index 7f447710..a9e05804 100644
--- a/lib/sbin/c_file_processor.pl
+++ b/lib/sbin/c_file_processor.pl
@@ -34,7 +34,6 @@ $do_fix_fnames = 0;
# parse the file up to a ";\n"
$/ = ";\n";
-$* = 1;
while (<>)
{
@@ -44,22 +43,22 @@ while (<>)
# skip one-line comments
# (note that this is still incomplete for multi-line C comments -
# it is not checked if some code follows after the closing '*/')
- if ($mline !~ m/^\s*\/\// && $mline !~ m/^\s*\/\*.*\*\/\s*$/)
+ if ($mline !~ m/^\s*\/\//m && $mline !~ m/^\s*\/\*.*\*\/\s*$/m)
{
# Remove a ; from after the DECLARE_CCTK_* macros
- $mline =~ s/(DECLARE_CCTK_(PARAMETERS|ARGUMENTS))(\s*;)?/$1/;
+ $mline =~ s/(DECLARE_CCTK_(PARAMETERS|ARGUMENTS))(\s*;)?/$1/m;
# Remove a ; from after the fileversion macro
# such a semicolon could lead to warning messages.
- $mline =~ s/^\s*(CCTK_FILEVERSION\s*\([^)]*\))(\s*;)?/$1/;
- $mline =~ s/^\s*((ONE|TWO|THREE|FOUR|FIVE)_FORTSTRING_(CREATE|PTR)\s*\([^)]*\))(\s*;)?/$1/;
+ $mline =~ s/^\s*(CCTK_FILEVERSION\s*\([^)]*\))(\s*;)?/$1/m;
+ $mline =~ s/^\s*((ONE|TWO|THREE|FOUR|FIVE)_FORTSTRING_(CREATE|PTR)\s*\([^)]*\))(\s*;)?/$1/m;
# start counting braces
- $n_arg_left_braces++ while ($mline =~ m/({)/g);
- $n_arg_right_braces++ while ($mline =~ m/(})/g);
+ $n_arg_left_braces++ while ($mline =~ m/({)/gm);
+ $n_arg_right_braces++ while ($mline =~ m/(})/gm);
# check if we have to fix names of fortran wrappers
- $do_fix_fnames = 1 if ($mline =~ /(CCTK_FNAME|CCTK_FORTRAN_COMMON_NAME)/);
+ $do_fix_fnames = 1 if ($mline =~ /(CCTK_FNAME|CCTK_FORTRAN_COMMON_NAME)/m);
}
$routine .= $mline . "\n";
@@ -89,33 +88,33 @@ fixfnames ($routine);
sub fixfnames
{
my $myroutine = shift (@_);
- @flines = split /(;)/,$myroutine;
+ @flines = split /(;)/m,$myroutine;
# print $myroutine;
foreach $fline (@flines)
{
- while ($fline =~ m:CCTK_FNAME\s*\(([^\)]*)\):)
+ while ($fline =~ m:CCTK_FNAME\s*\(([^\)]*)\):m)
{
$arglist = $1;
- $arglist =~ s:[\s\n\t]+::g;
+ $arglist =~ s:[\s\n\t]+::gm;
@args = split(",", $arglist );
$new = &fortran_name($args[$#args]);
- $fline =~ s:CCTK_FNAME\s*\(([^\)]*)\):$new:;
+ $fline =~ s:CCTK_FNAME\s*\(([^\)]*)\):$new:m;
}
- while ($fline =~ m:CCTK_FORTRAN_COMMON_NAME\s*\(([^\)]*)\):)
+ while ($fline =~ m:CCTK_FORTRAN_COMMON_NAME\s*\(([^\)]*)\):m)
{
$arglist = $1;
- $arglist =~ s:[\s\n\t]+::g;
+ $arglist =~ s:[\s\n\t]+::gm;
@args = split(",", $arglist );
$new = &fortran_common_name($args[$#args]);
- $fline =~ s:CCTK_FORTRAN_COMMON_NAME\s*\(([^\)]*)\):$new:;
+ $fline =~ s:CCTK_FORTRAN_COMMON_NAME\s*\(([^\)]*)\):$new:m;
}
print $fline;