summaryrefslogtreecommitdiff
path: root/ext/bigdecimal/bigdecimal.c
diff options
context:
space:
mode:
authormrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-03-23 14:30:56 +0000
committermrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-03-23 14:30:56 +0000
commitbc43842252acc3d62b83f6352c601c5b5253cf60 (patch)
treec56d2193ce289013198d43d0456863cb9edac89e /ext/bigdecimal/bigdecimal.c
parent338456ad94708c0ff4f057ed9e66da8cd34f69ae (diff)
* ext/bigdecimal/bigdecimal.c (BigDecimal_divide): Use Qnil and NIL_P
instead of (VALUE)0 as a return value. * ext/bigdecimal/bigdecimal.c (BigDecimal_div): ditto. * ext/bigdecimal/bigdecimal.c (BigDecimal_divremain): ditto. * ext/bigdecimal/bigdecimal.c (BigDecimal_remainder): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/bigdecimal/bigdecimal.c')
-rw-r--r--ext/bigdecimal/bigdecimal.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c
index 871001f..02d2da8 100644
--- a/ext/bigdecimal/bigdecimal.c
+++ b/ext/bigdecimal/bigdecimal.c
@@ -1211,7 +1211,7 @@ BigDecimal_divide(Real **c, Real **res, Real **div, VALUE self, VALUE r)
GUARD_OBJ((*c), VpCreateRbObject(mx, "#0"));
GUARD_OBJ((*res), VpCreateRbObject((mx+1) * 2 +(VpBaseFig() + 1), "#0"));
VpDivd(*c, *res, a, b);
- return (VALUE)0;
+ return Qnil;
}
/* call-seq:
@@ -1240,7 +1240,7 @@ BigDecimal_div(VALUE self, VALUE r)
ENTER(5);
Real *c=NULL, *res=NULL, *div = NULL;
r = BigDecimal_divide(&c, &res, &div, self, r);
- if (r != (VALUE)0) return r; /* coerced by other */
+ if (!NIL_P(r)) return r; /* coerced by other */
SAVE(c); SAVE(res); SAVE(div);
/* a/b = c + r/b */
/* c xxxxx
@@ -1401,7 +1401,7 @@ BigDecimal_divremain(VALUE self, VALUE r, Real **dv, Real **rv)
*dv = d;
*rv = ff;
- return (VALUE)0;
+ return Qnil;
}
/* Returns the remainder from dividing by the value.
@@ -1414,7 +1414,7 @@ BigDecimal_remainder(VALUE self, VALUE r) /* remainder */
VALUE f;
Real *d, *rv = 0;
f = BigDecimal_divremain(self, r, &d, &rv);
- if (f != (VALUE)0) return f;
+ if (!NIL_P(f)) return f;
return ToValue(rv);
}