Commit 54d627bd authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto

Merge pull request #2270 from suzukaze/refactor-class.c

Use boolean macro
parents d77e521e bcd8980c
...@@ -421,8 +421,8 @@ mrb_get_args(mrb_state *mrb, const char *format, ...) ...@@ -421,8 +421,8 @@ mrb_get_args(mrb_state *mrb, const char *format, ...)
mrb_value *sp = mrb->c->stack + 1; mrb_value *sp = mrb->c->stack + 1;
va_list ap; va_list ap;
int argc = mrb->c->ci->argc; int argc = mrb->c->ci->argc;
mrb_bool opt = 0; mrb_bool opt = FALSE;
mrb_bool given = 1; mrb_bool given = TRUE;
va_start(ap, format); va_start(ap, format);
if (argc < 0) { if (argc < 0) {
...@@ -438,7 +438,7 @@ mrb_get_args(mrb_state *mrb, const char *format, ...) ...@@ -438,7 +438,7 @@ mrb_get_args(mrb_state *mrb, const char *format, ...)
default: default:
if (argc <= i) { if (argc <= i) {
if (opt) { if (opt) {
given = 0; given = FALSE;
} }
else { else {
mrb_raise(mrb, E_ARGUMENT_ERROR, "wrong number of arguments"); mrb_raise(mrb, E_ARGUMENT_ERROR, "wrong number of arguments");
...@@ -669,7 +669,7 @@ mrb_get_args(mrb_state *mrb, const char *format, ...) ...@@ -669,7 +669,7 @@ mrb_get_args(mrb_state *mrb, const char *format, ...)
} }
break; break;
case '|': case '|':
opt = 1; opt = TRUE;
break; break;
case '?': case '?':
{ {
......
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