diff options
author | S.H <gamelinks007@gmail.com> | 2021-08-18 02:25:19 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-18 02:25:19 +0900 |
commit | 58bd9434360d5a46974eaa03139893c0145615dc (patch) | |
tree | 9ed044f8c37e0dfbdf54d0f784b85031bce57dd6 /complex.c | |
parent | 6a9bfa4d9387b9d8f07f43f4546437be57f9e27c (diff) |
Replace f_boolcast with RBOOL macro
* Move f_boolcast definination
* Remove f_boolcast macro defination
* to
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/4748
Merged-By: nobu <nobu@ruby-lang.org>
Diffstat (limited to 'complex.c')
-rw-r--r-- | complex.c | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -54,8 +54,6 @@ static ID id_abs, id_arg, #define id_quo idQuo #define id_fdiv idFdiv -#define f_boolcast(x) ((x) ? Qtrue : Qfalse) - #define fun1(n) \ inline static VALUE \ f_##n(VALUE x)\ @@ -1092,15 +1090,15 @@ nucomp_eqeq_p(VALUE self, VALUE other) if (RB_TYPE_P(other, T_COMPLEX)) { get_dat2(self, other); - return f_boolcast(f_eqeq_p(adat->real, bdat->real) && + return RBOOL(f_eqeq_p(adat->real, bdat->real) && f_eqeq_p(adat->imag, bdat->imag)); } if (k_numeric_p(other) && f_real_p(other)) { get_dat1(self); - return f_boolcast(f_eqeq_p(dat->real, other) && f_zero_p(dat->imag)); + return RBOOL(f_eqeq_p(dat->real, other) && f_zero_p(dat->imag)); } - return f_boolcast(f_eqeq_p(other, self)); + return RBOOL(f_eqeq_p(other, self)); } static bool @@ -1354,7 +1352,7 @@ nucomp_eql_p(VALUE self, VALUE other) if (RB_TYPE_P(other, T_COMPLEX)) { get_dat2(self, other); - return f_boolcast((CLASS_OF(adat->real) == CLASS_OF(bdat->real)) && + return RBOOL((CLASS_OF(adat->real) == CLASS_OF(bdat->real)) && (CLASS_OF(adat->imag) == CLASS_OF(bdat->imag)) && f_eqeq_p(self, other)); |