Skip to content

Commit 614d3cc

Browse files
committed
Add use strict, use warnings to modules.
u
1 parent 0dfc328 commit 614d3cc

File tree

11 files changed

+34
-12
lines changed

11 files changed

+34
-12
lines changed

lib/Hermite.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ sub internal_critical_points {
233233
}
234234

235235
sub internal_inflection_points {
236-
my ($x0, $l, $lp,, $x1, $r, $rp, $rh_roots, $rf_function) = @_;
236+
my ($x0, $l, $lp, $x1, $r, $rp, $rh_roots, $rf_function) = @_;
237237
#data for one segment of the hermite spline
238238

239239
# coefficients for the approximating polynomial

lib/Label.pm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ This module defines labels for the graph objects (WWPlot).
4242
package Label;
4343

4444
use strict;
45+
use warnings;
46+
47+
use GD;
4548

4649
#use Exporter;
4750
#use DynaLoader;

lib/Plots/Axes.pm

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,9 @@ be visible after the fill, otherwise the fill will cover the axis. Default: 0
190190

191191
package Plots::Axes;
192192

193+
use strict;
194+
use warnings;
195+
193196
sub new {
194197
my $class = shift;
195198
my $self = {
@@ -329,4 +332,4 @@ sub bounds {
329332
return $self->{xaxis}{min}, $self->{yaxis}{min}, $self->{xaxis}{max}, $self->{yaxis}{max};
330333
}
331334

332-
1;
335+
1;

lib/Plots/Data.pm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ to add / change the styles.
107107

108108
package Plots::Data;
109109

110+
use strict;
111+
use warnings;
112+
110113
sub new {
111114
my $class = shift;
112115
my $self = {

lib/Plots/GD.pm

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ See L<plots.pl> for more details.
2323

2424
package Plots::GD;
2525

26+
use GD;
27+
28+
use strict;
29+
use warnings;
30+
2631
sub new {
2732
my ($class, $pgplot) = @_;
2833
my $self = {
@@ -382,4 +387,4 @@ sub draw {
382387
return $pgplot->ext eq 'gif' ? $self->im->gif : $self->im->png;
383388
}
384389

385-
1;
390+
1;

lib/Plots/Plot.pm

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,20 @@ See L<plots.pl> for more details.
2323

2424
package Plots::Plot;
2525

26+
use strict;
27+
use warnings;
28+
2629
use Plots::Axes;
2730
use Plots::Data;
28-
use Plots::GD;
2931
use Plots::Tikz;
32+
use Plots::GD;
3033

3134
sub new {
3235
my ($class, $pg, @opts) = @_;
33-
my $size = $main::envir{onTheFlyImageSize} || 500;
36+
my $size = $pg->{envir}{onTheFlyImageSize} || 500;
3437

3538
my $self = {
36-
pg => $pg,
39+
pg => $pg,
3740
imageName => {},
3841
type => 'Tikz',
3942
ext => 'svg',
@@ -158,15 +161,15 @@ sub image_type {
158161
# Tikz needs to use pdf for hardcopy generation.
159162
sub ext {
160163
my $self = shift;
161-
return 'pdf' if ($self->{type} eq 'Tikz' && $main::displayMode eq 'TeX');
164+
return 'pdf' if ($self->{type} eq 'Tikz' && $self->{pg}{displayMode} eq 'TeX');
162165
return $self->{ext};
163166
}
164167

165168
# Return a copy of the tikz code (available after the image has been drawn).
166169
# Set $plot->{tikzDebug} to 1 to just generate the tikzCode, and not create a graph.
167170
sub tikz_code {
168171
my $self = shift;
169-
return ($self->{tikzCode} && $main::displayMode =~ /HTML/) ? '<pre>' . $self->{tikzCode} . '</pre>' : '';
172+
return ($self->{tikzCode} && $self->{pg}{displayMode} =~ /HTML/) ? '<pre>' . $self->{tikzCode} . '</pre>' : '';
170173
}
171174

172175
# Add functions to the graph.

lib/Plots/Tikz.pm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@ See L<plots.pl> for more details.
2121
2222
=cut
2323

24-
2524
package Plots::Tikz;
2625

26+
use strict;
27+
use warnings;
28+
2729
sub new {
2830
my ($class, $pgplot) = @_;
2931
my $image = new LaTeXImage;

lib/Value/AnswerChecker.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1156,7 +1156,7 @@ sub ANS_MATRIX {
11561156
$def = $self->context->lists->get('Matrix');
11571157
$open = $self->{open} || $def->{open};
11581158
$close = $self->{close} || $def->{close};
1159-
return $self->ans_matrix($extend, $name, $self->length, 1, $size, $open, $close, '',, '', %options)
1159+
return $self->ans_matrix($extend, $name, $self->length, 1, $size, $open, $close, '', '', %options)
11601160
if ($self->{ColumnVector});
11611161
$def = $self->context->lists->get('Vector');
11621162
$open = $self->{open} || $def->{open};

lib/WWPlot.pm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,9 @@ These functions translate from real world to pixel coordinates.
169169
package WWPlot;
170170

171171
use strict;
172+
use warnings;
173+
174+
use GD;
172175

173176
#use Exporter;
174177
#use DynaLoader;

macros/graph/plots.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,4 +410,4 @@ BEGIN
410410

411411
sub _plots_init { }
412412

413-
sub Plot { Plots::Plot->new($main::PG,@_); }
413+
sub Plot { Plots::Plot->new($main::PG, @_); }

0 commit comments

Comments
 (0)