summaryrefslogtreecommitdiff
path: root/lib/warnings
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-03-13 11:09:05 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-03-13 11:09:05 +0000
commitd3a7d8c7d7e4d69d7d81e4e3e900ec57f07ca07c (patch)
tree46e26336d8cdf0e9f503f5650660a4aafcc09411 /lib/warnings
parentd16e9ed98812a2e69b435f9514ff8e38e7ff38ad (diff)
downloadperl-d3a7d8c7d7e4d69d7d81e4e3e900ec57f07ca07c.tar.gz
final touches for lexical warnings (from Paul Marquess)
p4raw-id: //depot/perl@5702
Diffstat (limited to 'lib/warnings')
-rw-r--r--lib/warnings/register.pm30
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/warnings/register.pm b/lib/warnings/register.pm
new file mode 100644
index 0000000000..da6be97952
--- /dev/null
+++ b/lib/warnings/register.pm
@@ -0,0 +1,30 @@
+package warnings::register ;
+
+require warnings ;
+
+sub mkMask
+{
+ my ($bit) = @_ ;
+ my $mask = "" ;
+
+ vec($mask, $bit, 1) = 1 ;
+ return $mask ;
+}
+
+sub import
+{
+ shift ;
+ my $package = (caller(0))[0] ;
+ if (! defined $warnings::Bits{$package}) {
+ $warnings::Bits{$package} = mkMask($warnings::LAST_BIT) ;
+ vec($warnings::Bits{'all'}, $warnings::LAST_BIT, 1) = 1 ;
+ $warnings::Offsets{$package} = $warnings::LAST_BIT ++ ;
+ foreach my $k (keys %warnings::Bits) {
+ vec($warnings::Bits{$k}, $warnings::LAST_BIT, 1) = 0 ;
+ }
+ $warnings::DeadBits{$package} = mkMask($warnings::LAST_BIT);
+ vec($warnings::DeadBits{'all'}, $warnings::LAST_BIT++, 1) = 1 ;
+ }
+}
+
+1 ;