2
0
mirror of https://github.com/lm-sensors/lm-sensors synced 2025-09-04 00:05:10 +00:00

Reindent auxiliary functions.

git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5467 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare
2008-11-30 12:24:42 +00:00
parent 66fe01e8a8
commit bf809dca15

View File

@@ -1710,12 +1710,12 @@ use vars qw(@cpu_ids);
# $_[0] is the sought value # $_[0] is the sought value
# @_[1..] is the list to seek in # @_[1..] is the list to seek in
# Returns: 0 on failure, 1 if found. # Returns: 1 if found, 0 if not.
# Note: Every use of this sub probably indicates the use of the wrong
# datastructure
sub contains sub contains
{ {
my $sought = shift; my $sought = shift;
local $_;
foreach (@_) { foreach (@_) {
return 1 if $sought eq $_; return 1 if $sought eq $_;
} }
@@ -1731,7 +1731,7 @@ sub valid_address
print "$value is not a valid address, sorry.\n"; print "$value is not a valid address, sorry.\n";
exit -1; exit -1;
} }
$value = oct($value) if $value =~ /^0x/i; $value = oct($value) if $value =~ m/^0x/i;
return $value; return $value;
} }
@@ -1742,6 +1742,7 @@ sub parse_not_to_scan
my @ranges = split /\s*, \s*/, $to_parse; my @ranges = split /\s*, \s*/, $to_parse;
my @res; my @res;
my $range; my $range;
foreach $range (@ranges) { foreach $range (@ranges) {
my ($start, $end) = split /\s*-\s*/, $range; my ($start, $end) = split /\s*-\s*/, $range;
$start = valid_address($start); $start = valid_address($start);
@@ -1758,6 +1759,7 @@ sub parse_not_to_scan
push @res, $start if $start >= $min and $start <= $max; push @res, $start if $start >= $min and $start <= $max;
} }
} }
return sort { $a <=> $b } @res; return sort { $a <=> $b } @res;
} }
@@ -1769,6 +1771,7 @@ sub any_list_match
{ {
my ($list1, $list2) = @_; my ($list1, $list2) = @_;
my ($el1, $el2); my ($el1, $el2);
foreach $el1 (@$list1) { foreach $el1 (@$list1) {
foreach $el2 (@$list2) { foreach $el2 (@$list2) {
return 1 if $el1 == $el2; return 1 if $el1 == $el2;