summaryrefslogtreecommitdiffstats
path: root/generic/tclStringObj.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2016-12-02 13:50:29 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2016-12-02 13:50:29 (GMT)
commitc2bdc4b2cd9397fb0bc2f3c05bde3ba7587b8625 (patch)
treebc5394255a4d2241ebb54c22062f48abc797338a /generic/tclStringObj.c
parent0e33bed46567780c4d5e5f700e4a6b986801a0b0 (diff)
downloadtcl-c2bdc4b2cd9397fb0bc2f3c05bde3ba7587b8625.zip
tcl-c2bdc4b2cd9397fb0bc2f3c05bde3ba7587b8625.tar.gz
tcl-c2bdc4b2cd9397fb0bc2f3c05bde3ba7587b8625.tar.bz2
Implement %ll (WideInt) handling for Tcl_ObjPrintf(). Use it in some places.
Moved to feature branch temporarily. Breaks build.
Diffstat (limited to 'generic/tclStringObj.c')
-rw-r--r--generic/tclStringObj.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c
index 7008db0..4b171f3 100644
--- a/generic/tclStringObj.c
+++ b/generic/tclStringObj.c
@@ -2472,6 +2472,10 @@ AppendPrintfToObjVA(
Tcl_ListObjAppendElement(NULL, list, Tcl_NewLongObj(
va_arg(argList, long)));
break;
+ case 2:
+ Tcl_ListObjAppendElement(NULL, list, Tcl_NewWideIntObj(
+ va_arg(argList, Tcl_WideInt)));
+ break;
}
break;
case 'e':
@@ -2500,9 +2504,9 @@ AppendPrintfToObjVA(
gotPrecision = 1;
p++;
break;
- /* TODO: support for wide (and bignum?) arguments */
+ /* TODO: support for bignum arguments */
case 'l':
- size = 1;
+ ++size;
p++;
break;
case 'h':
@@ -2708,8 +2712,8 @@ TclStringRepeat(
if (0 == Tcl_AttemptSetObjLength(objResultPtr, count*length)) {
if (interp) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "string size overflow: unable to alloc %lu bytes",
- STRING_SIZE(count*length)));
+ "string size overflow: unable to alloc %llu bytes",
+ (Tcl_WideUInt)STRING_SIZE(count*length)));
Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL);
}
return TCL_ERROR;
@@ -2931,8 +2935,8 @@ TclStringCatObjv(
if (0 == Tcl_AttemptSetObjLength(objResultPtr, length)) {
if (interp) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "concatenation failed: unable to alloc %lu bytes",
- STRING_SIZE(length)));
+ "concatenation failed: unable to alloc %llu bytes",
+ (Tcl_WideUInt)STRING_SIZE(length)));
Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL);
}
return TCL_ERROR;
@@ -2946,8 +2950,8 @@ TclStringCatObjv(
if (0 == Tcl_AttemptSetObjLength(objResultPtr, length)) {
if (interp) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "concatenation failed: unable to alloc %lu bytes",
- STRING_SIZE(length)));
+ "concatenation failed: unable to alloc %llu bytes",
+ (Tcl_WideUInt)STRING_SIZE(length)));
Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL);
}
return TCL_ERROR;