summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-10-20 10:31:34 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-10-20 10:31:34 (GMT)
commit8ac4aee0fc7e4d4020c874ab41fecad788d1c848 (patch)
tree727a0026f71d76b71952efcbc751dc02bb8a2b04 /generic
parentf803a65cc1f899c03c6a38be5d9185b74a075dde (diff)
downloadtcl-8ac4aee0fc7e4d4020c874ab41fecad788d1c848.zip
tcl-8ac4aee0fc7e4d4020c874ab41fecad788d1c848.tar.gz
tcl-8ac4aee0fc7e4d4020c874ab41fecad788d1c848.tar.bz2
One more attempt to fix the MSVC++ warning for Debug builds
Diffstat (limited to 'generic')
-rw-r--r--generic/tclInt.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/generic/tclInt.h b/generic/tclInt.h
index c536aee..2a0dfa6 100644
--- a/generic/tclInt.h
+++ b/generic/tclInt.h
@@ -4816,11 +4816,12 @@ MODULE_SCOPE Tcl_PackageInitProc Procbodytest_SafeInit;
#define TclNewIndexObj(objPtr, w) \
do { \
+ size_t _w = (w); \
TclIncrObjsAllocated(); \
TclAllocObjStorage(objPtr); \
(objPtr)->refCount = 0; \
(objPtr)->bytes = NULL; \
- (objPtr)->internalRep.wideValue = (Tcl_WideInt)((w) + 1) - 1; \
+ (objPtr)->internalRep.wideValue = ((_w) == TCL_INDEX_NONE) ? -1 : (Tcl_WideInt)(_w); \
(objPtr)->typePtr = &tclIntType; \
TCL_DTRACE_OBJ_CREATE(objPtr); \
} while (0)
@@ -4851,7 +4852,7 @@ MODULE_SCOPE Tcl_PackageInitProc Procbodytest_SafeInit;
(objPtr) = Tcl_NewWideIntObj(w)
#define TclNewIndexObj(objPtr, w) \
- (objPtr) = (w == TCL_INDEX_NONE) ? Tcl_NewWideIntObj(-1) : Tcl_NewWideIntObj(w)
+ (objPtr) = ((w) == TCL_INDEX_NONE) ? Tcl_NewWideIntObj(-1) : Tcl_NewWideIntObj(w)
#define TclNewDoubleObj(objPtr, d) \
(objPtr) = Tcl_NewDoubleObj(d)