diff options
| author | dgp <dgp@users.sourceforge.net> | 2020-03-08 13:58:07 (GMT) |
|---|---|---|
| committer | dgp <dgp@users.sourceforge.net> | 2020-03-08 13:58:07 (GMT) |
| commit | 085094bd8714e2c46e3f098189728bb966eb3fb0 (patch) | |
| tree | f4356570ef34bccd58b4fe5919622104963e6ed7 /generic/tclObj.c | |
| parent | 89b0bdb8829f03a5216972f59d54b3fa8a1bef16 (diff) | |
| download | tcl-085094bd8714e2c46e3f098189728bb966eb3fb0.zip tcl-085094bd8714e2c46e3f098189728bb966eb3fb0.tar.gz tcl-085094bd8714e2c46e3f098189728bb966eb3fb0.tar.bz2 | |
More TCL_UNUSED.
Diffstat (limited to 'generic/tclObj.c')
| -rw-r--r-- | generic/tclObj.c | 118 |
1 files changed, 54 insertions, 64 deletions
diff --git a/generic/tclObj.c b/generic/tclObj.c index bc1953a..efa63dc 100644 --- a/generic/tclObj.c +++ b/generic/tclObj.c @@ -783,7 +783,7 @@ TclContinuationsGet( static void TclThreadFinalizeContLines( - ClientData dummy) + TCL_UNUSED(ClientData)) { /* * Release the hashtable tracking invisible continuation lines. @@ -792,7 +792,6 @@ TclThreadFinalizeContLines( ThreadSpecificData *tsdPtr = TclGetContLineTable(); Tcl_HashEntry *hPtr; Tcl_HashSearch hSearch; - (void)dummy; for (hPtr = Tcl_FirstHashEntry(tsdPtr->lineCLPtr, &hSearch); hPtr != NULL; hPtr = Tcl_NextHashEntry(&hSearch)) { @@ -993,11 +992,11 @@ Tcl_ConvertToType( *-------------------------------------------------------------- */ +#if TCL_THREADS && defined(TCL_MEM_DEBUG) void TclDbDumpActiveObjects( FILE *outFile) { -#if TCL_THREADS && defined(TCL_MEM_DEBUG) Tcl_HashSearch hSearch; Tcl_HashEntry *hPtr; Tcl_HashTable *tablePtr; @@ -1022,10 +1021,14 @@ TclDbDumpActiveObjects( } } } +} #else - (void)outFile; -#endif +void +TclDbDumpActiveObjects( + TCL_UNUSED(FILE *)) +{ } +#endif /* *---------------------------------------------------------------------- @@ -1195,14 +1198,9 @@ Tcl_DbNewObj( Tcl_Obj * Tcl_DbNewObj( - const char *file, /* The name of the source file calling this - * function; used for debugging. */ - int line) /* Line number in the source file; used for - * debugging. */ + TCL_UNUSED(const char *) /*file*/, + TCL_UNUSED(int) /*line*/) { - (void)file; - (void)line; - return Tcl_NewObj(); } #endif /* TCL_MEM_DEBUG */ @@ -2036,14 +2034,9 @@ Tcl_DbNewBooleanObj( Tcl_Obj * Tcl_DbNewBooleanObj( int boolValue, /* Boolean used to initialize new object. */ - const char *file, /* The name of the source file calling this - * function; used for debugging. */ - int line) /* Line number in the source file; used for - * debugging. */ + TCL_UNUSED(const char *) /*file*/, + TCL_UNUSED(int) /*line*/) { - (void)file; - (void)line; - return Tcl_NewBooleanObj(boolValue); } #endif /* TCL_MEM_DEBUG */ @@ -2426,14 +2419,9 @@ Tcl_DbNewDoubleObj( Tcl_Obj * Tcl_DbNewDoubleObj( double dblValue, /* Double used to initialize the object. */ - const char *file, /* The name of the source file calling this - * function; used for debugging. */ - int line) /* Line number in the source file; used for - * debugging. */ + TCL_UNUSED(const char *) /*file*/, + TCL_UNUSED(int) /*line*/) { - (void)file; - (void)line; - return Tcl_NewDoubleObj(dblValue); } #endif /* TCL_MEM_DEBUG */ @@ -2913,14 +2901,9 @@ Tcl_Obj * Tcl_DbNewLongObj( long longValue, /* Long integer used to initialize the new * object. */ - const char *file, /* The name of the source file calling this - * function; used for debugging. */ - int line) /* Line number in the source file; used for - * debugging. */ + TCL_UNUSED(const char *) /*file*/, + TCL_UNUSED(int) /*line*/) { - (void)file; - (void)line; - return Tcl_NewWideIntObj(longValue); } #endif /* TCL_MEM_DEBUG */ @@ -3182,14 +3165,9 @@ Tcl_DbNewWideIntObj( Tcl_WideInt wideValue, /* Long integer used to initialize the new * object. */ - const char *file, /* The name of the source file calling this - * function; used for debugging. */ - int line) /* Line number in the source file; used for - * debugging. */ + TCL_UNUSED(const char *) /*file*/, + TCL_UNUSED(int) /*line*/) { - (void)file; - (void)line; - return Tcl_NewWideIntObj(wideValue); } #endif /* TCL_MEM_DEBUG */ @@ -3567,12 +3545,9 @@ Tcl_DbNewBignumObj( Tcl_Obj * Tcl_DbNewBignumObj( void *bignumValue, - const char *file, - int line) + TCL_UNUSED(const char *) /*file*/, + TCL_UNUSED(int) /*line*/) { - (void)file; - (void)line; - return Tcl_NewBignumObj(bignumValue); } #endif @@ -3956,6 +3931,7 @@ Tcl_IsShared( *---------------------------------------------------------------------- */ +#ifdef TCL_MEM_DEBUG void Tcl_DbIncrRefCount( Tcl_Obj *objPtr, /* The object we are registering a reference @@ -3965,7 +3941,6 @@ Tcl_DbIncrRefCount( int line) /* Line number in the source file; used for * debugging. */ { -#ifdef TCL_MEM_DEBUG if (objPtr->refCount == 0x61616161) { fprintf(stderr, "file = %s, line = %d\n", file, line); fflush(stderr); @@ -3994,12 +3969,19 @@ Tcl_DbIncrRefCount( } } # endif /* TCL_THREADS */ -#else - (void)file; - (void)line; -#endif /* TCL_MEM_DEBUG */ ++(objPtr)->refCount; } +#else /* !TCL_MEM_DEBUG */ +void +Tcl_DbIncrRefCount( + Tcl_Obj *objPtr, /* The object we are registering a reference + * to. */ + TCL_UNUSED(const char *) /*file*/, + TCL_UNUSED(int) /*line*/) +{ + ++(objPtr)->refCount; +} +#endif /* TCL_MEM_DEBUG */ /* *---------------------------------------------------------------------- @@ -4022,6 +4004,7 @@ Tcl_DbIncrRefCount( *---------------------------------------------------------------------- */ +#ifdef TCL_MEM_DEBUG void Tcl_DbDecrRefCount( Tcl_Obj *objPtr, /* The object we are releasing a reference @@ -4031,7 +4014,6 @@ Tcl_DbDecrRefCount( int line) /* Line number in the source file; used for * debugging. */ { -#ifdef TCL_MEM_DEBUG if (objPtr->refCount == 0x61616161) { fprintf(stderr, "file = %s, line = %d\n", file, line); fflush(stderr); @@ -4060,15 +4042,24 @@ Tcl_DbDecrRefCount( } } # endif /* TCL_THREADS */ -#else - (void)file; - (void)line; -#endif /* TCL_MEM_DEBUG */ if (objPtr->refCount-- <= 1) { TclFreeObj(objPtr); } } +#else /* !TCL_MEM_DEBUG */ +void +Tcl_DbDecrRefCount( + Tcl_Obj *objPtr, /* The object we are releasing a reference + * to. */ + TCL_UNUSED(const char *) /*file*/, + TCL_UNUSED(int) /*line*/) +{ + if (objPtr->refCount-- <= 1) { + TclFreeObj(objPtr); + } +} +#endif /* TCL_MEM_DEBUG */ /* *---------------------------------------------------------------------- @@ -4094,10 +4085,15 @@ Tcl_DbDecrRefCount( int Tcl_DbIsShared( Tcl_Obj *objPtr, /* The object to test for being shared. */ +#ifdef TCL_MEM_DEBUG const char *file, /* The name of the source file calling this * function; used for debugging. */ int line) /* Line number in the source file; used for * debugging. */ +#else + TCL_UNUSED(const char *) /*file*/, + TCL_UNUSED(int) /*line*/) +#endif { #ifdef TCL_MEM_DEBUG if (objPtr->refCount == 0x61616161) { @@ -4128,9 +4124,6 @@ Tcl_DbIsShared( } } # endif /* TCL_THREADS */ -#else - (void)file; - (void)line; #endif /* TCL_MEM_DEBUG */ #ifdef TCL_COMPILE_STATS @@ -4194,12 +4187,11 @@ Tcl_InitObjHashTable( static Tcl_HashEntry * AllocObjEntry( - Tcl_HashTable *dummy, /* Hash table. */ + TCL_UNUSED(Tcl_HashTable *), void *keyPtr) /* Key to store in the hash table entry. */ { Tcl_Obj *objPtr = (Tcl_Obj *)keyPtr; Tcl_HashEntry *hPtr = (Tcl_HashEntry *)ckalloc(sizeof(Tcl_HashEntry)); - (void)dummy; hPtr->key.objPtr = objPtr; Tcl_IncrRefCount(objPtr); @@ -4316,14 +4308,13 @@ TclFreeObjEntry( TCL_HASH_TYPE TclHashObjKey( - Tcl_HashTable *dummy, /* Hash table. */ + TCL_UNUSED(Tcl_HashTable *), void *keyPtr) /* Key from which to compute hash value. */ { Tcl_Obj *objPtr = (Tcl_Obj *)keyPtr; int length; const char *string = TclGetStringFromObj(objPtr, &length); TCL_HASH_TYPE result = 0; - (void)dummy; /* * I tried a zillion different hash functions and asked many other people @@ -4718,13 +4709,12 @@ SetCmdNameFromAny( int Tcl_RepresentationCmd( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { Tcl_Obj *descObj; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "value"); |
