diff options
author | dgp <dgp@users.sourceforge.net> | 2020-03-06 13:55:07 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2020-03-06 13:55:07 (GMT) |
commit | d38d34e93774eb6c4b854721d8273280033bdc34 (patch) | |
tree | 3c8708f6a66b6c63373b7b19d2e6e41ca823ad47 /generic | |
parent | 39956f875b4912769d0e660e52054bbdb8670e1c (diff) | |
download | tcl-d38d34e93774eb6c4b854721d8273280033bdc34.zip tcl-d38d34e93774eb6c4b854721d8273280033bdc34.tar.gz tcl-d38d34e93774eb6c4b854721d8273280033bdc34.tar.bz2 |
Untangle some MEM_DEBUG ifdeffery.
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclBinary.c | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/generic/tclBinary.c b/generic/tclBinary.c index d269fbe..f0fc866 100644 --- a/generic/tclBinary.c +++ b/generic/tclBinary.c @@ -352,6 +352,7 @@ Tcl_NewByteArrayObj( *---------------------------------------------------------------------- */ +#ifdef TCL_MEM_DEBUG Tcl_Obj * Tcl_DbNewByteArrayObj( const unsigned char *bytes, /* The array of bytes used to initialize the @@ -363,18 +364,25 @@ Tcl_DbNewByteArrayObj( int line) /* Line number in the source file; used for * debugging. */ { -#ifdef TCL_MEM_DEBUG Tcl_Obj *objPtr; TclDbNewObj(objPtr, file, line); Tcl_SetByteArrayObj(objPtr, bytes, length); return objPtr; +} #else /* if not TCL_MEM_DEBUG */ - (void)file; - (void)line; +Tcl_Obj * +Tcl_DbNewByteArrayObj( + const unsigned char *bytes, /* The array of bytes used to initialize the + * new object. */ + int length, /* Length of the array of bytes, which must be + * >= 0. */ + TCL_UNUSED(const char *) /*file*/, + TCL_UNUSED(int) /*line*/) +{ return Tcl_NewByteArrayObj(bytes, length); -#endif /* TCL_MEM_DEBUG */ } +#endif /* TCL_MEM_DEBUG */ /* *--------------------------------------------------------------------------- @@ -549,7 +557,7 @@ Tcl_SetByteArrayLength( static int SetByteArrayFromAny( - Tcl_Interp *dummy, /* Not used. */ + TCL_UNUSED(Tcl_Interp *), Tcl_Obj *objPtr) /* The object to convert to type ByteArray. */ { size_t length; @@ -559,7 +567,6 @@ SetByteArrayFromAny( Tcl_UniChar ch = 0; ByteArray *byteArrayPtr; Tcl_ObjIntRep ir; - (void)dummy; if (TclHasIntRep(objPtr, &properByteArrayType)) { return TCL_OK; @@ -893,7 +900,7 @@ TclInitBinaryCmd( static int BinaryFormatCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -915,7 +922,6 @@ BinaryFormatCmd( const char *errorString; const char *errorValue, *str; int offset, size, length; - (void)dummy; if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "formatString ?arg ...?"); @@ -1399,7 +1405,7 @@ BinaryFormatCmd( int BinaryScanCmd( - ClientData dummy, /* Not used. */ + TCL_UNUSED(ClientData), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -1422,7 +1428,6 @@ BinaryScanCmd( Tcl_Obj *valuePtr, *elementPtr; Tcl_HashTable numberCacheHash; Tcl_HashTable *numberCachePtr; - (void)dummy; if (objc < 3) { Tcl_WrongNumArgs(interp, 1, objv, @@ -2467,7 +2472,7 @@ DeleteScanNumberCache( static int BinaryEncodeHex( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -2476,7 +2481,6 @@ BinaryEncodeHex( unsigned char *data = NULL; unsigned char *cursor = NULL; int offset = 0, count = 0; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "data"); @@ -2512,7 +2516,7 @@ BinaryEncodeHex( static int BinaryDecodeHex( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -2523,7 +2527,6 @@ BinaryDecodeHex( int i, index, value, size, count = 0, cut = 0, strict = 0; enum {OPT_STRICT }; static const char *const optStrings[] = { "-strict", NULL }; - (void)dummy; if (objc < 2 || objc > 3) { Tcl_WrongNumArgs(interp, 1, objv, "?options? data"); @@ -2632,7 +2635,7 @@ BinaryDecodeHex( static int BinaryEncode64( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -2645,7 +2648,6 @@ BinaryEncode64( int offset, i, index, size, outindex = 0, count = 0; enum { OPT_MAXLEN, OPT_WRAPCHAR }; static const char *const optStrings[] = { "-maxlen", "-wrapchar", NULL }; - (void)dummy; if (objc < 2 || objc % 2 != 0) { Tcl_WrongNumArgs(interp, 1, objv, @@ -2739,7 +2741,7 @@ BinaryEncode64( static int BinaryEncodeUu( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -2753,7 +2755,6 @@ BinaryEncodeUu( int wrapcharlen = sizeof(SingleNewline); enum { OPT_MAXLEN, OPT_WRAPCHAR }; static const char *const optStrings[] = { "-maxlen", "-wrapchar", NULL }; - (void)dummy; if (objc < 2 || objc % 2 != 0) { Tcl_WrongNumArgs(interp, 1, objv, @@ -2857,7 +2858,7 @@ BinaryEncodeUu( static int BinaryDecodeUu( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -2869,7 +2870,6 @@ BinaryDecodeUu( unsigned char c; enum { OPT_STRICT }; static const char *const optStrings[] = { "-strict", NULL }; - (void)dummy; if (objc < 2 || objc > 3) { Tcl_WrongNumArgs(interp, 1, objv, "?options? data"); @@ -3021,7 +3021,7 @@ BinaryDecodeUu( static int BinaryDecode64( - ClientData dummy, + TCL_UNUSED(ClientData), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -3034,7 +3034,6 @@ BinaryDecode64( int i, index, size, cut = 0, count = 0; enum { OPT_STRICT }; static const char *const optStrings[] = { "-strict", NULL }; - (void)dummy; if (objc < 2 || objc > 3) { Tcl_WrongNumArgs(interp, 1, objv, "?options? data"); |