summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
Diffstat (limited to 'generic')
-rw-r--r--generic/tclCkalloc.c34
-rw-r--r--generic/tclThread.c14
-rw-r--r--generic/tclThreadStorage.c10
3 files changed, 29 insertions, 29 deletions
diff --git a/generic/tclCkalloc.c b/generic/tclCkalloc.c
index e72ad97..338b718 100644
--- a/generic/tclCkalloc.c
+++ b/generic/tclCkalloc.c
@@ -14,7 +14,7 @@
*
* This code contributed by Karl Lehenbauer and Mark Diekhans
*
- * RCS: @(#) $Id: tclCkalloc.c,v 1.28 2006/11/02 15:58:04 dgp Exp $
+ * RCS: @(#) $Id: tclCkalloc.c,v 1.29 2006/11/07 14:26:26 dkf Exp $
*/
#include "tclInt.h"
@@ -261,8 +261,8 @@ ValidateMemory(
}
if (nukeGuards) {
- memset((char *) memHeaderP->low_guard, 0, LOW_GUARD_SIZE);
- memset((char *) hiPtr, 0, HIGH_GUARD_SIZE);
+ memset(memHeaderP->low_guard, 0, LOW_GUARD_SIZE);
+ memset(hiPtr, 0, HIGH_GUARD_SIZE);
}
}
@@ -397,10 +397,10 @@ Tcl_DbCkalloc(
*/
if (init_malloced_bodies) {
- memset((VOID *) result, GUARD_VALUE,
+ memset(result, GUARD_VALUE,
size + sizeof(struct mem_header) + HIGH_GUARD_SIZE);
} else {
- memset((char *) result->low_guard, GUARD_VALUE, LOW_GUARD_SIZE);
+ memset(result->low_guard, GUARD_VALUE, LOW_GUARD_SIZE);
memset(result->body + size, GUARD_VALUE, HIGH_GUARD_SIZE);
}
if (!ckallocInit) {
@@ -487,10 +487,10 @@ Tcl_AttemptDbCkalloc(
* allocated list.
*/
if (init_malloced_bodies) {
- memset((VOID *) result, GUARD_VALUE,
+ memset(result, GUARD_VALUE,
size + sizeof(struct mem_header) + HIGH_GUARD_SIZE);
} else {
- memset((char *) result->low_guard, GUARD_VALUE, LOW_GUARD_SIZE);
+ memset(result->low_guard, GUARD_VALUE, LOW_GUARD_SIZE);
memset(result->body + size, GUARD_VALUE, HIGH_GUARD_SIZE);
}
if (!ckallocInit) {
@@ -603,7 +603,7 @@ Tcl_DbCkfree(
Tcl_MutexLock(ckallocMutexPtr);
ValidateMemory(memp, file, line, TRUE);
if (init_malloced_bodies) {
- memset((VOID *) ptr, GUARD_VALUE, (size_t) memp->length);
+ memset(ptr, GUARD_VALUE, (size_t) memp->length);
}
total_frees++;
@@ -656,7 +656,7 @@ Tcl_DbCkrealloc(
CONST char *file,
int line)
{
- char *new;
+ char *newPtr;
unsigned int copySize;
struct mem_header *memp;
@@ -674,10 +674,10 @@ Tcl_DbCkrealloc(
if (copySize > (unsigned int) memp->length) {
copySize = memp->length;
}
- new = Tcl_DbCkalloc(size, file, line);
- memcpy((VOID *) new, (VOID *) ptr, (size_t) copySize);
+ newPtr = Tcl_DbCkalloc(size, file, line);
+ memcpy(newPtr, ptr, (size_t) copySize);
Tcl_DbCkfree(ptr, file, line);
- return new;
+ return newPtr;
}
char *
@@ -687,7 +687,7 @@ Tcl_AttemptDbCkrealloc(
CONST char *file,
int line)
{
- char *new;
+ char *newPtr;
unsigned int copySize;
struct mem_header *memp;
@@ -705,13 +705,13 @@ Tcl_AttemptDbCkrealloc(
if (copySize > (unsigned int) memp->length) {
copySize = memp->length;
}
- new = Tcl_AttemptDbCkalloc(size, file, line);
- if (new == NULL) {
+ newPtr = Tcl_AttemptDbCkalloc(size, file, line);
+ if (newPtr == NULL) {
return NULL;
}
- memcpy((VOID *) new, (VOID *) ptr, (size_t) copySize);
+ memcpy(newPtr, ptr, (size_t) copySize);
Tcl_DbCkfree(ptr, file, line);
- return new;
+ return newPtr;
}
diff --git a/generic/tclThread.c b/generic/tclThread.c
index c5def48..9372d78 100644
--- a/generic/tclThread.c
+++ b/generic/tclThread.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclThread.c,v 1.14 2005/11/02 11:55:47 dkf Exp $
+ * RCS: @(#) $Id: tclThread.c,v 1.15 2006/11/07 14:26:26 dkf Exp $
*/
#include "tclInt.h"
@@ -87,14 +87,14 @@ Tcl_GetThreadData(
result = TclpThreadDataKeyGet(keyPtr);
if (result == NULL) {
- result = (void *) ckalloc((size_t) size);
+ result = ckalloc((size_t) size);
memset(result, 0, (size_t) size);
TclpThreadDataKeySet(keyPtr, result);
}
#else /* TCL_THREADS */
if (*keyPtr == NULL) {
- result = (void *) ckalloc((size_t) size);
- memset((char *) result, 0, (size_t) size);
+ result = ckalloc((size_t) size);
+ memset(result, 0, (size_t) size);
*keyPtr = (Tcl_ThreadDataKey)result;
RememberSyncObject((char *) keyPtr, &keyRecord);
}
@@ -126,10 +126,10 @@ TclThreadDataKeyGet(
* (pthread_key_t **) */
{
#ifdef TCL_THREADS
- return (void *) TclpThreadDataKeyGet(keyPtr);
+ return TclpThreadDataKeyGet(keyPtr);
#else /* TCL_THREADS */
char *result = *(char **) keyPtr;
- return (void *) result;
+ return result;
#endif /* TCL_THREADS */
}
@@ -358,7 +358,7 @@ void
TclFinalizeSynchronization(void)
{
#ifdef TCL_THREADS
- void* blockPtr;
+ void *blockPtr;
Tcl_ThreadDataKey *keyPtr;
Tcl_Mutex *mutexPtr;
Tcl_Condition *condPtr;
diff --git a/generic/tclThreadStorage.c b/generic/tclThreadStorage.c
index 949b7a3..33db5a2 100644
--- a/generic/tclThreadStorage.c
+++ b/generic/tclThreadStorage.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclThreadStorage.c,v 1.9 2005/11/27 02:33:49 das Exp $
+ * RCS: @(#) $Id: tclThreadStorage.c,v 1.10 2006/11/07 14:26:26 dkf Exp $
*/
#include "tclInt.h"
@@ -135,7 +135,7 @@ AllocThreadStorageEntry(
Tcl_HashEntry *hPtr;
hPtr = (Tcl_HashEntry *) TclpSysAlloc(sizeof(Tcl_HashEntry), 0);
- hPtr->key.oneWordValue = (char *)keyPtr;
+ hPtr->key.oneWordValue = keyPtr;
return hPtr;
}
@@ -299,7 +299,7 @@ TclInitThreadStorage(void)
* We also initialize the cache.
*/
- memset((ThreadStorage *)&threadStorageCache, 0,
+ memset(&threadStorageCache, 0,
sizeof(ThreadStorage) * STORAGE_CACHE_SLOTS);
/*
@@ -338,7 +338,7 @@ TclpThreadDataKeyGet(
if (hPtr == NULL) {
return NULL;
}
- return (void *) Tcl_GetHashValue(hPtr);
+ return Tcl_GetHashValue(hPtr);
}
/*
@@ -529,7 +529,7 @@ TclFinalizeThreadStorage(void)
* Clear out the thread storage cache as well.
*/
- memset((ThreadStorage *)&threadStorageCache, 0,
+ memset(&threadStorageCache, 0,
sizeof(ThreadStorage) * STORAGE_CACHE_SLOTS);
/*