Merge branch 'master' of github.com:msgpack/msgpack

This commit is contained in:
tokuhirom 2010-09-22 15:09:03 +09:00
commit f6d2cd7704

View File

@ -103,8 +103,8 @@ BEGIN {
*unpack_float = sub { return unpack( 'f', substr( $_[0], $_[1], 4 ) ); };
*unpack_double = sub { return unpack( 'd', substr( $_[0], $_[1], 8 ) ); };
*unpack_int64 = $unpack_int64_slow || sub { pack 'q', substr( $_[0], $_[1], 8 ); };
*unpack_uint64 = $unpack_uint64_slow || sub { pack 'Q', substr( $_[0], $_[1], 8 ); };
*unpack_int64 = $unpack_int64_slow || sub { unpack 'q', substr( $_[0], $_[1], 8 ); };
*unpack_uint64 = $unpack_uint64_slow || sub { unpack 'Q', substr( $_[0], $_[1], 8 ); };
}
}
else {
@ -419,7 +419,7 @@ sub execute {
$p = 0;
LOOP: while ( length($self->{data}) > $p ) {
while ( length($self->{data}) > $p ) {
_count( $self, $self->{data} ) or last;
while ( @{ $self->{stack} } > 0 && --$self->{stack}->[-1] == 0) {
@ -428,7 +428,7 @@ sub execute {
if (@{$self->{stack}} == 0) {
$self->{is_finished}++;
last LOOP;
last;
}
}
$self->{pos} = $p;
@ -455,7 +455,7 @@ sub _count {
$num = $byte & ~0x90;
}
if (defined($num) && $num > 0) {
if ( $num ) {
push @{ $self->{stack} }, $num + 1;
}
@ -476,7 +476,7 @@ sub _count {
$num = $byte & ~0x80;
}
if ($num > 0) {
if ( $num ) {
push @{ $self->{stack} }, $num * 2 + 1; # a pair
}