summaryrefslogtreecommitdiffstats
path: root/generic/tclTomMathInterface.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-10-23 14:11:37 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-10-23 14:11:37 (GMT)
commitb986f3138510aaaf704b87f39e2815ad6e3fa5ac (patch)
treea7fe057b8928510736187536bd43ec265f28287b /generic/tclTomMathInterface.c
parent6b002a2d06574c33145c29bd823886ef719e2f7c (diff)
downloadtcl-b986f3138510aaaf704b87f39e2815ad6e3fa5ac.zip
tcl-b986f3138510aaaf704b87f39e2815ad6e3fa5ac.tar.gz
tcl-b986f3138510aaaf704b87f39e2815ad6e3fa5ac.tar.bz2
Deprecate mp_unsigned_bin_size, mp_init_set_int, mp_set_int, which are deprecated in libtommath 1.2.0.
In stead, add new function mp_set_ul to the build (mp_ubin_size was already included in the build earlier)
Diffstat (limited to 'generic/tclTomMathInterface.c')
-rw-r--r--generic/tclTomMathInterface.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/generic/tclTomMathInterface.c b/generic/tclTomMathInterface.c
index 6eddf54..589599e 100644
--- a/generic/tclTomMathInterface.c
+++ b/generic/tclTomMathInterface.c
@@ -112,11 +112,12 @@ TclBNInitBignumFromWideInt(
Tcl_WideInt v) /* Initial value */
{
if (mp_init(a) != MP_OKAY) {
- Tcl_Panic("initialization failure in TclBNInitBignumFromWideInt");
+ wipanic:
+ Tcl_Panic("initialization failure in TclBNInitBignumFromWideInt");
}
if (v < 0) {
mp_set_ull(a, (Tcl_WideUInt)(-v));
- mp_neg(a, a);
+ if (mp_neg(a, a) != MP_OKAY) goto wipanic;
} else {
mp_set_ull(a, (Tcl_WideUInt)v);
}