Show
Ignore:
Timestamp:
12/21/07 18:32:34 (13 months ago)
Author:
charsbar
Message:

lang/perl/Archive-Lha: xs -> trunk

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/Archive-Lha/trunk/lib/Archive/Lha/Decode/LH0.pm

    r3270 r3413  
    44use warnings; 
    55use Carp; 
     6use bytes; 
    67use Archive::Lha::Constants; 
    7 use Archive::Lha::CRC; 
     8use Archive::Lha; 
    89 
    910sub new { 
     
    2627  my $self = shift; 
    2728 
     29  my $crc   = 0; 
    2830  my $total = 0; 
    2931  my $size  = $self->{size}; 
    30   my $crc   = Archive::Lha::CRC->new; 
    31  
    3232  while ( $total < $size ) { 
    3333    my $left = $size - $total; 
     
    3535    my $str = $self->{read}->( $length ); 
    3636    $self->{write}->( $str ); 
    37     $crc->add( $str ); 
     37    $crc = Archive::Lha::crc16( $crc, $str, length($str) ); 
    3838    $total += $length; 
    3939  } 
    40   croak "CRC mismatch" if $crc->value != $self->{crc16}; 
     40  croak "CRC mismatch" if $crc != $self->{crc16}; 
     41  return $crc; 
    4142} 
    4243