summaryrefslogtreecommitdiffstats
path: root/generic/tclTimer.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2012-05-25 08:50:37 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2012-05-25 08:50:37 (GMT)
commit423017faed3aa258b3fa9c04cf9c6f5289d355a8 (patch)
treef84e7b63a363eae47b283df8cd05e218145957f2 /generic/tclTimer.c
parent8e1594e0c28687570a86fab6225c08157952fe7f (diff)
downloadtcl-423017faed3aa258b3fa9c04cf9c6f5289d355a8.zip
tcl-423017faed3aa258b3fa9c04cf9c6f5289d355a8.tar.gz
tcl-423017faed3aa258b3fa9c04cf9c6f5289d355a8.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.c9
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));
/*