summaryrefslogtreecommitdiffstats
path: root/generic/tclBinary.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2022-06-24 13:48:19 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2022-06-24 13:48:19 (GMT)
commit9ed525256bd289a96f4960aa566f811a5d529ae9 (patch)
tree38329d5cb298cc00bf3a85107abbd93a3b54119b /generic/tclBinary.c
parent1a619a80d9b1d41d4530a41f827a51d04c37f1ad (diff)
downloadtcl-9ed525256bd289a96f4960aa566f811a5d529ae9.zip
tcl-9ed525256bd289a96f4960aa566f811a5d529ae9.tar.gz
tcl-9ed525256bd289a96f4960aa566f811a5d529ae9.tar.bz2
Resolve the TODO: What's going on here? Document or eliminate.
Eliminate usage of TCL_MAJOR_VERSION. Allow tcl.h to be used when compiling with -DTCL_MAJOR_VERSION=8
Diffstat (limited to 'generic/tclBinary.c')
-rw-r--r--generic/tclBinary.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/generic/tclBinary.c b/generic/tclBinary.c
index 5678a66..bf40924 100644
--- a/generic/tclBinary.c
+++ b/generic/tclBinary.c
@@ -556,12 +556,8 @@ TclGetByteArrayFromObj(
baPtr = GET_BYTEARRAY(irPtr);
if (numBytesPtr != NULL) {
-#if TCL_MAJOR_VERSION > 8
- *numBytesPtr = baPtr->used;
-#else
- /* TODO: What's going on here? Document or eliminate. */
+ /* Make sure we return a value between 0 and UINT_MAX-1, or (size_t)-1 */
*numBytesPtr = ((size_t)(unsigned int)(baPtr->used + 1)) - 1;
-#endif
}
return baPtr->bytes;
}