diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2016-12-20 09:30:02 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2016-12-20 09:30:02 (GMT) |
commit | 1c8b2b280f3d85688ac53e997df447281672a44a (patch) | |
tree | d84b517e050859f5635eef156f6869f152c3de2a /generic/tclStringObj.c | |
parent | b8271467dc712230e7eecf2818f7232c2ebda8b4 (diff) | |
parent | 43b22f924faa4963e0238f2191f56270c8d90b81 (diff) | |
download | tcl-1c8b2b280f3d85688ac53e997df447281672a44a.zip tcl-1c8b2b280f3d85688ac53e997df447281672a44a.tar.gz tcl-1c8b2b280f3d85688ac53e997df447281672a44a.tar.bz2 |
merge trunk (still has test failure in socket.test)
Diffstat (limited to 'generic/tclStringObj.c')
-rw-r--r-- | generic/tclStringObj.c | 44 |
1 files changed, 35 insertions, 9 deletions
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c index 6184461..db233b3 100644 --- a/generic/tclStringObj.c +++ b/generic/tclStringObj.c @@ -1865,6 +1865,14 @@ Tcl_AppendFormatToObj( useWide = 1; #endif } + } else if ((ch == 'I') && (format[1] == '6') && (format[2] == '4')) { + format += (step + 2); + step = Tcl_UtfToUniChar(format, &ch); + useBig = 1; + } else if (ch == 'L') { + format += step; + step = Tcl_UtfToUniChar(format, &ch); + useBig = 1; } format += step; @@ -2472,6 +2480,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 +2512,20 @@ 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 'L': + size = 2; + p++; + break; + case 'I': + if (p[1]=='6' && p[2]=='4') { + p += 2; + size = 2; + } p++; break; case 'h': @@ -2708,8 +2731,9 @@ 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 %" + TCL_LL_MODIFIER "u bytes", + (Tcl_WideUInt)STRING_SIZE(count*length))); Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL); } return TCL_ERROR; @@ -2895,7 +2919,7 @@ TclStringCatObjv( * Broken interface! Byte array value routines offer no way * to handle failure to allocate enough space. Following * stanza may panic. - */ + */ if (inPlace && !Tcl_IsShared(*objv)) { int start; @@ -2931,8 +2955,9 @@ 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 %" + TCL_LL_MODIFIER "u bytes", + (Tcl_WideUInt)STRING_SIZE(length))); Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL); } return TCL_ERROR; @@ -2946,8 +2971,9 @@ 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 %" + TCL_LL_MODIFIER "u bytes", + (Tcl_WideUInt)STRING_SIZE(length))); Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL); } return TCL_ERROR; |