… | |
… | |
145 | my @r; |
145 | my @r; |
146 | while (length $data) { |
146 | while (length $data) { |
147 | my $type = dec_U8; |
147 | my $type = dec_U8; |
148 | |
148 | |
149 | if ($type == 255) { |
149 | if ($type == 255) { |
150 | push @r, [add_child => dec_U32]; |
150 | push @r, [add_child => dec_I32]; |
151 | |
151 | |
152 | } elsif ($type == 254) { |
152 | } elsif ($type == 254) { |
153 | push @r, ["done"]; |
153 | push @r, ["done"]; |
154 | |
154 | |
155 | } elsif ($type == 253) { |
155 | } elsif ($type == 253) { |
… | |
… | |
227 | for (@{$_[0]}) { |
227 | for (@{$_[0]}) { |
228 | my ($type, @arg) = @$_; |
228 | my ($type, @arg) = @$_; |
229 | |
229 | |
230 | if ($type eq "add_child") { |
230 | if ($type eq "add_child") { |
231 | enc_U8 255; |
231 | enc_U8 255; |
232 | enc_U32 $arg[0]; |
232 | enc_I32 $arg[0]; |
233 | |
233 | |
234 | } elsif ($type eq "done") { |
234 | } elsif ($type eq "done") { |
235 | enc_U8 254; |
235 | enc_U8 254; |
236 | |
236 | |
237 | } elsif ($type eq "more") { |
237 | } elsif ($type eq "more") { |