summaryrefslogtreecommitdiffstats
path: root/generic
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
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')
-rw-r--r--generic/tclClock.c10
-rw-r--r--generic/tclExecute.c12
2 files changed, 13 insertions, 9 deletions
diff --git a/generic/tclClock.c b/generic/tclClock.c
index 32ba145..782c681 100644
--- a/generic/tclClock.c
+++ b/generic/tclClock.c
@@ -562,8 +562,9 @@ ClockGetjuliandayfromerayearmonthdayObjCmd (
|| TclGetIntFromObj(interp, fieldPtr,
&(fields.dayOfMonth)) != TCL_OK
|| TclGetIntFromObj(interp, objv[2], &changeover) != TCL_OK) {
- if (fieldPtr == NULL)
- Tcl_SetObjResult(interp, Tcl_NewStringObj("expected key(s) not found in dictionary", -1));
+ if (fieldPtr == NULL) {
+ Tcl_SetObjResult(interp, Tcl_NewStringObj("expected key(s) not found in dictionary", -1));
+ }
return TCL_ERROR;
}
fields.era = era;
@@ -655,8 +656,9 @@ ClockGetjuliandayfromerayearweekdayObjCmd (
|| fieldPtr == NULL
|| TclGetIntFromObj(interp, fieldPtr, &(fields.dayOfWeek)) != TCL_OK
|| TclGetIntFromObj(interp, objv[2], &changeover) != TCL_OK) {
- if (fieldPtr == NULL)
- Tcl_SetObjResult(interp, Tcl_NewStringObj("expected key(s) not found in dictionary", -1));
+ if (fieldPtr == NULL) {
+ Tcl_SetObjResult(interp, Tcl_NewStringObj("expected key(s) not found in dictionary", -1));
+ }
return TCL_ERROR;
}
fields.era = era;
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;
}