mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Repalace int with mrb_bool because a return value is boolean.
This commit is contained in:
+9
-9
@@ -176,13 +176,13 @@ void mrb_undef_class_method(mrb_state*, struct RClass*, const char*);
|
||||
mrb_value mrb_instance_new(mrb_state *mrb, mrb_value cv);
|
||||
struct RClass * mrb_class_new(mrb_state *mrb, struct RClass *super);
|
||||
struct RClass * mrb_module_new(mrb_state *mrb);
|
||||
int mrb_class_defined(mrb_state *mrb, const char *name);
|
||||
mrb_bool mrb_class_defined(mrb_state *mrb, const char *name);
|
||||
struct RClass * mrb_class_get(mrb_state *mrb, const char *name);
|
||||
struct RClass * mrb_class_get_under(mrb_state *mrb, struct RClass *outer, const char *name);
|
||||
|
||||
mrb_value mrb_obj_dup(mrb_state *mrb, mrb_value obj);
|
||||
mrb_value mrb_check_to_integer(mrb_state *mrb, mrb_value val, const char *method);
|
||||
int mrb_obj_respond_to(struct RClass* c, mrb_sym mid);
|
||||
mrb_bool mrb_obj_respond_to(struct RClass* c, mrb_sym mid);
|
||||
struct RClass * mrb_define_class_under(mrb_state *mrb, struct RClass *outer, const char *name, struct RClass *super);
|
||||
struct RClass * mrb_define_module_under(mrb_state *mrb, struct RClass *outer, const char *name);
|
||||
|
||||
@@ -264,13 +264,13 @@ void mrb_p(mrb_state*, mrb_value);
|
||||
mrb_int mrb_obj_id(mrb_value obj);
|
||||
mrb_sym mrb_obj_to_sym(mrb_state *mrb, mrb_value name);
|
||||
|
||||
int mrb_obj_eq(mrb_state*, mrb_value, mrb_value);
|
||||
int mrb_obj_equal(mrb_state*, mrb_value, mrb_value);
|
||||
int mrb_equal(mrb_state *mrb, mrb_value obj1, mrb_value obj2);
|
||||
mrb_bool mrb_obj_eq(mrb_state*, mrb_value, mrb_value);
|
||||
mrb_bool mrb_obj_equal(mrb_state*, mrb_value, mrb_value);
|
||||
mrb_bool mrb_equal(mrb_state *mrb, mrb_value obj1, mrb_value obj2);
|
||||
mrb_value mrb_Integer(mrb_state *mrb, mrb_value val);
|
||||
mrb_value mrb_Float(mrb_state *mrb, mrb_value val);
|
||||
mrb_value mrb_inspect(mrb_state *mrb, mrb_value obj);
|
||||
int mrb_eql(mrb_state *mrb, mrb_value obj1, mrb_value obj2);
|
||||
mrb_bool mrb_eql(mrb_state *mrb, mrb_value obj1, mrb_value obj2);
|
||||
|
||||
void mrb_garbage_collect(mrb_state*);
|
||||
void mrb_incremental_gc(mrb_state *);
|
||||
@@ -292,7 +292,7 @@ const char * mrb_obj_classname(mrb_state *mrb, mrb_value obj);
|
||||
struct RClass* mrb_obj_class(mrb_state *mrb, mrb_value obj);
|
||||
mrb_value mrb_class_path(mrb_state *mrb, struct RClass *c);
|
||||
mrb_value mrb_convert_type(mrb_state *mrb, mrb_value val, enum mrb_vtype type, const char *tname, const char *method);
|
||||
int mrb_obj_is_kind_of(mrb_state *mrb, mrb_value obj, struct RClass *c);
|
||||
mrb_bool mrb_obj_is_kind_of(mrb_state *mrb, mrb_value obj, struct RClass *c);
|
||||
mrb_value mrb_obj_inspect(mrb_state *mrb, mrb_value self);
|
||||
mrb_value mrb_obj_clone(mrb_state *mrb, mrb_value self);
|
||||
|
||||
@@ -369,8 +369,8 @@ void mrb_define_global_const(mrb_state *mrb, const char *name, mrb_value val);
|
||||
mrb_value mrb_block_proc(void);
|
||||
mrb_value mrb_attr_get(mrb_state *mrb, mrb_value obj, mrb_sym id);
|
||||
|
||||
int mrb_respond_to(mrb_state *mrb, mrb_value obj, mrb_sym mid);
|
||||
int mrb_obj_is_instance_of(mrb_state *mrb, mrb_value obj, struct RClass* c);
|
||||
mrb_bool mrb_respond_to(mrb_state *mrb, mrb_value obj, mrb_sym mid);
|
||||
mrb_bool mrb_obj_is_instance_of(mrb_state *mrb, mrb_value obj, struct RClass* c);
|
||||
|
||||
/* memory pool implementation */
|
||||
typedef struct mrb_pool mrb_pool;
|
||||
|
||||
@@ -57,7 +57,7 @@ mrb_value mrb_str_to_str(mrb_state *mrb, mrb_value str);
|
||||
mrb_int mrb_str_hash(mrb_state *mrb, mrb_value str);
|
||||
mrb_value mrb_str_buf_append(mrb_state *mrb, mrb_value str, mrb_value str2);
|
||||
mrb_value mrb_str_inspect(mrb_state *mrb, mrb_value str);
|
||||
int mrb_str_equal(mrb_state *mrb, mrb_value str1, mrb_value str2);
|
||||
mrb_bool mrb_str_equal(mrb_state *mrb, mrb_value str1, mrb_value str2);
|
||||
mrb_value mrb_str_dump(mrb_state *mrb, mrb_value str);
|
||||
mrb_value mrb_str_cat(mrb_state *mrb, mrb_value str, const char *ptr, size_t len);
|
||||
mrb_value mrb_str_append(mrb_state *mrb, mrb_value str, mrb_value str2);
|
||||
|
||||
@@ -38,7 +38,7 @@ p(mrb_state *mrb, mrb_value obj, int prompt)
|
||||
|
||||
/* Guess if the user might want to enter more
|
||||
* or if he wants an evaluation of his code now */
|
||||
int
|
||||
mrb_bool
|
||||
is_code_block_open(struct mrb_parser_state *parser)
|
||||
{
|
||||
int code_block_open = FALSE;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "mruby.h"
|
||||
#include "mruby/range.h"
|
||||
|
||||
static int
|
||||
static mrb_bool
|
||||
r_le(mrb_state *mrb, mrb_value a, mrb_value b)
|
||||
{
|
||||
mrb_value r = mrb_funcall(mrb, a, "<=>", 1, b); /* compare result */
|
||||
@@ -15,7 +15,7 @@ r_le(mrb_state *mrb, mrb_value a, mrb_value b)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static int
|
||||
static mrb_bool
|
||||
r_lt(mrb_state *mrb, mrb_value a, mrb_value b)
|
||||
{
|
||||
mrb_value r = mrb_funcall(mrb, a, "<=>", 1, b);
|
||||
|
||||
+3
-3
@@ -203,7 +203,7 @@ mrb_vm_define_class(mrb_state *mrb, mrb_value outer, mrb_value super, mrb_sym id
|
||||
return c;
|
||||
}
|
||||
|
||||
int
|
||||
mrb_bool
|
||||
mrb_class_defined(mrb_state *mrb, const char *name)
|
||||
{
|
||||
mrb_value sym = mrb_check_intern_cstr(mrb, name);
|
||||
@@ -1172,7 +1172,7 @@ mrb_bob_missing(mrb_state *mrb, mrb_value mod)
|
||||
return mrb_nil_value();
|
||||
}
|
||||
|
||||
int
|
||||
mrb_bool
|
||||
mrb_obj_respond_to(struct RClass* c, mrb_sym mid)
|
||||
{
|
||||
khiter_t k;
|
||||
@@ -1196,7 +1196,7 @@ mrb_obj_respond_to(struct RClass* c, mrb_sym mid)
|
||||
return FALSE; /* no method */
|
||||
}
|
||||
|
||||
int
|
||||
mrb_bool
|
||||
mrb_respond_to(mrb_state *mrb, mrb_value obj, mrb_sym mid)
|
||||
{
|
||||
return mrb_obj_respond_to(mrb_class(mrb, obj), mid);
|
||||
|
||||
+1
-1
@@ -683,7 +683,7 @@ scope_body(codegen_scope *s, node *tree)
|
||||
return idx - s->idx;
|
||||
}
|
||||
|
||||
static int
|
||||
static mrb_bool
|
||||
nosplat(node *t)
|
||||
{
|
||||
while (t) {
|
||||
|
||||
+3
-3
@@ -26,7 +26,7 @@ typedef enum {
|
||||
NOEX_RESPONDS = 0x80
|
||||
} mrb_method_flag_t;
|
||||
|
||||
int
|
||||
mrb_bool
|
||||
mrb_obj_basic_to_s_p(mrb_state *mrb, mrb_value obj)
|
||||
{
|
||||
struct RProc *me = mrb_method_search(mrb, mrb_class(mrb, obj), mrb_intern2(mrb, "to_s", 4));
|
||||
@@ -521,7 +521,7 @@ mrb_obj_instance_eval(mrb_state *mrb, mrb_value self)
|
||||
return mrb_yield_internal(mrb, b, 0, 0, self, c);
|
||||
}
|
||||
|
||||
int
|
||||
mrb_bool
|
||||
mrb_obj_is_instance_of(mrb_state *mrb, mrb_value obj, struct RClass* c)
|
||||
{
|
||||
if (mrb_obj_class(mrb, obj) == c) return TRUE;
|
||||
@@ -938,7 +938,7 @@ mrb_obj_remove_instance_variable(mrb_state *mrb, mrb_value self)
|
||||
return val;
|
||||
}
|
||||
|
||||
static inline int
|
||||
static inline mrb_bool
|
||||
basic_obj_respond_to(mrb_state *mrb, mrb_value obj, mrb_sym id, int pub)
|
||||
{
|
||||
return mrb_respond_to(mrb, obj, id);
|
||||
|
||||
+5
-5
@@ -11,7 +11,7 @@
|
||||
#include "mruby/string.h"
|
||||
#include "error.h"
|
||||
|
||||
int
|
||||
mrb_bool
|
||||
mrb_obj_eq(mrb_state *mrb, mrb_value v1, mrb_value v2)
|
||||
{
|
||||
if (mrb_type(v1) != mrb_type(v2)) return FALSE;
|
||||
@@ -33,14 +33,14 @@ mrb_obj_eq(mrb_state *mrb, mrb_value v1, mrb_value v2)
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
mrb_bool
|
||||
mrb_obj_equal(mrb_state *mrb, mrb_value v1, mrb_value v2)
|
||||
{
|
||||
/* temporary definition */
|
||||
return mrb_obj_eq(mrb, v1, v2);
|
||||
}
|
||||
|
||||
int
|
||||
mrb_bool
|
||||
mrb_equal(mrb_state *mrb, mrb_value obj1, mrb_value obj2)
|
||||
{
|
||||
mrb_value result;
|
||||
@@ -468,7 +468,7 @@ mrb_any_to_s(mrb_state *mrb, mrb_value obj)
|
||||
* b.kind_of? M #=> true
|
||||
*/
|
||||
|
||||
int
|
||||
mrb_bool
|
||||
mrb_obj_is_kind_of(mrb_state *mrb, mrb_value obj, struct RClass *c)
|
||||
{
|
||||
struct RClass *cl = mrb_class(mrb, obj);
|
||||
@@ -585,7 +585,7 @@ mrb_inspect(mrb_state *mrb, mrb_value obj)
|
||||
return mrb_obj_as_string(mrb, mrb_funcall(mrb, obj, "inspect", 0, 0));
|
||||
}
|
||||
|
||||
int
|
||||
mrb_bool
|
||||
mrb_eql(mrb_state *mrb, mrb_value obj1, mrb_value obj2)
|
||||
{
|
||||
if (mrb_obj_eq(mrb, obj1, obj2)) return TRUE;
|
||||
|
||||
+3
-3
@@ -170,7 +170,7 @@ mrb_range_eq(mrb_state *mrb, mrb_value range)
|
||||
return mrb_true_value();
|
||||
}
|
||||
|
||||
static int
|
||||
static mrb_bool
|
||||
r_le(mrb_state *mrb, mrb_value a, mrb_value b)
|
||||
{
|
||||
mrb_value r = mrb_funcall(mrb, a, "<=>", 1, b); /* compare result */
|
||||
@@ -184,7 +184,7 @@ r_le(mrb_state *mrb, mrb_value a, mrb_value b)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static int
|
||||
static mrb_bool
|
||||
r_gt(mrb_state *mrb, mrb_value a, mrb_value b)
|
||||
{
|
||||
mrb_value r = mrb_funcall(mrb, a, "<=>", 1, b);
|
||||
@@ -197,7 +197,7 @@ r_gt(mrb_state *mrb, mrb_value a, mrb_value b)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static int
|
||||
static mrb_bool
|
||||
r_ge(mrb_state *mrb, mrb_value a, mrb_value b)
|
||||
{
|
||||
mrb_value r = mrb_funcall(mrb, a, "<=>", 1, b); /* compare result */
|
||||
|
||||
+2
-2
@@ -595,7 +595,7 @@ mrb_str_cmp_m(mrb_state *mrb, mrb_value str1)
|
||||
return mrb_fixnum_value(result);
|
||||
}
|
||||
|
||||
static int
|
||||
static mrb_bool
|
||||
str_eql(mrb_state *mrb, const mrb_value str1, const mrb_value str2)
|
||||
{
|
||||
const mrb_int len = RSTRING_LEN(str1);
|
||||
@@ -606,7 +606,7 @@ str_eql(mrb_state *mrb, const mrb_value str1, const mrb_value str2)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
int
|
||||
mrb_bool
|
||||
mrb_str_equal(mrb_state *mrb, mrb_value str1, mrb_value str2)
|
||||
{
|
||||
if (mrb_obj_equal(mrb, str1, str2)) return TRUE;
|
||||
|
||||
+2
-2
@@ -251,7 +251,7 @@ sym_to_sym(mrb_state *mrb, mrb_value sym)
|
||||
#endif
|
||||
#define is_identchar(c) (SIGN_EXTEND_CHAR(c)!=-1&&(ISALNUM(c) || (c) == '_'))
|
||||
|
||||
static int
|
||||
static mrb_bool
|
||||
is_special_global_name(const char* m)
|
||||
{
|
||||
switch (*m) {
|
||||
@@ -274,7 +274,7 @@ is_special_global_name(const char* m)
|
||||
return !*m;
|
||||
}
|
||||
|
||||
static int
|
||||
static mrb_bool
|
||||
symname_p(const char *name)
|
||||
{
|
||||
const char *m = name;
|
||||
|
||||
Reference in New Issue
Block a user