diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-12-29 16:23:33 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-12-29 16:39:29 +0900 |
| commit | 4f297ac29cec0c12aae1f7fd56390fdb6b925547 (patch) | |
| tree | 784efb6605d34bae3267be8908d35acbf5f96eb4 /src/kernel.c | |
| parent | b6283978c586702e1b2ff182b83ceb3e2bf691b3 (diff) | |
| download | mruby-4f297ac29cec0c12aae1f7fd56390fdb6b925547.tar.gz mruby-4f297ac29cec0c12aae1f7fd56390fdb6b925547.zip | |
object.c: introduce `mrb_ensure_{int,float}_type`.
Since `mrb_to_integer` and `mrb_to_float` does not convert the object
but checks types, they are named so by historical reason. We introduced
properly named functions.
This commit obsoletes the following functions:
* mrb_to_integer()
* mrb_to_int()
* mrb_to_float()
Use `mrb_ensure_int_type()` instead for the first 2 functions. Use
`mrb_ensure_float_type()` for the last.
Diffstat (limited to 'src/kernel.c')
| -rw-r--r-- | src/kernel.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/kernel.c b/src/kernel.c index 5ecebabeb..7a261560f 100644 --- a/src/kernel.c +++ b/src/kernel.c @@ -659,7 +659,7 @@ mrb_init_kernel(mrb_state *mrb) mrb_define_method(mrb, krn, "respond_to?", obj_respond_to, MRB_ARGS_ARG(1,1)); /* 15.3.1.3.43 */ mrb_define_method(mrb, krn, "to_s", mrb_any_to_s, MRB_ARGS_NONE()); /* 15.3.1.3.46 */ mrb_define_method(mrb, krn, "__case_eqq", mrb_obj_ceqq, MRB_ARGS_REQ(1)); /* internal */ - mrb_define_method(mrb, krn, "__to_int", mrb_to_integer, MRB_ARGS_NONE()); /* internal */ + mrb_define_method(mrb, krn, "__to_int", mrb_ensure_int_type, MRB_ARGS_NONE()); /* internal */ mrb_define_method(mrb, krn, "__ENCODING__", mrb_encoding, MRB_ARGS_NONE()); mrb_include_module(mrb, mrb->object_class, mrb->kernel_module); |
