numeric.h: remove 2 functions from `MRB_API`

- `mrb_float_to_str()`
- `mrb_float_to_cstr()`

Both functions will be replaced to support new coming `format-float.c`.
parent 03c4e114
......@@ -161,15 +161,15 @@ mrb_int_mul_overflow(mrb_int a, mrb_int b, mrb_int *c)
# endif /* MRB_USE_FLOAT32 */
MRB_API mrb_value mrb_float_to_integer(mrb_state *mrb, mrb_value val);
MRB_API mrb_value mrb_float_to_str(mrb_state *mrb, mrb_value x, const char *fmt);
/* ArgumentError if format string doesn't match /%(\.[0-9]+)?[aAeEfFgG]/ */
MRB_API int mrb_float_to_cstr(mrb_state *mrb, char *buf, size_t len, const char *fmt, mrb_float f);
MRB_API mrb_float mrb_as_float(mrb_state *mrb, mrb_value x);
/* internal function(s) */
/* internal functions */
mrb_float mrb_div_float(mrb_float x, mrb_float y);
/* ArgumentError if format string doesn't match /%(\.[0-9]+)?[aAeEfFgG]/ */
mrb_value mrb_float_to_str(mrb_state *mrb, mrb_value x);
int mrb_float_to_cstr(mrb_state *mrb, char *buf, size_t len, const char *fmt, mrb_float f);
/* obsolete function(s); will be removed */
/* obsolete functions; will be removed */
#define mrb_flo_to_fixnum(mrb, val) mrb_float_to_integer(mrb, val)
#define mrb_to_flo(mrb, x) mrb_as_float(mrb, x)
......
......@@ -410,7 +410,7 @@ fmt_core(struct fmt_args *f, const char *fmt, mrb_float flo)
}
}
MRB_API mrb_value
mrb_value
mrb_float_to_str(mrb_state *mrb, mrb_value flo, const char *fmt)
{
struct fmt_args f;
......@@ -425,7 +425,7 @@ mrb_float_to_str(mrb_state *mrb, mrb_value flo, const char *fmt)
return str;
}
MRB_API int
int
mrb_float_to_cstr(mrb_state *mrb, char *buf, size_t len, const char *fmt, mrb_float fval)
{
struct fmt_args f;
......@@ -445,7 +445,7 @@ mrb_float_to_cstr(mrb_state *mrb, char *buf, size_t len, const char *fmt, mrb_fl
#else /* MRB_NO_STDIO || _WIN32 || _WIN64 */
#include <stdio.h>
MRB_API mrb_value
mrb_value
mrb_float_to_str(mrb_state *mrb, mrb_value flo, const char *fmt)
{
char buf[25];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment