From: dpvc v. a. <we...@ma...> - 2005-07-12 21:09:04
|
Log Message: ----------- Fixed various perl compiler warnings (due to extra "my", and so on). Modified Files: -------------- pg/lib: Parser.pm pg/lib/Parser: BOP.pm String.pm Value.pm pg/lib/Parser/BOP: equality.pm multiply.pm power.pm underscore.pm pg/lib/Value: Complex.pm Formula.pm Union.pm WeBWorK.pm Revision Data ------------- Index: Parser.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/Parser.pm,v retrieving revision 1.24 retrieving revision 1.25 diff -Llib/Parser.pm -Llib/Parser.pm -u -r1.24 -r1.25 --- lib/Parser.pm +++ lib/Parser.pm @@ -643,7 +643,7 @@ $vars = [sort(keys %{$self->{variables}})] unless $vars; my $n = scalar(@{$vars}); my $vnames = ''; if ($n > 0) { - my @v = (); foreach my $x (@{$vars}) {push(@v,'$'.$x)} + my @v = (); foreach my $x (@{$vars}) {&push(@v,'$'.$x)} $vnames = "my (".join(',',@v).") = \@_;"; } my $fn = eval Index: BOP.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/Parser/BOP.pm,v retrieving revision 1.10 retrieving revision 1.11 diff -Llib/Parser/BOP.pm -Llib/Parser/BOP.pm -u -r1.10 -r1.11 --- lib/Parser/BOP.pm +++ lib/Parser/BOP.pm @@ -279,7 +279,7 @@ ($showparens eq 'all' || (($showparens eq 'extra' || $bop->{fullparens}) && $extraParens) || $precedence > $bop->{precedence} || ($precedence == $bop->{precedence} && ($bop->{associativity} eq 'right' || $showparens eq 'same'))); - my $outerRight = !$addparens && ($outerRight || $position eq 'right'); + $outerRight = !$addparens && ($outerRight || $position eq 'right'); $string = $self->{lop}->string($bop->{precedence},$bop->{leftparens},'left',$outerRight). $bop->{string}. @@ -301,7 +301,7 @@ (($showparens eq 'all' && $extraParens) || $precedence > $bop->{precedence} || ($precedence == $bop->{precedence} && ($bop->{associativity} eq 'right' || $showparens eq 'same'))); - my $outerRight = !$addparens && ($outerRight || $position eq 'right'); + $outerRight = !$addparens && ($outerRight || $position eq 'right'); $TeX = $self->{lop}->TeX($bop->{precedence},$bop->{leftparens},'left',$outerRight). (defined($bop->{TeX}) ? $bop->{TeX} : $bop->{string}) . Index: Value.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/Parser/Value.pm,v retrieving revision 1.11 retrieving revision 1.12 diff -Llib/Parser/Value.pm -Llib/Parser/Value.pm -u -r1.11 -r1.12 --- lib/Parser/Value.pm +++ lib/Parser/Value.pm @@ -31,7 +31,7 @@ $equation->Error("Can't convert ".Value::showClass($value)." to a constant",$ref) if ($type eq 'unknown'); $type = 'Value::'.$type, $value = $type->new(@{$value}) unless $type eq 'value'; - my $type = $value->typeRef; + $type = $value->typeRef; my $c = bless { value => $value, type => $type, isConstant => 1, Index: String.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/Parser/String.pm,v retrieving revision 1.8 retrieving revision 1.9 diff -Llib/Parser/String.pm -Llib/Parser/String.pm -u -r1.8 -r1.9 --- lib/Parser/String.pm +++ lib/Parser/String.pm @@ -70,7 +70,7 @@ sub TeX { my $self = shift; return $self->{def}{TeX} if defined($self->{def}{TeX}); - my $value = $self->eval; $value =~ s/([ _])/\\\1/g; + my $value = $self->eval; $value =~ s/([ _])/\\$1/g; return '{\rm '.$value.'}' unless Value::isValue($value); return $value->TeX($self->{equation}); } Index: power.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/Parser/BOP/power.pm,v retrieving revision 1.8 retrieving revision 1.9 diff -Llib/Parser/BOP/power.pm -Llib/Parser/BOP/power.pm -u -r1.8 -r1.9 --- lib/Parser/BOP/power.pm +++ lib/Parser/BOP/power.pm @@ -71,7 +71,7 @@ (($showparens eq 'all' && $extraParens) || $precedence > $bop->{precedence} || ($precedence == $bop->{precedence} && ($bop->{associativity} eq 'right' || $showparens eq 'same'))); - my $outerRight = !$addparens && ($outerRight || $position eq 'right'); + $outerRight = !$addparens && ($outerRight || $position eq 'right'); my $symbol = (defined($bop->{TeX}) ? $bop->{TeX} : $bop->{string}); if ($self->{lop}->class eq 'Function' && $self->{rop}->class eq 'Number' && Index: multiply.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/Parser/BOP/multiply.pm,v retrieving revision 1.5 retrieving revision 1.6 diff -Llib/Parser/BOP/multiply.pm -Llib/Parser/BOP/multiply.pm -u -r1.5 -r1.6 --- lib/Parser/BOP/multiply.pm +++ lib/Parser/BOP/multiply.pm @@ -87,7 +87,7 @@ ($showparens eq 'all' || $precedence > $bop->{precedence} || ($precedence == $bop->{precedence} && ($bop->{associativity} eq 'right' || $showparens eq 'same'))); - my $outerRight = !$addparens && ($outerRight || $position eq 'right'); + $outerRight = !$addparens && ($outerRight || $position eq 'right'); my $left = $self->{lop}->TeX($bop->{precedence},$bop->{leftparens},'left',$outerRight); my $right = $self->{rop}->TeX($bop->{precedence},$bop->{rightparens},'right'); Index: underscore.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/Parser/BOP/underscore.pm,v retrieving revision 1.5 retrieving revision 1.6 diff -Llib/Parser/BOP/underscore.pm -Llib/Parser/BOP/underscore.pm -u -r1.5 -r1.6 --- lib/Parser/BOP/underscore.pm +++ lib/Parser/BOP/underscore.pm @@ -80,7 +80,7 @@ ($showparens eq 'all' || $precedence > $bop->{precedence} || ($precedence == $bop->{precedence} && ($bop->{associativity} eq 'right' || $showparens eq 'same'))); - my $outerRight = !$addparens && ($outerRight || $position eq 'right'); + $outerRight = !$addparens && ($outerRight || $position eq 'right'); my $symbol = (defined($bop->{TeX}) ? $bop->{TeX} : $bop->{string}); $TeX = $self->{lop}->TeX($bop->{precedence},$bop->{leftparens},'left',$outerRight). Index: equality.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/Parser/BOP/equality.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -Llib/Parser/BOP/equality.pm -Llib/Parser/BOP/equality.pm -u -r1.3 -r1.4 --- lib/Parser/BOP/equality.pm +++ lib/Parser/BOP/equality.pm @@ -61,7 +61,7 @@ defined($precedence) && ($precedence > $bop->{precedence} || ($precedence == $bop->{precedence} && ($bop->{associativity} eq 'right' || $showparens eq 'same'))); - my $outerRight = !$addparens && ($outerRight || $position eq 'right'); + $outerRight = !$addparens && ($outerRight || $position eq 'right'); $string = $self->{lop}->string($bop->{precedence}). $bop->{string}. @@ -79,7 +79,7 @@ defined($precedence) && ($precedence > $bop->{precedence} || ($precedence == $bop->{precedence} && ($bop->{associativity} eq 'right' || $showparens eq 'same'))); - my $outerRight = !$addparens && ($outerRight || $position eq 'right'); + $outerRight = !$addparens && ($outerRight || $position eq 'right'); $TeX = $self->{lop}->TeX($bop->{precedence}). (defined($bop->{TeX}) ? $bop->{TeX} : $bop->{string}) . Index: Complex.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/Value/Complex.pm,v retrieving revision 1.15 retrieving revision 1.16 diff -Llib/Value/Complex.pm -Llib/Value/Complex.pm -u -r1.15 -r1.16 --- lib/Value/Complex.pm +++ lib/Value/Complex.pm @@ -350,7 +350,7 @@ $b = Value::Real->make($b) unless ref($b); my $bi = 'i'; return $a->$method($equation) if $b == 0; - $bi = abs($b)->$method($equation,1) . 'i' if abs($b) ne 1; + $bi = CORE::abs($b)->$method($equation,1) . 'i' if CORE::abs($b) ne 1; $bi = '-' . $bi if $b < 0; return $bi if $a == 0; $bi = '+' . $bi if $b > 0; @@ -362,7 +362,7 @@ # Values for i and pi # $i = $pkg->make(0,1); -$pi = 4*atan2(1,1); +$pi = 4*CORE::atan2(1,1); # # So that we can use 1+3*i rather than 1+3*$i, etc. Index: WeBWorK.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/Value/WeBWorK.pm,v retrieving revision 1.6 retrieving revision 1.7 diff -Llib/Value/WeBWorK.pm -Llib/Value/WeBWorK.pm -u -r1.6 -r1.7 --- lib/Value/WeBWorK.pm +++ lib/Value/WeBWorK.pm @@ -80,7 +80,7 @@ useBaseTenLogs ); -sub Value::Context::initCopy { +sub Parser::Context::initCopy { my $self = shift; my $context = $self->copy(@_); return $context if $context->{WW} && scalar(keys %{$context->{WW}}) > 0; Index: Formula.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/Value/Formula.pm,v retrieving revision 1.29 retrieving revision 1.30 diff -Llib/Value/Formula.pm -Llib/Value/Formula.pm -u -r1.29 -r1.30 --- lib/Value/Formula.pm +++ lib/Value/Formula.pm @@ -332,7 +332,7 @@ } $userlimits = [] unless $userlimits; my @limits; my $default; $default = $userlimits->[0][0] if defined($userlimits->[0]); - my $default = $default || $self->{context}{flags}{limits} || [-2,2]; + $default = $default || $self->{context}{flags}{limits} || [-2,2]; my $granularity = $self->getFlag('granularity',1000); my $resolution = $self->getFlag('resolution'); my $i = 0; Index: Union.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/Value/Union.pm,v retrieving revision 1.13 retrieving revision 1.14 diff -Llib/Value/Union.pm -Llib/Value/Union.pm -u -r1.13 -r1.14 --- lib/Value/Union.pm +++ lib/Value/Union.pm @@ -23,7 +23,7 @@ # sub new { my $self = shift; my $class = ref($self) || $self; - @_ = split("U",@_[0]) if scalar(@_) == 1 && !ref($_[0]); + @_ = split("U",$_[0]) if scalar(@_) == 1 && !ref($_[0]); Value::Error("Unions must be of at least two intervals") unless scalar(@_) > 1; my @intervals = (); my $isFormula = 0; foreach my $xx (@_) { |