From 884ba1c7869af6d659c880a2dc8a9d7a76f034bd Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 24 Mar 2011 16:43:38 +0000 Subject: Restored C++ usability to the memory allocation and free macros. --- ChangeLog | 5 +++++ generic/tcl.h | 12 ++++++------ generic/tclThreadAlloc.c | 0 3 files changed, 11 insertions(+), 6 deletions(-) mode change 100644 => 100755 generic/tclThreadAlloc.c diff --git a/ChangeLog b/ChangeLog index c327093..3440a14 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-03-24 Don Porter + + * generic/tcl.h (ckfree,etc.): Restored C++ usability to the memory + allocation and free macros. + 2011-03-24 Donal K. Fellows * generic/tclFCmd.c (TclFileAttrsCmd): Ensure that any reference to diff --git a/generic/tcl.h b/generic/tcl.h index 2abbb1a..b491944 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -2405,13 +2405,13 @@ EXTERN void Tcl_GetMemoryInfo(Tcl_DString *dsPtr); # define ckalloc(x) \ ((VOID *) Tcl_DbCkalloc((unsigned)(x), __FILE__, __LINE__)) # define ckfree(x) \ - Tcl_DbCkfree((VOID *)(x), __FILE__, __LINE__) + Tcl_DbCkfree((char *)(x), __FILE__, __LINE__) # define ckrealloc(x,y) \ - ((VOID *) Tcl_DbCkrealloc((VOID *)(x), (unsigned)(y), __FILE__, __LINE__)) + ((VOID *) Tcl_DbCkrealloc((char *)(x), (unsigned)(y), __FILE__, __LINE__)) # define attemptckalloc(x) \ ((VOID *) Tcl_AttemptDbCkalloc((unsigned)(x), __FILE__, __LINE__)) # define attemptckrealloc(x,y) \ - ((VOID *) Tcl_AttemptDbCkrealloc((VOID *)(x), (unsigned)(y), __FILE__, __LINE__)) + ((VOID *) Tcl_AttemptDbCkrealloc((char *)(x), (unsigned)(y), __FILE__, __LINE__)) #else /* !TCL_MEM_DEBUG */ @@ -2424,13 +2424,13 @@ EXTERN void Tcl_GetMemoryInfo(Tcl_DString *dsPtr); # define ckalloc(x) \ ((VOID *) Tcl_Alloc((unsigned)(x))) # define ckfree(x) \ - Tcl_Free((VOID *)(x)) + Tcl_Free((char *)(x)) # define ckrealloc(x,y) \ - ((VOID *) Tcl_Realloc((VOID *)(x), (unsigned)(y))) + ((VOID *) Tcl_Realloc((char *)(x), (unsigned)(y))) # define attemptckalloc(x) \ ((VOID *) Tcl_AttemptAlloc((unsigned)(x))) # define attemptckrealloc(x,y) \ - ((VOID *) Tcl_AttemptRealloc((VOID *)(x), (unsigned)(y))) + ((VOID *) Tcl_AttemptRealloc((char *)(x), (unsigned)(y))) # undef Tcl_InitMemory # define Tcl_InitMemory(x) # undef Tcl_DumpActiveMemory diff --git a/generic/tclThreadAlloc.c b/generic/tclThreadAlloc.c old mode 100644 new mode 100755 -- cgit v0.12