diff options
Diffstat (limited to 'generic/tclStringObj.c')
-rw-r--r-- | generic/tclStringObj.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c index 3de29ef..6ab2371 100644 --- a/generic/tclStringObj.c +++ b/generic/tclStringObj.c @@ -143,7 +143,7 @@ GrowStringBuffer( if (flag == 0 || stringPtr->allocated > 0) { if (needed <= INT_MAX / 2) { attempt = 2 * needed; - ptr = attemptckrealloc(objPtr->bytes, attempt + 1); + ptr = (char *)attemptckrealloc(objPtr->bytes, attempt + 1); } if (ptr == NULL) { /* @@ -156,7 +156,7 @@ GrowStringBuffer( int growth = (int) ((extra > limit) ? limit : extra); attempt = needed + growth; - ptr = attemptckrealloc(objPtr->bytes, attempt + 1); + ptr = (char *)attemptckrealloc(objPtr->bytes, attempt + 1); } } if (ptr == NULL) { @@ -165,7 +165,7 @@ GrowStringBuffer( */ attempt = needed; - ptr = ckrealloc(objPtr->bytes, attempt + 1); + ptr = (char *)ckrealloc(objPtr->bytes, attempt + 1); } objPtr->bytes = ptr; stringPtr->allocated = attempt; @@ -347,6 +347,9 @@ Tcl_DbNewStringObj( int line) /* Line number in the source file; used for * debugging. */ { + (void)file; + (void)line; + return Tcl_NewStringObj(bytes, length); } #endif /* TCL_MEM_DEBUG */ @@ -881,9 +884,9 @@ Tcl_SetObjLength( * Need to enlarge the buffer. */ if (objPtr->bytes == &tclEmptyString) { - objPtr->bytes = ckalloc(length + 1); + objPtr->bytes = (char *)ckalloc(length + 1); } else { - objPtr->bytes = ckrealloc(objPtr->bytes, length + 1); + objPtr->bytes = (char *)ckrealloc(objPtr->bytes, length + 1); } stringPtr->allocated = length; } @@ -987,9 +990,9 @@ Tcl_AttemptSetObjLength( char *newBytes; if (objPtr->bytes == &tclEmptyString) { - newBytes = attemptckalloc(length + 1); + newBytes = (char *)attemptckalloc(length + 1); } else { - newBytes = attemptckrealloc(objPtr->bytes, length + 1); + newBytes = (char *)attemptckrealloc(objPtr->bytes, length + 1); } if (newBytes == NULL) { return 0; @@ -3583,7 +3586,7 @@ TclStringFirst( * starting at check and stopping when there's not enough room * for the needle left. */ - check = memchr(check, bn[0], (end + 1 - ln) - check); + check = (unsigned char *)memchr(check, bn[0], (end + 1 - ln) - check); if (check == NULL) { /* Leading byte not found -> needle cannot be found. */ return -1; @@ -4166,9 +4169,11 @@ DupStringInternalRep( static int SetStringFromAny( - Tcl_Interp *interp, /* Used for error reporting if not NULL. */ + Tcl_Interp *dummy, /* Not used. */ Tcl_Obj *objPtr) /* The object to convert. */ { + (void)dummy; + if (!TclHasIntRep(objPtr, &tclStringType)) { String *stringPtr = stringAlloc(0); |