summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2014-01-31 22:07:10 (GMT)
committerdgp <dgp@users.sourceforge.net>2014-01-31 22:07:10 (GMT)
commita85ebc21de9b4010d0733a56197fecbb6f3d3a3b (patch)
tree869fa59882e46eb6f85203ed6cb8ffeeb1b6b052 /generic
parent6f611b9b973068d5630b4a227aef5fc316686036 (diff)
downloadtcl-a85ebc21de9b4010d0733a56197fecbb6f3d3a3b.zip
tcl-a85ebc21de9b4010d0733a56197fecbb6f3d3a3b.tar.gz
tcl-a85ebc21de9b4010d0733a56197fecbb6f3d3a3b.tar.bz2
Simplify macro typecasting.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclIO.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c
index 7705d7b..3636861 100644
--- a/generic/tclIO.c
+++ b/generic/tclIO.c
@@ -331,7 +331,7 @@ static Tcl_ObjType chanObjType = {
#define SET_CHANNELSTATE(objPtr, storePtr) \
((objPtr)->internalRep.twoPtrValue.ptr1 = (void *) (storePtr))
#define GET_CHANNELINTERP(objPtr) \
- ((Interp *) (objPtr)->internalRep.twoPtrValue.ptr2)
+ ((Tcl_Interp *) (objPtr)->internalRep.twoPtrValue.ptr2)
#define SET_CHANNELINTERP(objPtr, storePtr) \
((objPtr)->internalRep.twoPtrValue.ptr2 = (void *) (storePtr))
@@ -10373,10 +10373,9 @@ DupChannelIntRep(
* currently have an internal rep.*/
{
ChannelState *statePtr = GET_CHANNELSTATE(srcPtr);
- Interp *interpPtr = GET_CHANNELINTERP(srcPtr);
SET_CHANNELSTATE(copyPtr, statePtr);
- SET_CHANNELINTERP(copyPtr, interpPtr);
+ SET_CHANNELINTERP(copyPtr, GET_CHANNELINTERP(srcPtr));
Tcl_Preserve((ClientData) statePtr);
copyPtr->typePtr = srcPtr->typePtr;
}
@@ -10404,7 +10403,6 @@ SetChannelFromAny(
register Tcl_Obj *objPtr) /* The object to convert. */
{
ChannelState *statePtr;
- Interp *interpPtr;
if (interp == NULL) {
return TCL_ERROR;
@@ -10415,12 +10413,11 @@ SetChannelFromAny(
* Ensure consistency checks are done.
*/
statePtr = GET_CHANNELSTATE(objPtr);
- interpPtr = GET_CHANNELINTERP(objPtr);
if (statePtr->flags & (CHANNEL_TAINTED|CHANNEL_CLOSED)) {
ResetFlag(statePtr, CHANNEL_TAINTED);
Tcl_Release((ClientData) statePtr);
objPtr->typePtr = NULL;
- } else if (interpPtr != (Interp*) interp) {
+ } else if (interp != GET_CHANNELINTERP(objPtr)) {
Tcl_Release((ClientData) statePtr);
objPtr->typePtr = NULL;
}