summaryrefslogtreecommitdiffstats
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)
commite12cc95f12b130e5b9cce4c1eeef3bfc43e28676 (patch)
tree869fa59882e46eb6f85203ed6cb8ffeeb1b6b052
parentbeb8c62dff3813dc9fbb4fc25d2ca18ffd6c6d5e (diff)
downloadtcl-e12cc95f12b130e5b9cce4c1eeef3bfc43e28676.zip
tcl-e12cc95f12b130e5b9cce4c1eeef3bfc43e28676.tar.gz
tcl-e12cc95f12b130e5b9cce4c1eeef3bfc43e28676.tar.bz2
Simplify macro typecasting.
-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;
}