зеркало из https://github.com/github/ruby.git
Improve consistency of bool/true/false
This commit is contained in:
Родитель
e27acb6148
Коммит
09e76e9828
12
complex.c
12
complex.c
|
@ -235,19 +235,19 @@ f_negate(VALUE x)
|
|||
return rb_funcall(x, id_negate, 0);
|
||||
}
|
||||
|
||||
static VALUE nucomp_real_p(VALUE self);
|
||||
static bool nucomp_real_p(VALUE self);
|
||||
|
||||
static inline bool
|
||||
f_real_p(VALUE x)
|
||||
{
|
||||
if (RB_INTEGER_TYPE_P(x)) {
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
else if (RB_FLOAT_TYPE_P(x)) {
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
else if (RB_TYPE_P(x, T_RATIONAL)) {
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
else if (RB_TYPE_P(x, T_COMPLEX)) {
|
||||
return nucomp_real_p(x);
|
||||
|
@ -1096,11 +1096,11 @@ nucomp_eqeq_p(VALUE self, VALUE other)
|
|||
return f_boolcast(f_eqeq_p(other, self));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
static bool
|
||||
nucomp_real_p(VALUE self)
|
||||
{
|
||||
get_dat1(self);
|
||||
return(f_zero_p(dat->imag) ? Qtrue : Qfalse);
|
||||
return(f_zero_p(dat->imag) ? true : false);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
2
hash.c
2
hash.c
|
@ -4719,7 +4719,7 @@ env_delete(VALUE name)
|
|||
RB_GC_GUARD(name);
|
||||
}
|
||||
else if (ENVMATCH(nam, TZ_ENV)) {
|
||||
ruby_tz_uptodate_p = FALSE;
|
||||
ruby_tz_uptodate_p = false;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
|
2
time.c
2
time.c
|
@ -680,7 +680,7 @@ rb_localtime_r(const time_t *t, struct tm *result)
|
|||
if (*t != (time_t)(int)*t) return NULL;
|
||||
#endif
|
||||
if (!ruby_tz_uptodate_p) {
|
||||
ruby_tz_uptodate_p = TRUE;
|
||||
ruby_tz_uptodate_p = true;
|
||||
tzset();
|
||||
}
|
||||
#ifdef HAVE_GMTIME_R
|
||||
|
|
|
@ -2614,7 +2614,7 @@ rb_const_list(void *data)
|
|||
VALUE
|
||||
rb_mod_constants(int argc, const VALUE *argv, VALUE mod)
|
||||
{
|
||||
bool inherit = TRUE;
|
||||
bool inherit = true;
|
||||
|
||||
if (rb_check_arity(argc, 0, 1)) inherit = RTEST(argv[0]);
|
||||
|
||||
|
@ -3213,7 +3213,7 @@ cvar_list(void *data)
|
|||
VALUE
|
||||
rb_mod_class_variables(int argc, const VALUE *argv, VALUE mod)
|
||||
{
|
||||
bool inherit = TRUE;
|
||||
bool inherit = true;
|
||||
st_table *tbl;
|
||||
|
||||
if (rb_check_arity(argc, 0, 1)) inherit = RTEST(argv[0]);
|
||||
|
|
|
@ -889,7 +889,7 @@ vm_get_iclass(rb_control_frame_t *cfp, VALUE klass)
|
|||
}
|
||||
|
||||
static inline VALUE
|
||||
vm_get_ev_const(rb_execution_context_t *ec, VALUE orig_klass, ID id, int allow_nil, int is_defined)
|
||||
vm_get_ev_const(rb_execution_context_t *ec, VALUE orig_klass, ID id, bool allow_nil, int is_defined)
|
||||
{
|
||||
void rb_const_warn_if_deprecated(const rb_const_entry_t *ce, VALUE klass, ID id);
|
||||
VALUE val;
|
||||
|
|
Загрузка…
Ссылка в новой задаче