From 5119564c4202954fb6ad5bba77a1371f4a1d7920 Mon Sep 17 00:00:00 2001 From: nijtmans Date: Fri, 27 Feb 2009 23:03:41 +0000 Subject: [Bug 218977] Tcl_DbCkfree needs a return value don't use CONST84/CONST86 in internal header files --- ChangeLog | 10 ++++++++++ generic/tcl.decls | 4 ++-- generic/tclCkalloc.c | 11 ++++------- generic/tclCompile.h | 18 +++++++++--------- generic/tclDecls.h | 6 +++--- generic/tclIO.h | 4 ++-- generic/tclInt.decls | 20 ++++++++++---------- generic/tclIntDecls.h | 23 +++++++++++------------ 8 files changed, 51 insertions(+), 45 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3f670b5..e3c7b09 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2009-02-27 Jan Nijtmans + + * generic/tcl.decls: [Bug 218977] Tcl_DbCkfree needs a return value + * generic/tclCkalloc.c + * generic/tclDecls.h (regenerated) + * generic/tclInt.decls: don't use CONST84/CONST86 here + * generic/tclCompile.h: don't use CONST86 here, comment fixing. + * generic/tclIO.h: don't use CONST86 here, comment fixing. + * generic/tclIntDecls.h (regenerated) + 2009-02-25 Don Porter * generic/tclUtil.c (TclStringMatchObj): Revised the branching diff --git a/generic/tcl.decls b/generic/tcl.decls index a95acf8..0ce6825 100644 --- a/generic/tcl.decls +++ b/generic/tcl.decls @@ -12,7 +12,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: tcl.decls,v 1.168 2009/01/22 06:42:33 nijtmans Exp $ +# RCS: @(#) $Id: tcl.decls,v 1.169 2009/02/27 23:03:42 nijtmans Exp $ library tcl @@ -53,7 +53,7 @@ declare 6 generic { char *Tcl_DbCkalloc(unsigned int size, const char *file, int line) } declare 7 generic { - int Tcl_DbCkfree(char *ptr, const char *file, int line) + void Tcl_DbCkfree(char *ptr, const char *file, int line) } declare 8 generic { char *Tcl_DbCkrealloc(char *ptr, unsigned int size, diff --git a/generic/tclCkalloc.c b/generic/tclCkalloc.c index fa7d376..2cbff69 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.34 2009/01/09 11:21:45 dkf Exp $ + * RCS: @(#) $Id: tclCkalloc.c,v 1.35 2009/02/27 23:03:41 nijtmans Exp $ */ #include "tclInt.h" @@ -569,7 +569,7 @@ Tcl_AttemptDbCkalloc( *---------------------------------------------------------------------- */ -int +void Tcl_DbCkfree( char *ptr, const char *file, @@ -578,7 +578,7 @@ Tcl_DbCkfree( struct mem_header *memp; if (ptr == NULL) { - return 0; + return; } /* @@ -632,8 +632,6 @@ Tcl_DbCkfree( } TclpFree((char *) memp); Tcl_MutexUnlock(ckallocMutexPtr); - - return 0; } /* @@ -1182,14 +1180,13 @@ Tcl_Free( TclpFree(ptr); } -int +void Tcl_DbCkfree( char *ptr, const char *file, int line) { TclpFree(ptr); - return 0; } /* diff --git a/generic/tclCompile.h b/generic/tclCompile.h index c0d18e4..fb5bdb9 100644 --- a/generic/tclCompile.h +++ b/generic/tclCompile.h @@ -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: tclCompile.h,v 1.114 2009/01/22 06:42:33 nijtmans Exp $ + * RCS: @(#) $Id: tclCompile.h,v 1.115 2009/02/27 23:03:42 nijtmans Exp $ */ #ifndef _TCLCOMPILATION @@ -177,7 +177,7 @@ typedef void (AuxDataPrintProc)(ClientData clientData, */ typedef struct AuxDataType { - CONST86 char *name; /* The name of the type. Types can be + const char *name; /* The name of the type. Types can be * registered and found by name */ AuxDataDupProc *dupProc; /* Callback procedure to invoke when the aux * data is duplicated (e.g., when the ByteCode @@ -200,7 +200,7 @@ typedef struct AuxDataType { */ typedef struct AuxData { - CONST86 AuxDataType *type; /* Pointer to the AuxData type associated with + const AuxDataType *type; /* Pointer to the AuxData type associated with * this ClientData. */ ClientData clientData; /* The compilation data itself. */ } AuxData; @@ -682,7 +682,7 @@ typedef enum InstOperandType { } InstOperandType; typedef struct InstructionDesc { - CONST86 char *name; /* Name of instruction. */ + const char *name; /* Name of instruction. */ int numBytes; /* Total number of bytes for instruction. */ int stackEffect; /* The worst-case balance stack effect of the * instruction, used for stack requirements @@ -784,7 +784,7 @@ typedef struct ForeachInfo { * LAST FIELD IN THE STRUCTURE! */ } ForeachInfo; -MODULE_SCOPE CONST86 AuxDataType tclForeachInfoType; +MODULE_SCOPE const AuxDataType tclForeachInfoType; /* * Structure used to hold information about a switch command that is needed @@ -797,7 +797,7 @@ typedef struct JumptableInfo { * offsets). */ } JumptableInfo; -MODULE_SCOPE CONST86 AuxDataType tclJumptableInfoType; +MODULE_SCOPE const AuxDataType tclJumptableInfoType; /* * Structure used to hold information about a [dict update] command that is @@ -815,7 +815,7 @@ typedef struct { * STRUCTURE. */ } DictUpdateInfo; -MODULE_SCOPE CONST86 AuxDataType tclDictUpdateInfoType; +MODULE_SCOPE const AuxDataType tclDictUpdateInfoType; /* * ClientData type used by the math operator commands. @@ -964,7 +964,7 @@ MODULE_SCOPE int TclWordKnownAtCompileTime(Tcl_Token *tokenPtr, #define LITERAL_NS_SCOPE 0x02 /* - * Form of TclRegisterLiteral with onHeap == 0. In that case, it is safe to + * Form of TclRegisterLiteral with flags == 0. In that case, it is safe to * cast away constness, and it is cleanest to do that here, all in one place. * * int TclRegisterNewLiteral(CompileEnv *envPtr, const char *bytes, @@ -975,7 +975,7 @@ MODULE_SCOPE int TclWordKnownAtCompileTime(Tcl_Token *tokenPtr, TclRegisterLiteral(envPtr, (char *)(bytes), length, /*flags*/ 0) /* - * Form of TclRegisterNSLiteral with onHeap == 0. In that case, it is safe to + * Form of TclRegisterLiteral with flags == LITERAL_NS_SCOPE. In that case, it is safe to * cast away constness, and it is cleanest to do that here, all in one place. * * int TclRegisterNewNSLiteral(CompileEnv *envPtr, const char *bytes, diff --git a/generic/tclDecls.h b/generic/tclDecls.h index 4eadfa2..6c3869f 100644 --- a/generic/tclDecls.h +++ b/generic/tclDecls.h @@ -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: tclDecls.h,v 1.169 2009/01/22 06:42:33 nijtmans Exp $ + * RCS: @(#) $Id: tclDecls.h,v 1.170 2009/02/27 23:03:42 nijtmans Exp $ */ #ifndef _TCLDECLS @@ -80,7 +80,7 @@ EXTERN char * Tcl_DbCkalloc (unsigned int size, const char * file, #ifndef Tcl_DbCkfree_TCL_DECLARED #define Tcl_DbCkfree_TCL_DECLARED /* 7 */ -EXTERN int Tcl_DbCkfree (char * ptr, const char * file, +EXTERN void Tcl_DbCkfree (char * ptr, const char * file, int line); #endif #ifndef Tcl_DbCkrealloc_TCL_DECLARED @@ -3743,7 +3743,7 @@ typedef struct TclStubs { void (*tcl_Free) (char * ptr); /* 4 */ char * (*tcl_Realloc) (char * ptr, unsigned int size); /* 5 */ char * (*tcl_DbCkalloc) (unsigned int size, const char * file, int line); /* 6 */ - int (*tcl_DbCkfree) (char * ptr, const char * file, int line); /* 7 */ + void (*tcl_DbCkfree) (char * ptr, const char * file, int line); /* 7 */ char * (*tcl_DbCkrealloc) (char * ptr, unsigned int size, const char * file, int line); /* 8 */ #if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */ void (*tcl_CreateFileHandler) (int fd, int mask, Tcl_FileProc * proc, ClientData clientData); /* 9 */ diff --git a/generic/tclIO.h b/generic/tclIO.h index fa78769..5f330f5 100644 --- a/generic/tclIO.h +++ b/generic/tclIO.h @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclIO.h,v 1.15 2008/12/18 23:48:39 andreas_kupries Exp $ + * RCS: @(#) $Id: tclIO.h,v 1.16 2009/02/27 23:03:42 nijtmans Exp $ */ /* @@ -132,7 +132,7 @@ typedef struct Channel { struct ChannelState *state; /* Split out state information */ ClientData instanceData; /* Instance-specific data provided by creator * of channel. */ - CONST86 Tcl_ChannelType *typePtr; /* Pointer to channel type structure. */ + const Tcl_ChannelType *typePtr; /* Pointer to channel type structure. */ struct Channel *downChanPtr;/* Refers to channel this one was stacked * upon. This reference is NULL for normal * channels. See Tcl_StackChannel. */ diff --git a/generic/tclInt.decls b/generic/tclInt.decls index a3229e3..b464b91 100644 --- a/generic/tclInt.decls +++ b/generic/tclInt.decls @@ -13,7 +13,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: tclInt.decls,v 1.136 2009/01/22 06:42:33 nijtmans Exp $ +# RCS: @(#) $Id: tclInt.decls,v 1.137 2009/02/27 23:03:42 nijtmans Exp $ library tcl @@ -190,7 +190,7 @@ declare 42 generic { } # Removed in Tcl 8.5a2 #declare 43 generic { -# int TclGlobalInvoke(Tcl_Interp *interp, int argc, CONST84 char **argv, +# int TclGlobalInvoke(Tcl_Interp *interp, int argc, const char **argv, # int flags) #} declare 44 generic { @@ -225,12 +225,12 @@ declare 51 generic { } # Removed in Tcl 8.5a2 #declare 52 generic { -# int TclInvoke(Tcl_Interp *interp, int argc, CONST84 char **argv, +# int TclInvoke(Tcl_Interp *interp, int argc, const char **argv, # int flags) #} declare 53 generic { int TclInvokeObjectCommand(ClientData clientData, Tcl_Interp *interp, - int argc, CONST84 char **argv) + int argc, const char **argv) } declare 54 generic { int TclInvokeStringCommand(ClientData clientData, Tcl_Interp *interp, @@ -385,7 +385,7 @@ declare 93 generic { # Removed in Tcl 8.5: #declare 94 generic { # int TclProcInterpProc(ClientData clientData, Tcl_Interp *interp, -# int argc, CONST84 char **argv) +# int argc, const char **argv) #} # Replaced by Tcl_FSStat in 8.4: #declare 95 generic { @@ -549,7 +549,7 @@ declare 133 generic { # int TclpChdir(const char *dirName) #} declare 138 generic { - CONST84_RETURN char *TclGetEnv(const char *name, Tcl_DString *valuePtr) + const char *TclGetEnv(const char *name, Tcl_DString *valuePtr) } #declare 139 generic { # int TclpLoadFile(Tcl_Interp *interp, char *fileName, char *sym1, @@ -561,7 +561,7 @@ declare 138 generic { #} # This is used by TclX, but should otherwise be considered private declare 141 generic { - CONST84_RETURN char *TclpGetCwd(Tcl_Interp *interp, Tcl_DString *cwdPtr) + const char *TclpGetCwd(Tcl_Interp *interp, Tcl_DString *cwdPtr) } declare 142 generic { int TclSetByteCodeFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr, @@ -576,7 +576,7 @@ declare 144 generic { int index) } declare 145 generic { - CONST86 struct AuxDataType *TclGetAuxDataType(const char *typeName) + const struct AuxDataType *TclGetAuxDataType(const char *typeName) } declare 146 generic { TclHandle TclHandleCreate(void *ptr) @@ -630,7 +630,7 @@ declare 157 generic { #} # REMOVED - use public Tcl_GetStartupScript() #declare 159 generic { -# CONST84_RETURN char *TclGetStartupScriptFileName(void) +# const char *TclGetStartupScriptFileName(void) #} #declare 160 generic { # int TclpMatchFilesTypes(Tcl_Interp *interp, char *separators, @@ -653,7 +653,7 @@ declare 162 generic { # correct type when calling this procedure. declare 163 generic { - CONST86 void *TclGetInstructionTable(void) + const void *TclGetInstructionTable(void) } # ALERT: The argument of 'TclExpandCodeArray' is actually a diff --git a/generic/tclIntDecls.h b/generic/tclIntDecls.h index c728614..a432255 100644 --- a/generic/tclIntDecls.h +++ b/generic/tclIntDecls.h @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclIntDecls.h,v 1.131 2009/01/22 06:42:33 nijtmans Exp $ + * RCS: @(#) $Id: tclIntDecls.h,v 1.132 2009/02/27 23:03:41 nijtmans Exp $ */ #ifndef _TCLINTDECLS @@ -248,7 +248,7 @@ EXTERN int TclInterpInit (Tcl_Interp * interp); /* 53 */ EXTERN int TclInvokeObjectCommand (ClientData clientData, Tcl_Interp * interp, int argc, - CONST84 char ** argv); + const char ** argv); #endif #ifndef TclInvokeStringCommand_TCL_DECLARED #define TclInvokeStringCommand_TCL_DECLARED @@ -595,15 +595,14 @@ EXTERN struct tm * TclpGetDate (const time_t * time, int useGMT); #ifndef TclGetEnv_TCL_DECLARED #define TclGetEnv_TCL_DECLARED /* 138 */ -EXTERN CONST84_RETURN char * TclGetEnv (const char * name, - Tcl_DString * valuePtr); +EXTERN const char * TclGetEnv (const char * name, Tcl_DString * valuePtr); #endif /* Slot 139 is reserved */ /* Slot 140 is reserved */ #ifndef TclpGetCwd_TCL_DECLARED #define TclpGetCwd_TCL_DECLARED /* 141 */ -EXTERN CONST84_RETURN char * TclpGetCwd (Tcl_Interp * interp, +EXTERN const char * TclpGetCwd (Tcl_Interp * interp, Tcl_DString * cwdPtr); #endif #ifndef TclSetByteCodeFromAny_TCL_DECLARED @@ -628,7 +627,7 @@ EXTERN void TclHideLiteral (Tcl_Interp * interp, #ifndef TclGetAuxDataType_TCL_DECLARED #define TclGetAuxDataType_TCL_DECLARED /* 145 */ -EXTERN CONST86 struct AuxDataType * TclGetAuxDataType (const char * typeName); +EXTERN const struct AuxDataType * TclGetAuxDataType (const char * typeName); #endif #ifndef TclHandleCreate_TCL_DECLARED #define TclHandleCreate_TCL_DECLARED @@ -703,7 +702,7 @@ EXTERN void TclChannelEventScriptInvoker (ClientData clientData, #ifndef TclGetInstructionTable_TCL_DECLARED #define TclGetInstructionTable_TCL_DECLARED /* 163 */ -EXTERN CONST86 void * TclGetInstructionTable (void); +EXTERN const void * TclGetInstructionTable (void); #endif #ifndef TclExpandCodeArray_TCL_DECLARED #define TclExpandCodeArray_TCL_DECLARED @@ -1084,7 +1083,7 @@ typedef struct TclIntStubs { void (*tclInitCompiledLocals) (Tcl_Interp * interp, CallFrame * framePtr, Namespace * nsPtr); /* 50 */ int (*tclInterpInit) (Tcl_Interp * interp); /* 51 */ void *reserved52; - int (*tclInvokeObjectCommand) (ClientData clientData, Tcl_Interp * interp, int argc, CONST84 char ** argv); /* 53 */ + int (*tclInvokeObjectCommand) (ClientData clientData, Tcl_Interp * interp, int argc, const char ** argv); /* 53 */ int (*tclInvokeStringCommand) (ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *const objv[]); /* 54 */ Proc * (*tclIsProc) (Command * cmdPtr); /* 55 */ void *reserved56; @@ -1169,14 +1168,14 @@ typedef struct TclIntStubs { void *reserved135; void *reserved136; void *reserved137; - CONST84_RETURN char * (*tclGetEnv) (const char * name, Tcl_DString * valuePtr); /* 138 */ + const char * (*tclGetEnv) (const char * name, Tcl_DString * valuePtr); /* 138 */ void *reserved139; void *reserved140; - CONST84_RETURN char * (*tclpGetCwd) (Tcl_Interp * interp, Tcl_DString * cwdPtr); /* 141 */ + const char * (*tclpGetCwd) (Tcl_Interp * interp, Tcl_DString * cwdPtr); /* 141 */ int (*tclSetByteCodeFromAny) (Tcl_Interp * interp, Tcl_Obj * objPtr, CompileHookProc * hookProc, ClientData clientData); /* 142 */ int (*tclAddLiteralObj) (struct CompileEnv * envPtr, Tcl_Obj * objPtr, LiteralEntry ** litPtrPtr); /* 143 */ void (*tclHideLiteral) (Tcl_Interp * interp, struct CompileEnv * envPtr, int index); /* 144 */ - CONST86 struct AuxDataType * (*tclGetAuxDataType) (const char * typeName); /* 145 */ + const struct AuxDataType * (*tclGetAuxDataType) (const char * typeName); /* 145 */ TclHandle (*tclHandleCreate) (void * ptr); /* 146 */ void (*tclHandleFree) (TclHandle handle); /* 147 */ TclHandle (*tclHandlePreserve) (TclHandle handle); /* 148 */ @@ -1194,7 +1193,7 @@ typedef struct TclIntStubs { void *reserved160; int (*tclChannelTransform) (Tcl_Interp * interp, Tcl_Channel chan, Tcl_Obj * cmdObjPtr); /* 161 */ void (*tclChannelEventScriptInvoker) (ClientData clientData, int flags); /* 162 */ - CONST86 void * (*tclGetInstructionTable) (void); /* 163 */ + const void * (*tclGetInstructionTable) (void); /* 163 */ void (*tclExpandCodeArray) (void * envPtr); /* 164 */ void (*tclpSetInitialEncodings) (void); /* 165 */ int (*tclListObjSetElement) (Tcl_Interp * interp, Tcl_Obj * listPtr, int index, Tcl_Obj * valuePtr); /* 166 */ -- cgit v0.12