summaryrefslogtreecommitdiffstats
path: root/generic/tclCkalloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclCkalloc.c')
-rw-r--r--generic/tclCkalloc.c78
1 files changed, 23 insertions, 55 deletions
diff --git a/generic/tclCkalloc.c b/generic/tclCkalloc.c
index 8746241..c1ff631 100644
--- a/generic/tclCkalloc.c
+++ b/generic/tclCkalloc.c
@@ -814,7 +814,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;
@@ -987,10 +987,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");
@@ -1052,9 +1052,7 @@ char *
Tcl_Alloc(
unsigned int size)
{
- char *result;
-
- result = TclpAlloc(size);
+ char *result = TclpAlloc(size);
/*
* Most systems will not alloc(0), instead bumping it to one so that NULL
@@ -1078,9 +1076,7 @@ Tcl_DbCkalloc(
const char *file,
int line)
{
- char *result;
-
- result = (char *) TclpAlloc(size);
+ char *result = TclpAlloc(size);
if ((result == NULL) && size) {
fflush(stdout);
@@ -1104,24 +1100,16 @@ char *
Tcl_AttemptAlloc(
unsigned int size)
{
- char *result;
-
- result = TclpAlloc(size);
- return result;
+ return TclpAlloc(size);
}
char *
Tcl_AttemptDbCkalloc(
unsigned int size,
- const char *file,
- int line)
+ TCL_UNUSED(const char *) /*file*/,
+ TCL_UNUSED(int) /*line*/)
{
- char *result;
- (void)file;
- (void)line;
-
- result = (char *) TclpAlloc(size);
- return result;
+ return TclpAlloc(size);
}
/*
@@ -1140,9 +1128,7 @@ Tcl_Realloc(
char *ptr,
unsigned int size)
{
- char *result;
-
- result = TclpRealloc(ptr, size);
+ char *result = TclpRealloc(ptr, size);
if ((result == NULL) && size) {
Tcl_Panic("unable to realloc %u bytes", size);
@@ -1157,9 +1143,7 @@ Tcl_DbCkrealloc(
const char *file,
int line)
{
- char *result;
-
- result = (char *) TclpRealloc(ptr, size);
+ char *result = TclpRealloc(ptr, size);
if ((result == NULL) && size) {
fflush(stdout);
@@ -1184,25 +1168,17 @@ Tcl_AttemptRealloc(
char *ptr,
unsigned int size)
{
- char *result;
-
- result = TclpRealloc(ptr, size);
- return result;
+ return TclpRealloc(ptr, size);
}
char *
Tcl_AttemptDbCkrealloc(
char *ptr,
unsigned int size,
- const char *file,
- int line)
+ TCL_UNUSED(const char *) /*file*/,
+ TCL_UNUSED(int) /*line*/)
{
- char *result;
- (void)file;
- (void)line;
-
- result = (char *) TclpRealloc(ptr, size);
- return result;
+ return TclpRealloc(ptr, size);
}
/*
@@ -1227,11 +1203,9 @@ Tcl_Free(
void
Tcl_DbCkfree(
char *ptr,
- const char *file,
- int line)
+ TCL_UNUSED(const char *) /*file*/,
+ TCL_UNUSED(int) /*line*/)
{
- (void)file;
- (void)line;
TclpFree(ptr);
}
@@ -1248,35 +1222,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;
}