diff options
-rw-r--r-- | cont.c | 2 | ||||
-rw-r--r-- | dir.c | 2 | ||||
-rw-r--r-- | gc.c | 4 | ||||
-rw-r--r-- | io.c | 2 | ||||
-rw-r--r-- | numeric.c | 2 | ||||
-rw-r--r-- | object.c | 8 | ||||
-rw-r--r-- | proc.c | 2 | ||||
-rw-r--r-- | vm_insnhelper.c | 4 | ||||
-rw-r--r-- | vm_method.c | 2 |
9 files changed, 14 insertions, 14 deletions
@@ -2483,7 +2483,7 @@ rb_fiber_reset_root_local_storage(rb_thread_t *th) VALUE rb_fiber_alive_p(VALUE fiber_value) { - return FIBER_TERMINATED_P(fiber_ptr(fiber_value)) ? Qfalse : Qtrue; + return RBOOL(!FIBER_TERMINATED_P(fiber_ptr(fiber_value))); } /* @@ -3323,7 +3323,7 @@ rb_dir_s_empty_p(VALUE obj, VALUE dirname) al.dirattr = ATTR_DIR_ENTRYCOUNT; if (getattrlist(path, &al, attrbuf, sizeof(attrbuf), 0) == 0) { if (attrbuf[0] >= 2 * sizeof(u_int32_t)) - return attrbuf[1] ? Qfalse : Qtrue; + return RBOOL(attrbuf[1] == 0); if (false_on_notdir) return Qfalse; } rb_sys_fail_path(orig); @@ -8600,7 +8600,7 @@ rb_copy_wb_protected_attribute(VALUE dest, VALUE obj) VALUE rb_obj_rgengc_writebarrier_protected_p(VALUE obj) { - return RVALUE_WB_UNPROTECTED(obj) ? Qfalse : Qtrue; + return RBOOL(!RVALUE_WB_UNPROTECTED(obj)); } VALUE @@ -12343,7 +12343,7 @@ wmap_aref(VALUE self, VALUE key) static VALUE wmap_has_key(VALUE self, VALUE key) { - return wmap_lookup(self, key) == Qundef ? Qfalse : Qtrue; + return RBOOL(wmap_lookup(self, key) != Qundef); } /* Returns the number of referenced objects */ @@ -8933,7 +8933,7 @@ rb_io_autoclose_p(VALUE io) { rb_io_t *fptr = RFILE(io)->fptr; rb_io_check_closed(fptr); - return (fptr->mode & FMODE_PREP) ? Qfalse : Qtrue; + return RBOOL(!(fptr->mode & FMODE_PREP)); } /* @@ -3657,7 +3657,7 @@ static VALUE int_anybits_p(VALUE num, VALUE mask) { mask = rb_to_int(mask); - return int_zero_p(rb_int_and(num, mask)) ? Qfalse : Qtrue; + return RBOOL(!int_zero_p(rb_int_and(num, mask))); } /* @@ -204,7 +204,7 @@ VALUE rb_obj_hash(VALUE obj); MJIT_FUNC_EXPORTED VALUE rb_obj_not(VALUE obj) { - return RTEST(obj) ? Qfalse : Qtrue; + return RBOOL(!RTEST(obj)); } /** @@ -221,7 +221,7 @@ MJIT_FUNC_EXPORTED VALUE rb_obj_not_equal(VALUE obj1, VALUE obj2) { VALUE result = rb_funcall(obj1, id_eq, 1, obj2); - return RTEST(result) ? Qfalse : Qtrue; + return rb_obj_not(result); } VALUE @@ -1295,7 +1295,7 @@ true_or(VALUE obj, VALUE obj2) static VALUE true_xor(VALUE obj, VALUE obj2) { - return RTEST(obj2)?Qfalse:Qtrue; + return rb_obj_not(obj2); } @@ -1426,7 +1426,7 @@ static VALUE rb_obj_not_match(VALUE obj1, VALUE obj2) { VALUE result = rb_funcall(obj1, id_match, 1, obj2); - return RTEST(result) ? Qfalse : Qtrue; + return rb_obj_not(result); } @@ -1604,7 +1604,7 @@ respond_to_missing_p(VALUE klass, VALUE obj, VALUE sym, int scope) if (obj == Qundef) return 0; if (rb_method_basic_definition_p(klass, rmiss)) return 0; - return RTEST(rb_funcall(obj, rmiss, 2, sym, scope ? Qfalse : Qtrue)); + return RTEST(rb_funcall(obj, rmiss, 2, sym, RBOOL(!scope))); } diff --git a/vm_insnhelper.c b/vm_insnhelper.c index e01d39de77..271b347d3b 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -5205,7 +5205,7 @@ vm_opt_neq(const rb_iseq_t *iseq, CALL_DATA cd, CALL_DATA cd_eq, VALUE recv, VAL VALUE val = opt_equality(iseq, recv, obj, cd_eq); if (val != Qundef) { - return RTEST(val) ? Qfalse : Qtrue; + return RBOOL(!RTEST(val)); } } @@ -5538,7 +5538,7 @@ static VALUE vm_opt_not(const rb_iseq_t *iseq, CALL_DATA cd, VALUE recv) { if (vm_method_cfunc_is(iseq, cd, recv, rb_obj_not)) { - return RTEST(recv) ? Qfalse : Qtrue; + return RBOOL(!RTEST(recv)); } else { return Qundef; diff --git a/vm_method.c b/vm_method.c index 38d03fbe2b..6867b5cf8c 100644 --- a/vm_method.c +++ b/vm_method.c @@ -2678,7 +2678,7 @@ basic_obj_respond_to(rb_execution_context_t *ec, VALUE obj, ID id, int pub) return FALSE; case 0: ret = basic_obj_respond_to_missing(ec, klass, obj, ID2SYM(id), - pub ? Qfalse : Qtrue); + RBOOL(!pub)); return RTEST(ret) && ret != Qundef; default: return TRUE; |