diff options
author | dkf <dkf@noemail.net> | 2011-03-12 15:06:47 (GMT) |
---|---|---|
committer | dkf <dkf@noemail.net> | 2011-03-12 15:06:47 (GMT) |
commit | dd3a8a349837409f90ccabcc9aef092197d4da6f (patch) | |
tree | ed891ab3e00ea5888426f25d675aff2d89a00b1d /generic/tclStringObj.c | |
parent | 3bc57329cfbbd1026bf237979f491e7336f26c15 (diff) | |
download | tcl-dd3a8a349837409f90ccabcc9aef092197d4da6f.zip tcl-dd3a8a349837409f90ccabcc9aef092197d4da6f.tar.gz tcl-dd3a8a349837409f90ccabcc9aef092197d4da6f.tar.bz2 |
Adjust ckalloc/ckfree macros to greatly reduce number of explicit casts in
rest of Tcl source code. No ABI change. API change *should* be harmless.
FossilOrigin-Name: 5574bdd262b2672cde48771787370c12854cecf4
Diffstat (limited to 'generic/tclStringObj.c')
-rw-r--r-- | generic/tclStringObj.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c index 956a9f0..7cdbb3e 100644 --- a/generic/tclStringObj.c +++ b/generic/tclStringObj.c @@ -204,7 +204,7 @@ GrowStringBuffer( if (flag == 0 || stringPtr->allocated > 0) { attempt = 2 * needed; if (attempt >= 0) { - ptr = attemptckrealloc(objPtr->bytes, (unsigned) attempt + 1); + ptr = attemptckrealloc(objPtr->bytes, attempt + 1); } if (ptr == NULL) { /* @@ -217,7 +217,7 @@ GrowStringBuffer( int growth = (int) ((extra > limit) ? limit : extra); attempt = needed + growth; - ptr = attemptckrealloc(objPtr->bytes, (unsigned) attempt + 1); + ptr = attemptckrealloc(objPtr->bytes, attempt + 1); } } if (ptr == NULL) { @@ -226,7 +226,7 @@ GrowStringBuffer( */ attempt = needed; - ptr = ckrealloc(objPtr->bytes, (unsigned) attempt + 1); + ptr = ckrealloc(objPtr->bytes, attempt + 1); } objPtr->bytes = ptr; stringPtr->allocated = attempt; @@ -834,9 +834,9 @@ Tcl_SetObjLength( * Need to enlarge the buffer. */ if (objPtr->bytes == tclEmptyStringRep) { - objPtr->bytes = ckalloc((unsigned) length+1); + objPtr->bytes = ckalloc(length + 1); } else { - objPtr->bytes = ckrealloc(objPtr->bytes, (unsigned) length+1); + objPtr->bytes = ckrealloc(objPtr->bytes, length + 1); } stringPtr->allocated = length; } @@ -940,9 +940,9 @@ Tcl_AttemptSetObjLength( char *newBytes; if (objPtr->bytes == tclEmptyStringRep) { - newBytes = attemptckalloc((unsigned) length+1); + newBytes = attemptckalloc(length + 1); } else { - newBytes = attemptckrealloc(objPtr->bytes, (unsigned) length+1); + newBytes = attemptckrealloc(objPtr->bytes, length + 1); } if (newBytes == NULL) { return 0; @@ -3061,7 +3061,7 @@ static void FreeStringInternalRep( Tcl_Obj *objPtr) /* Object with internal rep to free. */ { - ckfree((char *) GET_STRING(objPtr)); + ckfree(GET_STRING(objPtr)); objPtr->typePtr = NULL; } |