From 7d02df3016b0c6eb3f4ee945198772cf4ebca3fa Mon Sep 17 00:00:00 2001 From: Yukihiro Matsumoto Date: Tue, 14 Aug 2012 13:16:34 +0900 Subject: NaN boxing --- src/dump.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/dump.c') diff --git a/src/dump.c b/src/dump.c index 230ba9bba..190f16027 100644 --- a/src/dump.c +++ b/src/dump.c @@ -224,13 +224,13 @@ get_pool_block_size(mrb_state *mrb, mrb_irep *irep, int type) uint16_t nlen =0; int len; - switch (irep->pool[pool_no].tt) { + switch (mrb_type(irep->pool[pool_no])) { case MRB_TT_FIXNUM: - len = sprintf( buf, "%d", irep->pool[pool_no].value.i); + len = sprintf( buf, "%d", mrb_fixnum(irep->pool[pool_no])); size += (uint32_t)len; break; case MRB_TT_FLOAT: - len = sprintf( buf, "%.16e", irep->pool[pool_no].value.f); + len = sprintf( buf, "%.16e", mrb_float(irep->pool[pool_no])); size += (uint32_t)len; break; case MRB_TT_STRING: @@ -343,16 +343,16 @@ write_pool_block(mrb_state *mrb, mrb_irep *irep, char *buf, int type) for (pool_no = 0; pool_no < irep->plen; pool_no++) { uint16_t nlen =0; - buf += uint8_dump(irep->pool[pool_no].tt, buf, type); /* data type */ + buf += uint8_dump(mrb_type(irep->pool[pool_no]), buf, type); /* data type */ memset(char_buf, 0, buf_size); - switch (irep->pool[pool_no].tt) { + switch (mrb_type(irep->pool[pool_no])) { case MRB_TT_FIXNUM: - sprintf(char_buf, "%d", irep->pool[pool_no].value.i); + sprintf(char_buf, "%d", mrb_fixnum(irep->pool[pool_no])); break; case MRB_TT_FLOAT: - sprintf(char_buf, "%.16e", irep->pool[pool_no].value.f); + sprintf(char_buf, "%.16e", mrb_float(irep->pool[pool_no])); break; case MRB_TT_STRING: -- cgit v1.2.3