]> mj.ucw.cz Git - libucw.git/commitdiff
Configure: Enabled strict mode and localized @cpu.
authorMartin Mares <mj@ucw.cz>
Thu, 30 Oct 2008 21:28:02 +0000 (22:28 +0100)
committerMartin Mares <mj@ucw.cz>
Thu, 30 Oct 2008 21:28:02 +0000 (22:28 +0100)
ucw/perl/UCW/Configure/C.pm
ucw/perl/UCW/Configure/LibUCW.pm
ucw/perl/UCW/Configure/Paths.pm

index eb30caee8ff467535cb7dd5960146ec46be7cbe4..ec39630d34b6cdcd5944948511837ebd3aa7fcb1 100644 (file)
@@ -8,6 +8,9 @@
 package UCW::Configure::C;
 use UCW::Configure;
 
+use strict;
+use warnings;
+
 Test("OS", "Checking on which OS we run", sub {
        my $os = `uname`;
        chomp $os;
@@ -70,9 +73,9 @@ sub parse_cpuinfo_linux() {
 }
 
 sub parse_cpuinfo_darwin() {
-       @cpu = (`sysctl -n machdep.cpu.vendor`,
-               `sysctl -n machdep.cpu.family`,
-               `sysctl -n machdep.cpu.model`);
+       my @cpu = (`sysctl -n machdep.cpu.vendor`,
+                  `sysctl -n machdep.cpu.family`,
+                  `sysctl -n machdep.cpu.model`);
        chomp @cpu;
        return @cpu;
 }
@@ -250,8 +253,8 @@ sub ConfigHeader($$) {
        open X, ">obj/$hdr" or Fail $!;
        print X "/* Generated automatically by $0, please don't touch manually. */\n";
 
-       sub match_rules($) {
-               my ($name) = @_;
+       sub match_rules($$) {
+               my ($rules, $name) = @_;
                for (my $i=0; $i < scalar @$rules; $i++) {
                        my ($r, $v) = ($rules->[$i], $rules->[$i+1]);
                        return $v if $name =~ $r;
@@ -260,7 +263,7 @@ sub ConfigHeader($$) {
        }
 
        foreach my $x (sort keys %UCW::Configure::vars) {
-               next unless match_rules($x);
+               next unless match_rules($rules, $x);
                my $v = $UCW::Configure::vars{$x};
                # Try to add quotes if necessary
                $v = '"' . $v . '"' unless ($v =~ /^"/ || $v =~ /^\d*$/);
index ef09fa315cdca59102465a3f83ed7f3ccb7c9999..3d17ac7a08d36ac1018680b497086a7b58a8ea4e 100644 (file)
@@ -6,6 +6,9 @@
 package UCW::Configure::LibUCW;
 use UCW::Configure;
 
+use strict;
+use warnings;
+
 # Determine page size
 Test("CPU_PAGE_SIZE", "Determining page size", sub {
        my $p;
index ef5c885160a38af57d3714f21f156acb30740af4..ecfa2caa3c19d466ad6ed22dabd740eb213278c6 100644 (file)
@@ -6,6 +6,9 @@
 package UCW::Configure::Paths;
 use UCW::Configure;
 
+use strict;
+use warnings;
+
 Log "Determining installation prefix ... ";
 if (IsSet("CONFIG_LOCAL")) {
        Log("local build\n");