diff options
| author | dgp <dgp@users.sourceforge.net> | 2020-03-06 21:33:24 (GMT) |
|---|---|---|
| committer | dgp <dgp@users.sourceforge.net> | 2020-03-06 21:33:24 (GMT) |
| commit | c4a1ea568ee92b0d890bb012f44b345c80f25fa8 (patch) | |
| tree | 5c9b8cae89263c6d99738a15d02d2113274f66e4 /generic/tclCkalloc.c | |
| parent | 1e155ca6690f927989e3afaa7559109019361d0d (diff) | |
| parent | 81e31a16d82ff906b74f9b726637a3f146b77a4d (diff) | |
| download | tcl-c4a1ea568ee92b0d890bb012f44b345c80f25fa8.zip tcl-c4a1ea568ee92b0d890bb012f44b345c80f25fa8.tar.gz tcl-c4a1ea568ee92b0d890bb012f44b345c80f25fa8.tar.bz2 | |
merge 8.7
Diffstat (limited to 'generic/tclCkalloc.c')
| -rw-r--r-- | generic/tclCkalloc.c | 78 |
1 files changed, 23 insertions, 55 deletions
diff --git a/generic/tclCkalloc.c b/generic/tclCkalloc.c index 0397c83..b961bf6 100644 --- a/generic/tclCkalloc.c +++ b/generic/tclCkalloc.c @@ -759,7 +759,7 @@ MemoryCmd( ClientData clientData, Tcl_Interp *interp, int objc, /* Number of arguments. */ - Tcl_Obj *const objv[]) /* Obj values of arguments. */ + Tcl_Obj *const objv[]) /* Obj values of arguments. */ { const char *fileName; FILE *fileP; @@ -932,10 +932,10 @@ static int CheckmemCmd(ClientData clientData, static int CheckmemCmd( - ClientData clientData, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Interpreter for evaluation. */ int objc, /* Number of arguments. */ - Tcl_Obj *const objv[]) /* Obj values of arguments. */ + Tcl_Obj *const objv[]) /* Obj values of arguments. */ { if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "fileName"); @@ -998,9 +998,7 @@ void * Tcl_Alloc( size_t size) { - void *result; - - result = TclpAlloc(size); + void *result = TclpAlloc(size); /* * Most systems will not alloc(0), instead bumping it to one so that NULL @@ -1024,9 +1022,7 @@ Tcl_DbCkalloc( const char *file, int line) { - void *result; - - result = TclpAlloc(size); + void *result = TclpAlloc(size); if ((result == NULL) && size) { fflush(stdout); @@ -1051,24 +1047,16 @@ void * Tcl_AttemptAlloc( size_t size) { - void *result; - - result = TclpAlloc(size); - return result; + return TclpAlloc(size); } void * Tcl_AttemptDbCkalloc( size_t size, - const char *file, - int line) + TCL_UNUSED(const char *) /*file*/, + TCL_UNUSED(int) /*line*/) { - void *result; - (void)file; - (void)line; - - result = TclpAlloc(size); - return result; + return TclpAlloc(size); } /* @@ -1088,9 +1076,7 @@ Tcl_Realloc( void *ptr, size_t size) { - void *result; - - result = TclpRealloc(ptr, size); + void *result = TclpRealloc(ptr, size); if ((result == NULL) && size) { Tcl_Panic("unable to realloc %" TCL_Z_MODIFIER "u bytes", size); @@ -1105,9 +1091,7 @@ Tcl_DbCkrealloc( const char *file, int line) { - void *result; - - result = TclpRealloc(ptr, size); + void *result = TclpRealloc(ptr, size); if ((result == NULL) && size) { fflush(stdout); @@ -1133,25 +1117,17 @@ Tcl_AttemptRealloc( void *ptr, size_t size) { - void *result; - - result = TclpRealloc(ptr, size); - return result; + return TclpRealloc(ptr, size); } void * Tcl_AttemptDbCkrealloc( void *ptr, size_t size, - const char *file, - int line) + TCL_UNUSED(const char *) /*file*/, + TCL_UNUSED(int) /*line*/) { - void *result; - (void)file; - (void)line; - - result = TclpRealloc(ptr, size); - return result; + return TclpRealloc(ptr, size); } /* @@ -1177,11 +1153,9 @@ Tcl_Free( void Tcl_DbCkfree( void *ptr, - const char *file, - int line) + TCL_UNUSED(const char *) /*file*/, + TCL_UNUSED(int) /*line*/) { - (void)file; - (void)line; TclpFree(ptr); } @@ -1198,35 +1172,29 @@ Tcl_DbCkfree( /* ARGSUSED */ void Tcl_InitMemory( - Tcl_Interp *interp) + TCL_UNUSED(Tcl_Interp *) /*interp*/) { - (void)interp; } int Tcl_DumpActiveMemory( - const char *fileName) + TCL_UNUSED(const char *) /*fileName*/) { - (void)fileName; return TCL_OK; } void Tcl_ValidateAllMemory( - const char *file, - int line) + TCL_UNUSED(const char *) /*file*/, + TCL_UNUSED(int) /*line*/) { - (void)file; - (void)line; } int TclDumpMemoryInfo( - ClientData clientData, - int flags) + TCL_UNUSED(ClientData), + TCL_UNUSED(int) /*flags*/) { - (void)clientData; - (void)flags; return 1; } |
