Changeset 18598
- Timestamp:
- 09/02/08 00:07:12 (4 months ago)
- Location:
- lang/c/msgpack/trunk/ruby
- Files:
-
- 1 removed
- 2 modified
-
Makefile (deleted)
-
pack.c (modified) (2 diffs)
-
unpack_inline.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/c/msgpack/trunk/ruby/pack.c
r17708 r18598 63 63 } 64 64 65 66 #ifndef RBIGNUM_SIGN // Ruby 1.8 67 #define RBIGNUM_SIGN(b) (RBIGNUM(b)->sign) 68 #endif 69 70 static VALUE MessagePack_Bignum_to_msgpack(int argc, VALUE *argv, VALUE self) 71 { 72 ARG_BUFFER(out, argc, argv); 73 // FIXME bignum 74 if(RBIGNUM_SIGN(self)) { // positive 75 msgpack_pack_unsigned_int_64(out, rb_big2ull(self)); 76 } else { // negative 77 msgpack_pack_signed_int_64(out, rb_big2ll(self)); 78 } 79 return out; 80 } 81 65 82 static VALUE MessagePack_Float_to_msgpack(int argc, VALUE *argv, VALUE self) 66 83 { … … 123 140 rb_define_method_id(rb_cFalseClass, s_to_msgpack, MessagePack_FalseClass_to_msgpack, -1); 124 141 rb_define_method_id(rb_cFixnum, s_to_msgpack, MessagePack_Fixnum_to_msgpack, -1); 142 rb_define_method_id(rb_cBignum, s_to_msgpack, MessagePack_Bignum_to_msgpack, -1); 125 143 rb_define_method_id(rb_cFloat, s_to_msgpack, MessagePack_Float_to_msgpack, -1); 126 144 rb_define_method_id(rb_cString, s_to_msgpack, MessagePack_String_to_msgpack, -1); -
lang/c/msgpack/trunk/ruby/unpack_inline.c
r17708 r18598 31 31 32 32 static inline VALUE msgpack_unpack_unsigned_int_64(msgpack_unpack_context* x, uint64_t d) 33 { return UINT2NUM(d); } // FIXME33 { return rb_ull2inum(d); } 34 34 35 35 static inline VALUE msgpack_unpack_signed_int_8(msgpack_unpack_context* x, int8_t d) … … 43 43 44 44 static inline VALUE msgpack_unpack_signed_int_64(msgpack_unpack_context* x, int64_t d) 45 { return INT2NUM(d); } // FIXME45 { return rb_ll2inum(d); } 46 46 47 47 static inline VALUE msgpack_unpack_float(msgpack_unpack_context* x, float d) … … 64 64 65 65 static inline void msgpack_unpack_array_item(msgpack_unpack_context* x, VALUE c, VALUE o) 66 { rb_ary_push(c, o); } 66 { rb_ary_push(c, o); } // FIXME set value directry RARRAY_PTR(obj)[RARRAY_LEN(obj)++] 67 67 68 68 static inline VALUE msgpack_unpack_map_start(msgpack_unpack_context* x, unsigned int n)
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)