summaryrefslogtreecommitdiffstats
path: root/generic/tclScan.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-11-12 12:11:05 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-11-12 12:11:05 (GMT)
commit41e4211a15b085e6f456693fe2ef6ad980bde593 (patch)
tree2115df6e1746693165934fe335889d189f533313 /generic/tclScan.c
parente512564f360551e1821bc646ce75314246b9a0ee (diff)
parent34714bcefaa3ba23593153c232829b2af6914528 (diff)
downloadtcl-41e4211a15b085e6f456693fe2ef6ad980bde593.zip
tcl-41e4211a15b085e6f456693fe2ef6ad980bde593.tar.gz
tcl-41e4211a15b085e6f456693fe2ef6ad980bde593.tar.bz2
Merge 8.7. Finish implementation.
Diffstat (limited to 'generic/tclScan.c')
-rw-r--r--generic/tclScan.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/generic/tclScan.c b/generic/tclScan.c
index 50a3fe3..ba24ecf 100644
--- a/generic/tclScan.c
+++ b/generic/tclScan.c
@@ -929,13 +929,12 @@ Tcl_ScanObjCmd(
}
if ((flags & SCAN_UNSIGNED) && (wideValue < 0)) {
mp_int big;
- if (mp_init(&big) != MP_OKAY) {
+ if (mp_init_u64(&big, (Tcl_WideUInt)wideValue) != MP_OKAY) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"insufficient memory to create bignum", -1));
Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL);
return TCL_ERROR;
} else {
- mp_set_u64(&big, (Tcl_WideUInt)wideValue);
Tcl_SetBignumObj(objPtr, &big);
}
} else {
@@ -976,13 +975,12 @@ Tcl_ScanObjCmd(
if ((flags & SCAN_UNSIGNED) && (value < 0)) {
#ifdef TCL_WIDE_INT_IS_LONG
mp_int big;
- if (mp_init(&big) != MP_OKAY) {
+ if (mp_init_u64(&big, (unsigned long)value) != MP_OKAY) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"insufficient memory to create bignum", -1));
Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL);
return TCL_ERROR;
} else {
- mp_set_u64(&big, (unsigned long)value);
Tcl_SetBignumObj(objPtr, &big);
}
#else