diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2008-07-14 08:22:11 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2008-07-14 08:22:11 (GMT) |
commit | 0e87dee6653b2bbae46ab63cf98efb4b06b7380c (patch) | |
tree | 79720d937b6a45b4d2198754f72cf26f406a40b6 /generic | |
parent | 8d88b8afd68de02f280b0221a74a1116bb4f06dd (diff) | |
download | tcl-0e87dee6653b2bbae46ab63cf98efb4b06b7380c.zip tcl-0e87dee6653b2bbae46ab63cf98efb4b06b7380c.tar.gz tcl-0e87dee6653b2bbae46ab63cf98efb4b06b7380c.tar.bz2 |
Store ClientDatas in NRE callback storage as an array; that's how they are
referred to in callback implementations anyway.
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclBasic.c | 14 | ||||
-rw-r--r-- | generic/tclNRE.h | 7 | ||||
-rw-r--r-- | generic/tclProc.c | 7 |
3 files changed, 13 insertions, 15 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c index e2d3712..273afea 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -16,7 +16,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclBasic.c,v 1.309 2008/07/14 01:38:00 msofer Exp $ + * RCS: @(#) $Id: tclBasic.c,v 1.310 2008/07/14 08:22:13 dkf Exp $ */ #include "tclInt.h" @@ -4234,8 +4234,8 @@ int TclEvalObjv_NR2( while (recordPtr->callbackPtr) { TEOV_callback *callbackPtr = recordPtr->callbackPtr; - result = (*callbackPtr->procPtr)(&callbackPtr->data0, - interp, result); + + result = callbackPtr->procPtr(callbackPtr->data, interp, result); callbackPtr = callbackPtr->nextPtr; TclSmallFree(recordPtr->callbackPtr); recordPtr->callbackPtr = callbackPtr; @@ -7674,10 +7674,10 @@ void TclNR_AddCallback( TclSmallAlloc(sizeof(TEOV_callback), callbackPtr); callbackPtr->procPtr = postProcPtr; - callbackPtr->data0 = data0; - callbackPtr->data1 = data1; - callbackPtr->data2 = data2; - callbackPtr->data3 = data3; + callbackPtr->data[0] = data0; + callbackPtr->data[1] = data1; + callbackPtr->data[2] = data2; + callbackPtr->data[3] = data3; callbackPtr->nextPtr = recordPtr->callbackPtr; recordPtr->callbackPtr = callbackPtr; diff --git a/generic/tclNRE.h b/generic/tclNRE.h index d892f61..729cf51 100644 --- a/generic/tclNRE.h +++ b/generic/tclNRE.h @@ -11,7 +11,7 @@ * this file, and for a DISCLAIMER OF ALL WARRANTIES. * * // FIXME: RCS numbering? - * RCS: @(#) $Id: tclNRE.h,v 1.1 2008/07/13 09:04:54 msofer Exp $ + * RCS: @(#) $Id: tclNRE.h,v 1.2 2008/07/14 08:22:14 dkf Exp $ */ @@ -90,10 +90,7 @@ struct ByteCode; /* Fill up a SmallAlloc: 4 free ptrs for the user */ typedef struct TEOV_callback { TclNR_PostProc *procPtr; - ClientData data0; - ClientData data1; - ClientData data2; - ClientData data3; + ClientData data[4]; struct TEOV_callback *nextPtr; } TEOV_callback; diff --git a/generic/tclProc.c b/generic/tclProc.c index 70f2921..4ecd57f 100644 --- a/generic/tclProc.c +++ b/generic/tclProc.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclProc.c,v 1.144 2008/07/14 00:11:33 msofer Exp $ + * RCS: @(#) $Id: tclProc.c,v 1.145 2008/07/14 08:22:14 dkf Exp $ */ #include "tclInt.h" @@ -1735,7 +1735,7 @@ TclObjInterpProcCore( if (result == TCL_OK) { result = TclExecuteByteCode(interp, record.data.codePtr); result = TclEvalObjv_NR2(interp, result, rootPtr); - result = InterpProcNR2(&record.callbackPtr->data0, interp, result); + result = InterpProcNR2(record.callbackPtr->data, interp, result); TclSmallFree(record.callbackPtr); } return result; @@ -2816,8 +2816,9 @@ TclNRApplyObjCmd( /* Fix the recordPtr! */ TEOV_record *recordPtr = TOP_RECORD(iPtr); + recordPtr->callbackPtr->procPtr = ApplyNR2; - recordPtr->callbackPtr->data2 = extraPtr; + recordPtr->callbackPtr->data[2] = extraPtr; } } if (result != TCL_OK) { |