diff tools/incpri.pl @ 491:a379da780856

cond signed/unsigned
author kono
date Wed, 21 Dec 2005 11:33:53 +0900
parents 7c3d8237b625
children e055df7c1082
line wrap: on
line diff
--- a/tools/incpri.pl	Tue Dec 20 17:25:37 2005 +0900
+++ b/tools/incpri.pl	Wed Dec 21 11:33:53 2005 +0900
@@ -1,8 +1,15 @@
 #!/usr/bin/perl
-$d = "0000";
-while(<>) {
-   s/printf\(\"\#\d+\:/printf\(\"\#$d\:/;
-   s/printf\(\"([^#])/printf\(\"\#$d\:$1/;
-   $d++;
-   print;
+
+for(@ARGV) {
+    my $filename = $_;
+    rename($filename,$filename.".bak");
+    open(IN,"<$filename.bak");
+    open(OUT,">$filename");
+    $d = "0000";
+    while(<IN>) {
+       s/printf\(\"\#\d+\:/printf\(\"\#$d\:/;
+       s/printf\(\"([^#])/printf\(\"\#$d\:$1/;
+       $d++;
+       print OUT;
+    }
 }