From 9a259b172375b510de40955def893799c4359cf2 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 2 Dec 2016 15:52:09 +0000 Subject: implement "I64" format in Tcl_ObjPrintf as well. Still to be tested. --- generic/tclStringObj.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c index 4b171f3..65f9ab1 100644 --- a/generic/tclStringObj.c +++ b/generic/tclStringObj.c @@ -1865,6 +1865,9 @@ Tcl_AppendFormatToObj( useWide = 1; #endif } + } else if ((ch == 'I') && (format[1] == '6') && (format[2] == '4')) { + step += 2; + useBig = 1; } format += step; @@ -2509,6 +2512,13 @@ AppendPrintfToObjVA( ++size; p++; break; + case 'I': + if (p[1]=='6' && p[2]=='4') { + p += 2; + size = 2; + } + p++; + break; case 'h': size = -1; default: @@ -2712,7 +2722,7 @@ TclStringRepeat( if (0 == Tcl_AttemptSetObjLength(objResultPtr, count*length)) { if (interp) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "string size overflow: unable to alloc %llu bytes", + "string size overflow: unable to alloc %" TCL_LL_MODIFIER "u bytes", (Tcl_WideUInt)STRING_SIZE(count*length))); Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL); } @@ -2935,7 +2945,7 @@ TclStringCatObjv( if (0 == Tcl_AttemptSetObjLength(objResultPtr, length)) { if (interp) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "concatenation failed: unable to alloc %llu bytes", + "concatenation failed: unable to alloc %" TCL_LL_MODIFIER "u bytes", (Tcl_WideUInt)STRING_SIZE(length))); Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL); } @@ -2950,7 +2960,7 @@ TclStringCatObjv( if (0 == Tcl_AttemptSetObjLength(objResultPtr, length)) { if (interp) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "concatenation failed: unable to alloc %llu bytes", + "concatenation failed: unable to alloc %" TCL_LL_MODIFIER "u bytes", (Tcl_WideUInt)STRING_SIZE(length))); Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL); } -- cgit v0.12