diff options
author | Tokuhiro Matsuno <tokuhirom@gmail.com> | 2009-07-03 18:18:40 +0900 |
---|---|---|
committer | Tokuhiro Matsuno <tokuhirom@gmail.com> | 2009-07-03 18:18:40 +0900 |
commit | 661f27348188d15e841467ececd75e27cd77980b (patch) | |
tree | a922cda59c790768620e0194e672e1bcecd23981 | |
parent | cb5c878b77c9286cc6ca47dd04978550479ae7de (diff) | |
download | msgpack-python-661f27348188d15e841467ececd75e27cd77980b.tar.gz |
Perl: use SvNOK.
-rw-r--r-- | perl/pack.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/perl/pack.c b/perl/pack.c index 90b18aa..ff0ef2d 100644 --- a/perl/pack.c +++ b/perl/pack.c @@ -163,9 +163,6 @@ static void _msgpack_pack_sv(enc_t *enc, SV* val) { } } break; - case SVt_NV: - PACK_WRAPPER(NVTYPE)(enc, SvNV(val)); - break; case SVt_PVAV: { AV* ary = (AV*)val; @@ -212,6 +209,8 @@ static void _msgpack_pack_sv(enc_t *enc, SV* val) { msgpack_pack_uint32(enc, SvUV(val)); } else if (SvIOK(val)) { PACK_WRAPPER(IVTYPE)(enc, SvIV(val)); + } else if (SvNOK(val)) { + PACK_WRAPPER(NVTYPE)(enc, SvNV(val)); } else { sv_dump(val); Perl_croak(aTHX_ "msgpack for perl doesn't supported this type: %d\n", SvTYPE(val)); |