Skip to content
This repository was archived by the owner on Mar 19, 2025. It is now read-only.

Commit 5865e2c

Browse files
committed
strict+warnings
1 parent e609547 commit 5865e2c

File tree

1 file changed

+16
-21
lines changed

1 file changed

+16
-21
lines changed

lib/OpenGL/GLUT.pm

+16-21
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,17 @@ package OpenGL::GLUT;
88
# This program is free software; you can redistribute it and/or
99
# modify it under the same terms as Perl itself.
1010

11+
use strict;
12+
use warnings;
1113
require Exporter;
1214
require DynaLoader;
1315

1416
use Carp;
1517

1618
our $VERSION = '0.71_01';
17-
$XS_VERSION = $VERSION;
18-
$VERSION = eval($VERSION);
19-
20-
@ISA = qw(Exporter AutoLoader DynaLoader);
21-
22-
our $gl_version;
19+
our $XS_VERSION = $VERSION;
20+
our @ISA = qw(Exporter AutoLoader DynaLoader);
21+
our ($gl_version, $AUTOLOAD);
2322
our $glext_installed = {};
2423

2524
# Implemented extensions and their dependencies
@@ -108,8 +107,7 @@ our $glext_dependencies =
108107
GL_SUN_slice_accum=>'1.0' #258
109108
};
110109

111-
112-
@glut_func = qw(
110+
my @glut_func = qw(
113111
done_glutInit
114112
glutAddMenuEntry
115113
glutAddSubMenu
@@ -247,7 +245,7 @@ our $glext_dependencies =
247245
##
248246
##------------------------------------------------------------------------
249247

250-
@glut_const = qw(
248+
my @glut_const = qw(
251249
GLUT_API_VERSION
252250
GLUT_XLIB_IMPLEMENTATION
253251
GLUT_RGB
@@ -407,15 +405,15 @@ our $glext_dependencies =
407405
GLUT_GAME_MODE_DISPLAY_CHANGED
408406
);
409407

410-
@EXPORT = ();
408+
our @EXPORT = ();
411409

412410
# Other items we are prepared to export if requested
413-
@EXPORT_OK = (@glut_func, @glut_const);
411+
our @EXPORT_OK = (@glut_func, @glut_const);
414412

415-
@constants = (@glut_const);
416-
@functions = (@glut_func);
413+
my @constants = (@glut_const);
414+
my @functions = (@glut_func);
417415

418-
%EXPORT_TAGS = ('constants' => \@constants, 'functions' => \@functions, 'all' => \@EXPORT_OK,
416+
our %EXPORT_TAGS = ('constants' => \@constants, 'functions' => \@functions, 'all' => \@EXPORT_OK,
419417
'glutconstants' => \@glut_const, 'glutfunctions' => \@glut_func,
420418
);
421419

@@ -428,22 +426,19 @@ sub AUTOLOAD {
428426
# Avoid old-style ``&CONST'' usage. Either remove the ``&'' or add ``()''.
429427
if (@_ > 0) {
430428
# Is it an old OpenGL-0.4 function? If so, remap it to newer variant
431-
local($constname);
432-
($constname = $AUTOLOAD) =~ s/.*:://;
433-
429+
(my $constname = $AUTOLOAD) =~ s/.*:://;
434430
$AutoLoader::AUTOLOAD = $AUTOLOAD;
435431
goto &AutoLoader::AUTOLOAD;
436432
}
437-
local($constname);
438-
($constname = $AUTOLOAD) =~ s/.*:://;
439-
$val = constant($constname, @_ ? $_[0] : 0);
433+
(my $constname = $AUTOLOAD) =~ s/.*:://;
434+
my $val = constant($constname, @_ ? $_[0] : 0);
440435
if (not defined $val) {
441436
if ($! =~ /Invalid/) {
442437
$AutoLoader::AUTOLOAD = $AUTOLOAD;
443438
goto &AutoLoader::AUTOLOAD;
444439
}
445440
else {
446-
($pack,$file,$line) = caller;
441+
my ($pack,$file,$line) = caller;
447442
die "Your vendor has not defined OpenGL macro $constname, used at $file line $line.
448443
";
449444
}

0 commit comments

Comments
 (0)