summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsebres <sebres@users.sourceforge.net>2018-12-13 09:43:14 (GMT)
committersebres <sebres@users.sourceforge.net>2018-12-13 09:43:14 (GMT)
commitd233b14db6836d4497e34d2b3e981390b8fcba9c (patch)
tree63bab7e59458b54c9b125ed1b772de8d1200c6a5
parentfe20a80acbe90619202eb293872df7047b3f74b4 (diff)
downloadtcl-d233b14db6836d4497e34d2b3e981390b8fcba9c.zip
tcl-d233b14db6836d4497e34d2b3e981390b8fcba9c.tar.gz
tcl-d233b14db6836d4497e34d2b3e981390b8fcba9c.tar.bz2
reverted to smarter Jan's +1/cast/-1 with additional initial cast now (to pretect against usage of macro with other type as size_t)
-rw-r--r--generic/tclInt.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/generic/tclInt.h b/generic/tclInt.h
index a9ede63..f975d45 100644
--- a/generic/tclInt.h
+++ b/generic/tclInt.h
@@ -4909,9 +4909,8 @@ MODULE_SCOPE Tcl_PackageInitProc Procbodytest_SafeInit;
#endif /* TCL_MEM_DEBUG */
#if (!defined(TCL_WIDE_INT_IS_LONG) || (LONG_MAX > UINT_MAX)) && (SIZE_MAX <= UINT_MAX)
- static inline Tcl_Obj * TclNewWideIntObjFromSize(size_t value) {
- return Tcl_NewWideIntObj(value != ((size_t)-1) ? (Tcl_WideInt)value : -1);
- }
+# define TclNewWideIntObjFromSize(value) \
+ Tcl_NewWideIntObj(((Tcl_WideInt)(((size_t)(value))+1))-1)
#else
# define TclNewWideIntObjFromSize Tcl_NewWideIntObj
#endif