diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-12-13 15:39:23 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-12-13 15:39:23 (GMT) |
commit | e43882908292c514bc01b2ca0c63ce6d0611c692 (patch) | |
tree | a73b0f280a2440f778b4ce2e29c09f8bee03a85b /generic/tclScan.c | |
parent | 94e8f6336742c2df3ad63efbb598af741e0e7c5b (diff) | |
parent | 4cef9fbbe29e5ba76aaa7eaa7e91dd9b7d22e471 (diff) | |
download | tcl-e43882908292c514bc01b2ca0c63ce6d0611c692.zip tcl-e43882908292c514bc01b2ca0c63ce6d0611c692.tar.gz tcl-e43882908292c514bc01b2ca0c63ce6d0611c692.tar.bz2 |
Merge 8.7
Diffstat (limited to 'generic/tclScan.c')
-rw-r--r-- | generic/tclScan.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/generic/tclScan.c b/generic/tclScan.c index 5cf404f..9c9137c 100644 --- a/generic/tclScan.c +++ b/generic/tclScan.c @@ -10,7 +10,7 @@ */ #include "tclInt.h" -#include "tommath.h" +#include "tclTomMath.h" /* * Flag values used by Tcl_ScanObjCmd. @@ -263,11 +263,11 @@ ValidateFormat( Tcl_UniChar ch = 0; int objIndex, xpgSize, nspace = numVars; int *nassign = (int *)TclStackAlloc(interp, nspace * sizeof(int)); - char buf[TCL_UTF_MAX + 1] = ""; Tcl_Obj *errorMsg; /* Place to build an error messages. Note that * these are messy operations because we do * not want to use the formatting engine; * we're inside there! */ + char buf[TCL_UTF_MAX + 1] = ""; /* * Initialize an array that records the number of times a variable is @@ -932,13 +932,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_ull(&big, (Tcl_WideUInt)wideValue); Tcl_SetBignumObj(objPtr, &big); } } else { @@ -979,13 +978,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_ull(&big, (unsigned long)value); Tcl_SetBignumObj(objPtr, &big); } #else |