diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-10-31 09:48:57 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-10-31 09:48:57 (GMT) |
commit | b0a9f6c55b529b1b7ad08fabce66218512634149 (patch) | |
tree | 627e70f90b990839b623c96c38d82b391ca9608a /generic/tclResult.c | |
parent | 9a322ef01682c544f3a875c9c5f961b4428a9aee (diff) | |
download | tcl-b0a9f6c55b529b1b7ad08fabce66218512634149.zip tcl-b0a9f6c55b529b1b7ad08fabce66218512634149.tar.gz tcl-b0a9f6c55b529b1b7ad08fabce66218512634149.tar.bz2 |
Simplify implementation of Tcl_SaveResult/Tcl_RestoreResult/Tcl_DiscardResult by no longer assuming that Tcl_SavedResult is a struct. Backported from "novem" branch.
Diffstat (limited to 'generic/tclResult.c')
-rw-r--r-- | generic/tclResult.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/generic/tclResult.c b/generic/tclResult.c index fb97e0b..5a8ef61 100644 --- a/generic/tclResult.c +++ b/generic/tclResult.c @@ -244,7 +244,7 @@ Tcl_SaveResult( * reference. Put an empty object into the interpreter. */ - statePtr->objResultPtr = iPtr->objResultPtr; + *statePtr = iPtr->objResultPtr; iPtr->objResultPtr = Tcl_NewObj(); Tcl_IncrRefCount(iPtr->objResultPtr); } @@ -282,7 +282,7 @@ Tcl_RestoreResult( */ Tcl_DecrRefCount(iPtr->objResultPtr); - iPtr->objResultPtr = statePtr->objResultPtr; + iPtr->objResultPtr = *statePtr; } /* @@ -308,7 +308,7 @@ void Tcl_DiscardResult( Tcl_SavedResult *statePtr) /* State returned by Tcl_SaveResult. */ { - TclDecrRefCount(statePtr->objResultPtr); + Tcl_DecrRefCount(*statePtr); } /* |