apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject cvs commit: apr/build cvtdsp.pl
Date Thu, 12 Apr 2001 13:57:16 GMT
wrowe       01/04/12 06:57:16

  Modified:    build    cvtdsp.pl
  Log:
    Add -w3 -w4 options to toggle all .dsp files to build with higher or
    lower order error checking.  Don't commit back -w4 versions :-)
  
  Revision  Changes    Path
  1.2       +73 -8     apr/build/cvtdsp.pl
  
  Index: cvtdsp.pl
  ===================================================================
  RCS file: /home/cvs/apr/build/cvtdsp.pl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- cvtdsp.pl	2001/04/07 01:03:15	1.1
  +++ cvtdsp.pl	2001/04/12 13:57:15	1.2
  @@ -4,14 +4,19 @@
   if ($ARGV[0] == '-6') {
       find(\&tovc6, '.');
   }
  +elsif ($ARGV[0] == '-5') {
  +    find(\&tovc5, '.');
  +}
  +elsif ($ARGV[0] == '-w3') {
  +    find(\&tow3, '.');
  +}
  +elsif ($ARGV[0] == '-w4') {
  +    find(\&tow4, '.');
  +}
   else {
  -    if ($ARGV[0] == '-5') {
  -        find(\&tovc5, '.');
  -    }
  -    else {
  -        print "Specify -5 or -6 for Visual Studio 5 or 6 (98) .dsp format\n\n";
  -        die "Missing argument";
  -    }
  +    print "Specify -5 or -6 for Visual Studio 5 or 6 (98) .dsp format\n";
  +    print "Specify -w3 or -w4 for .dsp build with warning level 3 or 4 (strict)\n\n";
  +    die "Missing argument";
   }
   
   sub tovc5 { 
  @@ -36,7 +41,6 @@
   		print $dstfl $src; }
   	    else {
   		$verchg = -1;
  -
   	    }
   	}
   	undef $srcfl;
  @@ -92,3 +96,64 @@
   	}
       }
   }
  +
  +sub tow3 { 
  +
  +    if (m|.dsp$|) {
  +        $oname = $_;
  +	$tname = '.#' . $_;
  +        $verchg = 0;
  +	$srcfl = new IO::File $oname, "r" || die;
  +	$dstfl = new IO::File $tname, "w" || die;
  +	while ($src = <$srcfl>) {
  +	    if ($src =~ s|^(# ADD CPP .*)/W4 (.*)|$1/W3 $2|) {
  +		$verchg = -1;
  +	    }
  +	    if ($src =~ s|^(# ADD BASE CPP .*)/W4 (.*)|$1/W3 $2|) {
  +		$verchg = -1;
  +	    }
  +            print $dstfl $src; 
  +	}
  +	undef $srcfl;
  +	undef $dstfl;
  +	if ($verchg) {
  +	    unlink $oname || die;
  +	    rename $tname, $oname || die;
  +	    print "Converted project " . $oname . " to warn:3 in " . $File::Find::dir . "\n";

  +	}
  +	else {
  +	    unlink $tname;
  +	}
  +    }
  +}
  +
  +sub tow4 { 
  +
  +    if (m|.dsp$|) {
  +        $oname = $_;
  +	$tname = '.#' . $_;
  +        $verchg = 0;
  +	$srcfl = new IO::File $oname, "r" || die;
  +	$dstfl = new IO::File $tname, "w" || die;
  +	while ($src = <$srcfl>) {
  +	    if ($src =~ s|^(# ADD CPP .*)/W3 (.*)|$1/W4 $2|) {
  +		$verchg = -1;
  +	    }
  +	    if ($src =~ s|^(# ADD BASE CPP .*)/W3 (.*)|$1/W4 $2|) {
  +		$verchg = -1;
  +	    }
  +            print $dstfl $src; 
  +	}
  +	undef $srcfl;
  +	undef $dstfl;
  +	if ($verchg) {
  +	    unlink $oname || die;
  +	    rename $tname, $oname || die;
  +	    print "Converted project " . $oname . " to warn:4 " . $File::Find::dir . "\n"; 
  +	}
  +	else {
  +	    unlink $tname;
  +	}
  +    }
  +}
  +
  
  
  

Mime
View raw message