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/tclThread.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/tclThread.c')
-rw-r--r-- | generic/tclThread.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/generic/tclThread.c b/generic/tclThread.c index 46e4139..d1f2691 100644 --- a/generic/tclThread.c +++ b/generic/tclThread.c @@ -83,16 +83,17 @@ Tcl_GetThreadData( /* * Initialize the key for this thread. */ + result = TclThreadStorageKeyGet(keyPtr); if (result == NULL) { - result = ckalloc((size_t)size); + result = ckalloc(size); memset(result, 0, (size_t) size); TclThreadStorageKeySet(keyPtr, result); } #else /* TCL_THREADS */ if (*keyPtr == NULL) { - result = ckalloc((size_t)size); + result = ckalloc(size); memset(result, 0, (size_t)size); *keyPtr = result; RememberSyncObject(keyPtr, &keyRecord); @@ -178,14 +179,14 @@ RememberSyncObject( if (recPtr->num >= recPtr->max) { recPtr->max += 8; - newList = (void **) ckalloc(recPtr->max * sizeof(void *)); + newList = ckalloc(recPtr->max * sizeof(void *)); for (i=0,j=0 ; i<recPtr->num ; i++) { if (recPtr->list[i] != NULL) { newList[j++] = recPtr->list[i]; } } if (recPtr->list != NULL) { - ckfree((char *) recPtr->list); + ckfree(recPtr->list); } recPtr->list = newList; recPtr->num = j; @@ -397,7 +398,7 @@ TclFinalizeSynchronization(void) blockPtr = *keyPtr; ckfree(blockPtr); } - ckfree((char *) keyRecord.list); + ckfree(keyRecord.list); keyRecord.list = NULL; } keyRecord.max = 0; @@ -417,7 +418,7 @@ TclFinalizeSynchronization(void) } } if (mutexRecord.list != NULL) { - ckfree((char *) mutexRecord.list); + ckfree(mutexRecord.list); mutexRecord.list = NULL; } mutexRecord.max = 0; @@ -430,7 +431,7 @@ TclFinalizeSynchronization(void) } } if (condRecord.list != NULL) { - ckfree((char *) condRecord.list); + ckfree(condRecord.list); condRecord.list = NULL; } condRecord.max = 0; |