summaryrefslogtreecommitdiffstats
path: root/generic/tclExecute.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2016-01-21 13:11:15 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2016-01-21 13:11:15 (GMT)
commit093b0618b6e6bef06c090aab243ad716995ba4b5 (patch)
treeb1e31ad71cba1235656ee8a2a9cd7c54a5c0c4a2 /generic/tclExecute.c
parent003b3000368a5f8752fcee1444cf4ec1cee6fe62 (diff)
downloadtcl-093b0618b6e6bef06c090aab243ad716995ba4b5.zip
tcl-093b0618b6e6bef06c090aab243ad716995ba4b5.tar.gz
tcl-093b0618b6e6bef06c090aab243ad716995ba4b5.tar.bz2
Fix compiler warnings (discovered on latest clang/gcc6), suggested by Gustaf Neumann. All harmless, no change of functionality.
Diffstat (limited to 'generic/tclExecute.c')
-rw-r--r--generic/tclExecute.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 248b1b3..bfb9d17 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -280,6 +280,8 @@ VarHashCreateVar(
#define CURR_DEPTH (tosPtr - initTosPtr)
+#define STACK_BASE(esPtr) ((esPtr)->stackWords - 1)
+
/*
* Macros used to trace instruction execution. The macros TRACE,
* TRACE_WITH_OBJ, and O2S are only used inside TclExecuteByteCode. O2S is
@@ -722,7 +724,7 @@ TclCreateExecEnv(
esPtr->nextPtr = NULL;
esPtr->markerPtr = NULL;
esPtr->endPtr = &esPtr->stackWords[TCL_STACK_INITIAL_SIZE-1];
- esPtr->tosPtr = &esPtr->stackWords[-1];
+ esPtr->tosPtr = STACK_BASE(esPtr);
Tcl_MutexLock(&execMutex);
if (!execInitialized) {
@@ -934,8 +936,8 @@ GrowEvaluationStack(
if (esPtr->nextPtr) {
oldPtr = esPtr;
esPtr = oldPtr->nextPtr;
- currElems = esPtr->endPtr - &esPtr->stackWords[-1];
- if (esPtr->markerPtr || (esPtr->tosPtr != &esPtr->stackWords[-1])) {
+ currElems = esPtr->endPtr - STACK_BASE(esPtr);
+ if (esPtr->markerPtr || (esPtr->tosPtr != STACK_BASE(esPtr))) {
Tcl_Panic("STACK: Stack after current is in use");
}
if (esPtr->nextPtr) {
@@ -947,7 +949,7 @@ GrowEvaluationStack(
DeleteExecStack(esPtr);
esPtr = oldPtr;
} else {
- currElems = esPtr->endPtr - &esPtr->stackWords[-1];
+ currElems = esPtr->endPtr - STACK_BASE(esPtr);
}
/*
@@ -1089,7 +1091,7 @@ TclStackFree(
* Return to previous stack.
*/
- esPtr->tosPtr = &esPtr->stackWords[-1];
+ esPtr->tosPtr = STACK_BASE(esPtr);
if (esPtr->prevPtr) {
eePtr->execStackPtr = esPtr->prevPtr;
}