diff options
| author | Yukihiro Matsumoto <[email protected]> | 2012-08-14 13:16:34 +0900 |
|---|---|---|
| committer | Yukihiro Matsumoto <[email protected]> | 2012-08-14 13:16:34 +0900 |
| commit | 7d02df3016b0c6eb3f4ee945198772cf4ebca3fa (patch) | |
| tree | af4c35ee567e9be3e2ef6ca0c34dbd10440550bc /src/dump.c | |
| parent | e74600c919cdadab1b4e605e50181f8cdafe7ab3 (diff) | |
| download | mruby-7d02df3016b0c6eb3f4ee945198772cf4ebca3fa.tar.gz mruby-7d02df3016b0c6eb3f4ee945198772cf4ebca3fa.zip | |
NaN boxing
Diffstat (limited to 'src/dump.c')
| -rw-r--r-- | src/dump.c | 14 |
1 files changed, 7 insertions, 7 deletions
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: |
