diff options
author | Miguel Sofer <miguel.sofer@gmail.com> | 2002-06-03 16:45:02 (GMT) |
---|---|---|
committer | Miguel Sofer <miguel.sofer@gmail.com> | 2002-06-03 16:45:02 (GMT) |
commit | 1f21796d18df96d121a3c7065e58a78152d0c8a0 (patch) | |
tree | 3037f7a47c5accf5e50ad81676becbc2fba90b23 /generic/tclExecute.c | |
parent | 0fff2bdf2fa5004c0b6a782ab5dbcd4831fb642d (diff) | |
download | tcl-1f21796d18df96d121a3c7065e58a78152d0c8a0.zip tcl-1f21796d18df96d121a3c7065e58a78152d0c8a0.tar.gz tcl-1f21796d18df96d121a3c7065e58a78152d0c8a0.tar.bz2 |
reverting an accidental modification in the last commit.
Diffstat (limited to 'generic/tclExecute.c')
-rw-r--r-- | generic/tclExecute.c | 62 |
1 files changed, 1 insertions, 61 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 2374cd3..9a652b2 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclExecute.c,v 1.58 2002/06/03 16:31:25 msofer Exp $ + * RCS: @(#) $Id: tclExecute.c,v 1.59 2002/06/03 16:45:02 msofer Exp $ */ #include "tclInt.h" @@ -66,33 +66,6 @@ TCL_DECLARE_MUTEX(execMutex) int tclTraceExec = 0; #endif -typedef struct ThreadSpecificData { - /* - * The following global variable is use to signal matherr that Tcl - * is responsible for the arithmetic, so errors can be handled in a - * fashion appropriate for Tcl. Zero means no Tcl math is in - * progress; non-zero means Tcl is doing math. - */ - - int mathInProgress; - -} ThreadSpecificData; - -static Tcl_ThreadDataKey dataKey; - -/* - * The variable below serves no useful purpose except to generate - * a reference to matherr, so that the Tcl version of matherr is - * linked in rather than the system version. Without this reference - * the need for matherr won't be discovered during linking until after - * libtcl.a has been processed, so Tcl's version won't be used. - */ - -#ifdef NEED_MATHERR -extern int matherr(); -int (*tclMatherrPtr)() = matherr; -#endif - /* * Mapping from expression instruction opcodes to strings; used for error * messages. Note that these entries must match the order and number of the @@ -3939,7 +3912,6 @@ TclExecuteByteCode(interp, codePtr) */ BuiltinFunc *mathFuncPtr; - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); if ((opnd < 0) || (opnd > LAST_BUILTIN_FUNC)) { TRACE(("UNRECOGNIZED BUILTIN FUNC CODE %d\n", opnd)); @@ -3947,10 +3919,8 @@ TclExecuteByteCode(interp, codePtr) } mathFuncPtr = &(builtinFuncTable[opnd]); DECACHE_STACK_INFO(); - tsdPtr->mathInProgress++; result = (*mathFuncPtr->proc)(interp, eePtr, mathFuncPtr->clientData); - tsdPtr->mathInProgress--; CACHE_STACK_INFO(); if (result != TCL_OK) { goto checkForCatch; @@ -3971,13 +3941,10 @@ TclExecuteByteCode(interp, codePtr) * is the 0-th argument. */ Tcl_Obj **objv; /* The array of arguments. The function * name is objv[0]. */ - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); objv = &(stackPtr[stackTop - (objc-1)]); /* "objv[0]" */ DECACHE_STACK_INFO(); - tsdPtr->mathInProgress++; result = ExprCallMathFunc(interp, eePtr, objc, objv); - tsdPtr->mathInProgress--; CACHE_STACK_INFO(); if (result != TCL_OK) { goto checkForCatch; @@ -5678,7 +5645,6 @@ ExprCallMathFunc(interp, eePtr, objc, objv) long i; double d; int j, k, result; - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); Tcl_ResetResult(interp); @@ -5776,10 +5742,8 @@ ExprCallMathFunc(interp, eePtr, objc, objv) * Invoke the function and copy its result back into valuePtr. */ - tsdPtr->mathInProgress++; result = (*mathFuncPtr->proc)(mathFuncPtr->clientData, interp, args, &funcResult); - tsdPtr->mathInProgress--; if (result != TCL_OK) { goto done; } @@ -5869,30 +5833,6 @@ TclExprFloatError(interp, value) } } -/* - *---------------------------------------------------------------------- - * - * TclMathInProgress -- - * - * This procedure is called to find out if Tcl is doing math - * in this thread. - * - * Results: - * 0 or 1. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -TclMathInProgress() -{ - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - return tsdPtr->mathInProgress; -} - #ifdef TCL_COMPILE_STATS /* *---------------------------------------------------------------------- |