summaryrefslogtreecommitdiff
path: root/complex.c
diff options
context:
space:
mode:
authorS.H <gamelinks007@gmail.com>2021-08-18 02:25:19 +0900
committerGitHub <noreply@github.com>2021-08-18 02:25:19 +0900
commit58bd9434360d5a46974eaa03139893c0145615dc (patch)
tree9ed044f8c37e0dfbdf54d0f784b85031bce57dd6 /complex.c
parent6a9bfa4d9387b9d8f07f43f4546437be57f9e27c (diff)
downloadruby-58bd9434360d5a46974eaa03139893c0145615dc.tar.gz
Replace f_boolcast with RBOOL macro
* Move f_boolcast definination * Remove f_boolcast macro defination * to
Diffstat (limited to 'complex.c')
-rw-r--r--complex.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/complex.c b/complex.c
index 09e47f8007..f0dfd2ab78 100644
--- a/complex.c
+++ b/complex.c
@@ -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));