Skip Menu |

This queue is for tickets about the Digest-CRC CPAN distribution.

Report information
The Basics
Id: 61490
Status: resolved
Priority: 0/
Queue: Digest-CRC

People
Owner: OLIMAUL [...] cpan.org
Requestors: RBS [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.15
Fixed in: 0.16



Subject: Fallback perl code missing braces (patch included)
The fallback Perl code is missing a two braces; patch follows. This patch also adds code to check for eval errors and to silence prototype mismatch warnings. @@ -42,9 +42,9 @@ } # Only load the non-XS stuff on demand -defined &_crc or eval <<'ENOXS'; +defined &_crc or eval <<'ENOXS' or die $@; -sub _reflect { +sub _reflect($$) { my ($in, $width) = @_; my $out = 0; for(my $i=1; $i < ($width+1); $i++) { @@ -54,7 +54,7 @@ $out; } -sub _tabinit { +sub _tabinit($$$) { my ($width,$poly_in,$ref) = @_; my @crctab; my $poly = $poly_in; @@ -83,12 +83,12 @@ \@crctab; } -sub _crc { +sub _crc($$$$$$$) { my ($message,$width,$init,$xorout,$refin,$refout,$tab) = @_; my $crc = $init; if ($refin = 1) { $crc = _reflect($crc,$width); - elsif ($refin > 1 and $refin <= $width) + } elsif ($refin > 1 and $refin <= $width) { $crc = _reflect($crc,$refin); } my $pos = -length $message; @@ -104,7 +104,7 @@ if ($refout && !$refin) { if ($refout = 1) { $crc = _reflect($crc,$width); - elsif ($refout > 1 and $refout <= $width) { + } elsif ($refout > 1 and $refout <= $width) { $crc = _reflect($crc,$refout); } } @@ -112,6 +112,8 @@ $crc = $crc ^ $xorout; $crc & $mask; } + +1; ENOXS