diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-08-14 14:34:53 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-10-12 16:21:40 +0900 |
| commit | 8a87549315d0c7fd984a8ad239ebe3dbab4d2855 (patch) | |
| tree | b5a0209755619ecc2e7bca1314b7a8e61c7b0d21 /src/string.c | |
| parent | ef9df5dc7d32b79e6b4e0d6924eeae2cc614dfce (diff) | |
| download | mruby-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/string.c')
| -rw-r--r-- | src/string.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/string.c b/src/string.c index 73e514f41..f15770403 100644 --- a/src/string.c +++ b/src/string.c @@ -8,7 +8,7 @@ # define _CRT_NONSTDC_NO_DEPRECATE #endif -#ifndef MRB_WITHOUT_FLOAT +#ifndef MRB_NO_FLOAT #include <float.h> #include <math.h> #endif @@ -2365,7 +2365,7 @@ mrb_str_len_to_inum(mrb_state *mrb, const char *str, size_t len, mrb_int base, i n *= base; n += c; if (n > (uint64_t)MRB_INT_MAX + (sign ? 0 : 1)) { -#ifndef MRB_WITHOUT_FLOAT +#ifndef MRB_NO_FLOAT if (base == 10) { return mrb_float_value(mrb, mrb_str_to_dbl(mrb, mrb_str_new(mrb, str, len), badcheck)); } @@ -2476,7 +2476,7 @@ mrb_str_to_i(mrb_state *mrb, mrb_value self) return mrb_str_to_inum(mrb, self, base, FALSE); } -#ifndef MRB_WITHOUT_FLOAT +#ifndef MRB_NO_FLOAT double mrb_str_len_to_dbl(mrb_state *mrb, const char *s, size_t len, mrb_bool badcheck) { @@ -2937,7 +2937,7 @@ mrb_init_string(mrb_state *mrb) mrb_define_method(mrb, s, "slice", mrb_str_aref_m, MRB_ARGS_ANY()); /* 15.2.10.5.34 */ mrb_define_method(mrb, s, "split", mrb_str_split_m, MRB_ARGS_ANY()); /* 15.2.10.5.35 */ -#ifndef MRB_WITHOUT_FLOAT +#ifndef MRB_NO_FLOAT mrb_define_method(mrb, s, "to_f", mrb_str_to_f, MRB_ARGS_NONE()); /* 15.2.10.5.38 */ #endif mrb_define_method(mrb, s, "to_i", mrb_str_to_i, MRB_ARGS_ANY()); /* 15.2.10.5.39 */ @@ -2954,7 +2954,7 @@ mrb_init_string(mrb_state *mrb) mrb_define_method(mrb, s, "byteslice", mrb_str_byteslice, MRB_ARGS_ARG(1,1)); } -#ifndef MRB_WITHOUT_FLOAT +#ifndef MRB_NO_FLOAT /* * Source code for the "strtod" library procedure. * |
