summaryrefslogtreecommitdiffstats
path: root/generic/tclExecute.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-03-25 21:50:34 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-03-25 21:50:34 (GMT)
commit6d27f27fe64178257962cf3fa9cab61b03cbcc51 (patch)
treec8909ef172c239ac052863e6cb5f450c68465f4b /generic/tclExecute.c
parentaaf56c80863b3c12efb020dd21eaa440be153968 (diff)
downloadtcl-6d27f27fe64178257962cf3fa9cab61b03cbcc51.zip
tcl-6d27f27fe64178257962cf3fa9cab61b03cbcc51.tar.gz
tcl-6d27f27fe64178257962cf3fa9cab61b03cbcc51.tar.bz2
Eliminate all usage of mp_iszero/mp_iseven/mp_isodd/mp_isneg from libtommath: In the upcoming new version those will become real functions, causing possible binary incompatibility. This change makes Tcl independant from libtommath's changes.
Diffstat (limited to 'generic/tclExecute.c')
-rw-r--r--generic/tclExecute.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 77a173e..ca14a55 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -8367,7 +8367,7 @@ ExecuteExtendedBinaryMathOp(
mp_init(&bigResult);
mp_init(&bigRemainder);
mp_div(&big1, &big2, &bigResult, &bigRemainder);
- if (!mp_iszero(&bigRemainder) && (bigRemainder.sign != big2.sign)) {
+ if ((bigRemainder.used) != 0 && (bigRemainder.sign != big2.sign)) {
/*
* Convert to Tcl's integer division rules.
*/
@@ -8768,7 +8768,7 @@ ExecuteExtendedBinaryMathOp(
Tcl_TakeBignumFromObj(NULL, value2Ptr, &big2);
negativeExponent = (mp_cmp_d(&big2, 0) == MP_LT);
mp_mod_2d(&big2, 1, &big2);
- oddExponent = !mp_iszero(&big2);
+ oddExponent = big2.used != 0;
mp_clear(&big2);
break;
}
@@ -9249,7 +9249,7 @@ ExecuteExtendedBinaryMathOp(
mp_mul(&big1, &big2, &bigResult);
break;
case INST_DIV:
- if (mp_iszero(&big2)) {
+ if (big2.used == 0) {
mp_clear(&big1);
mp_clear(&big2);
mp_clear(&bigResult);
@@ -9258,7 +9258,7 @@ ExecuteExtendedBinaryMathOp(
mp_init(&bigRemainder);
mp_div(&big1, &big2, &bigResult, &bigRemainder);
/* TODO: internals intrusion */
- if (!mp_iszero(&bigRemainder)
+ if (bigRemainder.used != 0
&& (bigRemainder.sign != big2.sign)) {
/*
* Convert to Tcl's integer division rules.