summaryrefslogtreecommitdiffstats
path: root/generic/tclStringObj.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2018-09-21 09:29:24 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2018-09-21 09:29:24 (GMT)
commitd025ae5c08c20fe811f1917da0408e1f23768786 (patch)
tree66859d52f14255fb384c2699df0a8143a7b39b77 /generic/tclStringObj.c
parentfbef9aa84089336e767f0dafe410df51b4f1d3b3 (diff)
parentbd42171094d5ada2e2e46978f2e842a66b6fa44e (diff)
downloadtcl-d025ae5c08c20fe811f1917da0408e1f23768786.zip
tcl-d025ae5c08c20fe811f1917da0408e1f23768786.tar.gz
tcl-d025ae5c08c20fe811f1917da0408e1f23768786.tar.bz2
merge core-8-branch
Diffstat (limited to 'generic/tclStringObj.c')
-rw-r--r--generic/tclStringObj.c28
1 files changed, 5 insertions, 23 deletions
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c
index f98180f..fa55bb0 100644
--- a/generic/tclStringObj.c
+++ b/generic/tclStringObj.c
@@ -2097,35 +2097,17 @@ Tcl_AppendFormatToObj(
}
#ifndef TCL_WIDE_INT_IS_LONG
} else if (useWide) {
- if (TclGetWideIntFromObj(NULL, segment, &w) != TCL_OK) {
- Tcl_Obj *objPtr;
-
- if (Tcl_GetBignumFromObj(interp,segment,&big) != TCL_OK) {
- goto error;
- }
- mp_mod_2d(&big, (int) CHAR_BIT*sizeof(Tcl_WideInt), &big);
- objPtr = Tcl_NewBignumObj(&big);
- Tcl_IncrRefCount(objPtr);
- TclGetWideIntFromObj(NULL, objPtr, &w);
- Tcl_DecrRefCount(objPtr);
+ if (TclGetWideBitsFromObj(interp, segment, &w) != TCL_OK) {
+ goto error;
}
isNegative = (w < (Tcl_WideInt) 0);
if (w == (Tcl_WideInt) 0) gotHash = 0;
#endif
} else if (TclGetLongFromObj(NULL, segment, &l) != TCL_OK) {
- if (TclGetWideIntFromObj(NULL, segment, &w) != TCL_OK) {
- Tcl_Obj *objPtr;
-
- if (Tcl_GetBignumFromObj(interp,segment,&big) != TCL_OK) {
- goto error;
- }
- mp_mod_2d(&big, (int) CHAR_BIT * sizeof(long), &big);
- objPtr = Tcl_NewBignumObj(&big);
- Tcl_IncrRefCount(objPtr);
- TclGetLongFromObj(NULL, objPtr, &l);
- Tcl_DecrRefCount(objPtr);
+ if (TclGetWideBitsFromObj(interp, segment, &w) != TCL_OK) {
+ goto error;
} else {
- l = Tcl_WideAsLong(w);
+ l = (long) w;
}
if (useShort) {
s = (short) l;