Use mrb_bool for the 'b' format specifier of mrb_get_args

This commit is contained in:
h2so5
2013-04-22 10:41:53 +09:00
parent e889cddf78
commit 9b798114bb
5 changed files with 16 additions and 16 deletions
+3 -3
View File
@@ -377,7 +377,7 @@ to_hash(mrb_state *mrb, mrb_value val)
a: Array [mrb_value*,mrb_int]
f: Float [mrb_float]
i: Integer [mrb_int]
b: Binary [int]
b: Boolean [mrb_bool]
n: Symbol [mrb_sym]
&: Block [mrb_value]
*: rest argument [mrb_value*,int]
@@ -579,7 +579,7 @@ mrb_get_args(mrb_state *mrb, const char *format, ...)
break;
case 'b':
{
int *boolp = va_arg(ap, int*);
mrb_bool *boolp = va_arg(ap, mrb_bool*);
if (i < argc) {
mrb_value b = *sp++;
@@ -864,7 +864,7 @@ static mrb_value
mrb_mod_instance_methods(mrb_state *mrb, mrb_value mod)
{
struct RClass *c = mrb_class_ptr(mod);
int recur = TRUE;
mrb_bool recur = TRUE;
mrb_get_args(mrb, "|b", &recur);
return class_instance_method_list(mrb, recur, c, 0);
}
+1 -1
View File
@@ -1135,7 +1135,7 @@ gc_generational_mode_get(mrb_state *mrb, mrb_value self)
static mrb_value
gc_generational_mode_set(mrb_state *mrb, mrb_value self)
{
int enable;
mrb_bool enable;
mrb_get_args(mrb, "b", &enable);
if (mrb->is_generational_gc_mode != enable)
+5 -5
View File
@@ -782,7 +782,7 @@ mrb_obj_methods(mrb_state *mrb, mrb_bool recur, mrb_value obj, mrb_method_flag_t
mrb_value
mrb_obj_methods_m(mrb_state *mrb, mrb_value self)
{
int recur = TRUE;
mrb_bool recur = TRUE;
mrb_get_args(mrb, "|b", &recur);
return mrb_obj_methods(mrb, recur, self, (mrb_method_flag_t)0); /* everything but private */
}
@@ -813,7 +813,7 @@ mrb_false(mrb_state *mrb, mrb_value self)
mrb_value
mrb_obj_private_methods(mrb_state *mrb, mrb_value self)
{
int recur = TRUE;
mrb_bool recur = TRUE;
mrb_get_args(mrb, "|b", &recur);
return mrb_obj_methods(mrb, recur, self, NOEX_PRIVATE); /* private attribute not define */
}
@@ -830,7 +830,7 @@ mrb_obj_private_methods(mrb_state *mrb, mrb_value self)
mrb_value
mrb_obj_protected_methods(mrb_state *mrb, mrb_value self)
{
int recur = TRUE;
mrb_bool recur = TRUE;
mrb_get_args(mrb, "|b", &recur);
return mrb_obj_methods(mrb, recur, self, NOEX_PROTECTED); /* protected attribute not define */
}
@@ -847,7 +847,7 @@ mrb_obj_protected_methods(mrb_state *mrb, mrb_value self)
mrb_value
mrb_obj_public_methods(mrb_state *mrb, mrb_value self)
{
int recur = TRUE;
mrb_bool recur = TRUE;
mrb_get_args(mrb, "|b", &recur);
return mrb_obj_methods(mrb, recur, self, NOEX_PUBLIC); /* public attribute not define */
}
@@ -1021,7 +1021,7 @@ obj_respond_to(mrb_state *mrb, mrb_value self)
mrb_value
mrb_obj_singleton_methods_m(mrb_state *mrb, mrb_value self)
{
int recur = TRUE;
mrb_bool recur = TRUE;
mrb_get_args(mrb, "|b", &recur);
return mrb_obj_singleton_methods(mrb, recur, self);
}
+6 -6
View File
@@ -111,7 +111,7 @@ nil_inspect(mrb_state *mrb, mrb_value obj)
static mrb_value
true_and(mrb_state *mrb, mrb_value obj)
{
int obj2;
mrb_bool obj2;
mrb_get_args(mrb, "b", &obj2);
@@ -131,7 +131,7 @@ true_and(mrb_state *mrb, mrb_value obj)
static mrb_value
true_xor(mrb_state *mrb, mrb_value obj)
{
int obj2;
mrb_bool obj2;
mrb_get_args(mrb, "b", &obj2);
return mrb_bool_value(!obj2);
@@ -171,7 +171,7 @@ true_to_s(mrb_state *mrb, mrb_value obj)
static mrb_value
true_or(mrb_state *mrb, mrb_value obj)
{
int obj2;
mrb_bool obj2;
mrb_get_args(mrb, "b", &obj2);
return mrb_true_value();
@@ -202,7 +202,7 @@ true_or(mrb_state *mrb, mrb_value obj)
static mrb_value
false_and(mrb_state *mrb, mrb_value obj)
{
int obj2;
mrb_bool obj2;
mrb_get_args(mrb, "b", &obj2);
return mrb_false_value();
@@ -224,7 +224,7 @@ false_and(mrb_state *mrb, mrb_value obj)
static mrb_value
false_xor(mrb_state *mrb, mrb_value obj)
{
int obj2;
mrb_bool obj2;
mrb_get_args(mrb, "b", &obj2);
return mrb_bool_value(obj2);
@@ -244,7 +244,7 @@ false_xor(mrb_state *mrb, mrb_value obj)
static mrb_value
false_or(mrb_state *mrb, mrb_value obj)
{
int obj2;
mrb_bool obj2;
mrb_get_args(mrb, "b", &obj2);
return mrb_bool_value(obj2);
+1 -1
View File
@@ -120,7 +120,7 @@ mrb_value
mrb_range_initialize(mrb_state *mrb, mrb_value range)
{
mrb_value beg, end;
int exclusive;
mrb_bool exclusive;
int n;
n = mrb_get_args(mrb, "oo|b", &beg, &end, &exclusive);