diff options
| author | donal.k.fellows@manchester.ac.uk <dkf> | 2012-05-25 08:50:37 (GMT) |
|---|---|---|
| committer | donal.k.fellows@manchester.ac.uk <dkf> | 2012-05-25 08:50:37 (GMT) |
| commit | f02d8847b4db78ebcdf33676adf0cf74b84e0096 (patch) | |
| tree | f84e7b63a363eae47b283df8cd05e218145957f2 /generic/tclTimer.c | |
| parent | c6028756760a19ed5e27ee0f2a79ef35599db579 (diff) | |
| download | tcl-f02d8847b4db78ebcdf33676adf0cf74b84e0096.zip tcl-f02d8847b4db78ebcdf33676adf0cf74b84e0096.tar.gz tcl-f02d8847b4db78ebcdf33676adf0cf74b84e0096.tar.bz2 | |
Factor out constant that must be the same in multiple places. Prompted by a
conversation with Alexandre Ferrieux.
Diffstat (limited to 'generic/tclTimer.c')
| -rw-r--r-- | generic/tclTimer.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/generic/tclTimer.c b/generic/tclTimer.c index cf91dca..36adaad 100644 --- a/generic/tclTimer.c +++ b/generic/tclTimer.c @@ -182,8 +182,7 @@ static void TimerSetupProc(ClientData clientData, int flags); static ThreadSpecificData * InitTimer(void) { - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) - TclThreadDataKeyGet(&dataKey); + ThreadSpecificData *tsdPtr = TclThreadDataKeyGet(&dataKey); if (tsdPtr == NULL) { tsdPtr = TCL_TSD_INIT(&dataKey); @@ -214,8 +213,7 @@ static void TimerExitProc( ClientData clientData) /* Not used. */ { - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) - TclThreadDataKeyGet(&dataKey); + ThreadSpecificData *tsdPtr = TclThreadDataKeyGet(&dataKey); Tcl_DeleteEventSource(TimerSetupProc, TimerCheckProc, NULL); if (tsdPtr != NULL) { @@ -297,9 +295,8 @@ TclCreateAbsoluteTimerHandler( ClientData clientData) { register TimerHandler *timerHandlerPtr, *tPtr2, *prevPtr; - ThreadSpecificData *tsdPtr; + ThreadSpecificData *tsdPtr = InitTimer(); - tsdPtr = InitTimer(); timerHandlerPtr = ckalloc(sizeof(TimerHandler)); /* |
