summaryrefslogtreecommitdiffhomepage
path: root/src/dump.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2020-08-14 14:34:53 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2020-10-12 16:21:40 +0900
commit8a87549315d0c7fd984a8ad239ebe3dbab4d2855 (patch)
treeb5a0209755619ecc2e7bca1314b7a8e61c7b0d21 /src/dump.c
parentef9df5dc7d32b79e6b4e0d6924eeae2cc614dfce (diff)
downloadmruby-8a87549315d0c7fd984a8ad239ebe3dbab4d2855.tar.gz
mruby-8a87549315d0c7fd984a8ad239ebe3dbab4d2855.zip
Rename float configuration option names.
- `MRB_WITHOUT_FLOAT` => `MRB_NO_FLOAT` - `MRB_USE_FLOAT` => `MRB_USE_FLOAT32` The former is to use `USE_XXX` naming convention. The latter is to make sure `float` is 32bit float and not floating point number in general.
Diffstat (limited to 'src/dump.c')
-rw-r--r--src/dump.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/dump.c b/src/dump.c
index 3bc95f629..489e70f8a 100644
--- a/src/dump.c
+++ b/src/dump.c
@@ -13,8 +13,8 @@
#include <mruby/numeric.h>
#include <mruby/debug.h>
-#ifndef MRB_WITHOUT_FLOAT
-#ifdef MRB_USE_FLOAT
+#ifndef MRB_NO_FLOAT
+#ifdef MRB_USE_FLOAT32
#define MRB_FLOAT_FMT "%.9g"
#else
#define MRB_FLOAT_FMT "%.17g"
@@ -88,7 +88,7 @@ write_iseq_block(mrb_state *mrb, const mrb_irep *irep, uint8_t *buf, uint8_t fla
return cur - buf;
}
-#ifndef MRB_WITHOUT_FLOAT
+#ifndef MRB_NO_FLOAT
static mrb_value
float_to_str(mrb_state *mrb, mrb_float f)
{
@@ -131,7 +131,7 @@ get_pool_block_size(mrb_state *mrb, const mrb_irep *irep)
break;
case IREP_TT_FLOAT:
-#ifndef MRB_WITHOUT_FLOAT
+#ifndef MRB_NO_FLOAT
{
mrb_value str = float_to_str(mrb, irep->pool[pool_no].u.f);
mrb_int len = RSTRING_LEN(str);
@@ -192,7 +192,7 @@ write_pool_block(mrb_state *mrb, const mrb_irep *irep, uint8_t *buf)
case IREP_TT_FLOAT:
cur += uint8_to_bin(IREP_TT_FLOAT, cur); /* data type */
-#ifndef MRB_WITHOUT_FLOAT
+#ifndef MRB_NO_FLOAT
{
mrb_value str = float_to_str(mrb, irep->pool[pool_no].u.f);
ptr = RSTRING_PTR(str);