summaryrefslogtreecommitdiffstats
path: root/generic/tclThread.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2011-03-12 15:06:47 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2011-03-12 15:06:47 (GMT)
commit0da519374fd5eda8bb87a127abdefffdffb33b0a (patch)
treeed891ab3e00ea5888426f25d675aff2d89a00b1d /generic/tclThread.c
parent49da32e6e4e84c1e3ca79b7fa03f4ee0b78728dd (diff)
downloadtcl-0da519374fd5eda8bb87a127abdefffdffb33b0a.zip
tcl-0da519374fd5eda8bb87a127abdefffdffb33b0a.tar.gz
tcl-0da519374fd5eda8bb87a127abdefffdffb33b0a.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.
Diffstat (limited to 'generic/tclThread.c')
-rw-r--r--generic/tclThread.c15
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;