Merge branch 'master' of http://repo.or.cz/r/msysgit into devel
[msysgit/historical-msysgit.git] / lib / perl5 / 5.6.1 / warnings / register.pm
blobf98075a5ee8c0e973e339f1fdc5df2edf92a09cd
1 package warnings::register ;
3 =pod
5 =head1 NAME
7 warnings::register - warnings import function
9 =cut
11 require warnings ;
13 sub mkMask
15 my ($bit) = @_ ;
16 my $mask = "" ;
18 vec($mask, $bit, 1) = 1 ;
19 return $mask ;
22 sub import
24 shift ;
25 my $package = (caller(0))[0] ;
26 if (! defined $warnings::Bits{$package}) {
27 $warnings::Bits{$package} = mkMask($warnings::LAST_BIT) ;
28 vec($warnings::Bits{'all'}, $warnings::LAST_BIT, 1) = 1 ;
29 $warnings::Offsets{$package} = $warnings::LAST_BIT ++ ;
30 foreach my $k (keys %warnings::Bits) {
31 vec($warnings::Bits{$k}, $warnings::LAST_BIT, 1) = 0 ;
33 $warnings::DeadBits{$package} = mkMask($warnings::LAST_BIT);
34 vec($warnings::DeadBits{'all'}, $warnings::LAST_BIT++, 1) = 1 ;
38 1 ;