Skip to content

Use bool instead of Qtrue/Qfalse for normal c boolish value #395

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 29, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions ext/bigdecimal/bigdecimal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1788,7 +1788,7 @@ BigDecimal_mult_with_coerce(VALUE self, VALUE r, size_t coerce_prec)
return CheckGetValue(c);
}

static VALUE BigDecimal_DoDivmod(VALUE self, VALUE r, NULLABLE_BDVALUE *div, NULLABLE_BDVALUE *mod, bool truncate);
static bool BigDecimal_DoDivmod(VALUE self, VALUE r, NULLABLE_BDVALUE *div, NULLABLE_BDVALUE *mod, bool truncate);

/* call-seq:
* a / b -> bigdecimal
Expand Down Expand Up @@ -1853,7 +1853,7 @@ BigDecimal_quo(int argc, VALUE *argv, VALUE self)
* div = (a.to_f/b).floor
* In truncate mode, use truncate instead of floor.
*/
static VALUE
static bool
BigDecimal_DoDivmod(VALUE self, VALUE r, NULLABLE_BDVALUE *div, NULLABLE_BDVALUE *mod, bool truncate)
{
BDVALUE a, b, dv, md, res;
Expand All @@ -1864,7 +1864,7 @@ BigDecimal_DoDivmod(VALUE self, VALUE r, NULLABLE_BDVALUE *div, NULLABLE_BDVALUE
a = GetBDValueMust(self);

b2 = GetBDValueWithPrec(r, GetCoercePrec(a.real, 0));
if (!b2.real_or_null) return Qfalse;
if (!b2.real_or_null) return false;
b = bdvalue_nonnullable(b2);

if (VpIsNaN(a.real) || VpIsNaN(b.real) || (VpIsInf(a.real) && VpIsInf(b.real))) {
Expand Down Expand Up @@ -1939,7 +1939,7 @@ BigDecimal_DoDivmod(VALUE self, VALUE r, NULLABLE_BDVALUE *div, NULLABLE_BDVALUE
RB_GC_GUARD(dv.bigdecimal);
RB_GC_GUARD(md.bigdecimal);
RB_GC_GUARD(res.bigdecimal);
return Qtrue;
return true;
}

/* call-seq:
Expand Down
Loading