From 4cd9155ae918a63f1c940a9557bf9ab4afd4a333 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 2 Jul 2015 08:17:50 +0000 Subject: Another round of refCount consistancy improvements. --- generic/tclBasic.c | 30 +++++++++++++-------------- generic/tclCompile.c | 12 +++++------ generic/tclIO.c | 57 +++++++++++++++++++++++++-------------------------- generic/tclIOGT.c | 4 ++-- generic/tclListObj.c | 4 ++-- generic/tclNamesp.c | 14 ++++++------- generic/tclOOCall.c | 2 +- generic/tclOOMethod.c | 12 +++++------ generic/tclPreserve.c | 5 ++--- generic/tclProc.c | 3 +-- generic/tclRegexp.c | 6 +++--- generic/tclTrace.c | 20 +++++++++--------- 12 files changed, 83 insertions(+), 86 deletions(-) diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 1220239..c9b37b2 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -2260,7 +2260,7 @@ Tcl_CreateObjCommand( /* Command already exists. */ /* - * [***] This is wrong. See Tcl Bug a16752c252. + * [***] This is wrong. See Tcl Bug a16752c252. * However, this buggy behavior is kept under particular * circumstances to accommodate deployed binaries of the * "tclcompiler" program. http://sourceforge.net/projects/tclpro/ @@ -3084,7 +3084,7 @@ Tcl_DeleteCommandFromToken( while (tracePtr != NULL) { CommandTrace *nextPtr = tracePtr->nextPtr; - if ((--tracePtr->refCount) <= 0) { + if (tracePtr->refCount-- <= 1) { ckfree(tracePtr); } tracePtr = nextPtr; @@ -3270,7 +3270,7 @@ CallCommandTraces( tracePtr->traceProc(tracePtr->clientData, (Tcl_Interp *) iPtr, oldName, newName, flags); cmdPtr->flags &= ~tracePtr->flags; - if ((--tracePtr->refCount) <= 0) { + if (tracePtr->refCount-- <= 1) { ckfree(tracePtr); } } @@ -4144,7 +4144,7 @@ TclNREvalObjv( * data[1] stores a marker for use by tailcalls; it will be set to 1 by * command redirectors (imports, alias, ensembles) so that tailcall skips * this callback (that marks the end of the target command) and goes back - * to the end of the source command. + * to the end of the source command. */ if (iPtr->deferredCallbacks) { @@ -4172,7 +4172,7 @@ EvalObjvCore( Interp *iPtr = (Interp *) interp; Namespace *lookupNsPtr = NULL; int enterTracesDone = 0; - + /* * Push records for task to be done on return, in INVERSE order. First, if * needed, the exception handlers (as they should happen last). @@ -4298,7 +4298,7 @@ EvalObjvCore( } } - /* + /* * Schedule leave traces. Raise the refCount on the resolved * cmdPtr, so that when it passes to the leave traces we know * it's still valid. @@ -4409,7 +4409,7 @@ NRCommand( /* * If there is a tailcall, schedule it next */ - + if (data[1] && (data[1] != INT2PTR(1))) { TclNRAddCallback(interp, TclNRTailcallEval, data[1], NULL, NULL, NULL); } @@ -5643,10 +5643,10 @@ TclArgumentBCEnter( * ensemble dispatch. Ensemble subcommands that lead to script * evaluation are not supposed to get compiled, because a command * such as [info level] in the script can expose some of the dispatch - * shenanigans. This means that we don't have to tend to the + * shenanigans. This means that we don't have to tend to the * housekeeping, and can escape now. */ - + if (ePtr->nline != objc) { return; } @@ -5910,7 +5910,7 @@ Tcl_GlobalEvalObj( * * If the flag TCL_EVAL_DIRECT is passed in, the value of invoker * must be NULL. Support for non-NULL invokers in that mode has - * been removed since it was unused and untested. Failure to + * been removed since it was unused and untested. Failure to * follow this limitation will lead to an assertion panic. * * Results: @@ -8192,7 +8192,7 @@ Tcl_NRCmdSwap( * TclSkipTailcall: if the NEXT command to be pushed tailcalls, execution * should continue after the CURRENT command is fully returned ("skip * the next command: we are redirecting to it, tailcalls should run - * after WE return") + * after WE return") * TclPushTailcallPoint: the search for a tailcalling spot cannot traverse * this point. This is special for OO, as some of the oo constructs * that behave like commands may not push an NRCommand callback. @@ -8326,7 +8326,7 @@ TclNRTailcallObjCmd( /* The tailcall data is in a Tcl list: the first element is the * namespace, the rest the command to be tailcalled. */ - + listPtr = Tcl_NewListObj(objc, objv); nsObjPtr = Tcl_NewStringObj(nsPtr->fullName, -1); @@ -8335,7 +8335,7 @@ TclNRTailcallObjCmd( Tcl_Panic("Tailcall failed to find the proper namespace"); } TclListObjSetElement(interp, listPtr, 0, nsObjPtr); - + iPtr->varFramePtr->tailcallPtr = listPtr; } return TCL_RETURN; @@ -8364,9 +8364,9 @@ TclNRTailcallEval( int objc; Tcl_Obj **objv; - Tcl_ListObjGetElements(interp, listPtr, &objc, &objv); + Tcl_ListObjGetElements(interp, listPtr, &objc, &objv); nsObjPtr = objv[0]; - + if (result == TCL_OK) { result = TclGetNamespaceFromObj(interp, nsObjPtr, &nsPtr); } diff --git a/generic/tclCompile.c b/generic/tclCompile.c index 98756ea..b9aee64 100644 --- a/generic/tclCompile.c +++ b/generic/tclCompile.c @@ -1117,7 +1117,7 @@ TclCleanupByteCode( } } - if (codePtr->localCachePtr && (--codePtr->localCachePtr->refCount == 0)) { + if (codePtr->localCachePtr && (codePtr->localCachePtr->refCount-- <= 1)) { TclFreeLocalCache(interp, codePtr->localCachePtr); } @@ -1624,7 +1624,7 @@ TclFreeCompileEnv( envPtr->localLitTable.buckets = envPtr->localLitTable.staticBuckets; } if (envPtr->iPtr) { - /* + /* * We never converted to Bytecode, so free the things we would * have transferred to it. */ @@ -1856,7 +1856,7 @@ CompileExpanded( int wordIdx = 0; DefineLineInformation; int depth = TclGetStackDepth(envPtr); - + StartExpanding(envPtr); if (cmdObj) { CompileCmdLiteral(interp, cmdObj, envPtr); @@ -1905,7 +1905,7 @@ CompileExpanded( TclCheckStackDepth(depth+1, envPtr); } -static int +static int CompileCmdCompileProc( Tcl_Interp *interp, Tcl_Parse *parsePtr, @@ -2006,7 +2006,7 @@ CompileCommandTokens( int cmdIdx = envPtr->numCommands; int startCodeOffset = envPtr->codeNext - envPtr->codeStart; int depth = TclGetStackDepth(envPtr); - + assert (parsePtr->numWords > 0); /* Pre-Compile */ @@ -4035,7 +4035,7 @@ TclEmitInvoke( int arg1, arg2, wordCount = 0, expandCount = 0; int loopRange = 0, breakRange = 0, continueRange = 0; int cleanup, depth = TclGetStackDepth(envPtr); - + /* * Parse the arguments. */ diff --git a/generic/tclIO.c b/generic/tclIO.c index b97f57a..eb924d1 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.c @@ -578,11 +578,11 @@ TclFinalizeIOSubsystem(void) int active = 1; /* Flag == 1 while there's still work to do */ int doflushnb; - /* Fetch the pre-TIP#398 compatibility flag */ + /* Fetch the pre-TIP#398 compatibility flag */ { const char *s; Tcl_DString ds; - + s = TclGetEnv("TCL_FLUSH_NONBLOCKING_ON_EXIT", &ds); doflushnb = ((s != NULL) && strcmp(s, "0")); if (s != NULL) { @@ -635,9 +635,9 @@ TclFinalizeIOSubsystem(void) /* Set the channel back into blocking mode to ensure that we wait * for all data to flush out. */ - + (void) Tcl_SetChannelOption(NULL, (Tcl_Channel) chanPtr, - "-blocking", "on"); + "-blocking", "on"); } if ((chanPtr == (Channel *) tsdPtr->stdinChannel) || @@ -1022,8 +1022,7 @@ DeleteChannelTable( Tcl_DeleteHashEntry(hPtr); SetFlag(statePtr, CHANNEL_TAINTED); - statePtr->refCount--; - if (statePtr->refCount <= 0) { + if (statePtr->refCount-- <= 1) { if (!GotFlag(statePtr, BG_FLUSH_SCHEDULED)) { (void) Tcl_Close(interp, (Tcl_Channel) chanPtr); } @@ -1931,7 +1930,7 @@ TclChannelRelease( if (chanPtr->refCount == 0) { Tcl_Panic("Channel released more than preserved"); } - if (--chanPtr->refCount) { + if (chanPtr->refCount-- > 1) { return; } if (chanPtr->typePtr == NULL) { @@ -2427,7 +2426,7 @@ static void ReleaseChannelBuffer( ChannelBuffer *bufPtr) { - if (--bufPtr->refCount) { + if (bufPtr->refCount-- > 1) { return; } ckfree(bufPtr); @@ -2657,7 +2656,7 @@ FlushChannel( * the post-condition that on a successful return to caller we've * left space in the current output buffer for more writing (the flush * call was to make new room). - * If the channel is blocking, then yes, so we guarantee that + * If the channel is blocking, then yes, so we guarantee that * blocking flushes actually flush all pending data. * Otherwise, no. Keep the current output buffer where it is so more * can be written to it, possibly filling it, to promote more efficient @@ -2844,7 +2843,7 @@ FlushChannel( /* * When we are calledFromAsyncFlush, that means a writable * state on the channel triggered the call, so we should be - * able to write something. Either we did write something + * able to write something. Either we did write something * and wroteSome should be set, or there was nothing left to * write in this call, and we've completed the BG flush. * These are the two cases above. If we get here, that means @@ -4224,7 +4223,7 @@ Write( if (nextNewLine) { srcLimit = nextNewLine - src; } - + /* Get space to write into */ bufPtr = statePtr->curOutPtr; if (bufPtr == NULL) { @@ -4252,7 +4251,7 @@ Write( /* See chan-io-1.[89]. Tcl Bug 506297. */ statePtr->outputEncodingFlags &= ~TCL_ENCODING_START; - + if ((result != TCL_OK) && (srcRead + dstWrote == 0)) { /* We're reading from invalid/incomplete UTF-8 */ ReleaseChannelBuffer(bufPtr); @@ -4292,7 +4291,7 @@ Write( Tcl_Panic("unknown output translation requested"); break; } - + result |= Tcl_UtfToExternal(NULL, encoding, nl, nlLen, statePtr->outputEncodingFlags, &statePtr->outputEncodingState, dst, @@ -5711,7 +5710,7 @@ DoReadChars( int factor = UTF_EXPANSION_FACTOR; binaryMode = (encoding == NULL) - && (statePtr->inputTranslation == TCL_TRANSLATE_LF) + && (statePtr->inputTranslation == TCL_TRANSLATE_LF) && (statePtr->inEofChar == '\0'); if (appendFlag == 0) { @@ -5981,7 +5980,7 @@ ReadChars( * expand when converted to UTF-8 chars. This guess comes from analyzing * how many characters were produced by the previous pass. */ - + int factor = *factorPtr; int dstLimit = TCL_UTF_MAX - 1 + toRead * factor / UTF_EXPANSION_FACTOR; @@ -6014,7 +6013,7 @@ ReadChars( while (1) { int dstDecoded, dstRead, dstWrote, srcRead, numChars, code; int flags = statePtr->inputEncodingFlags | TCL_ENCODING_NO_TERMINATE; - + if (charsToRead > 0) { flags |= TCL_ENCODING_CHAR_LIMIT; numChars = charsToRead; @@ -6149,7 +6148,7 @@ ReadChars( char buffer[TCL_UTF_MAX + 1]; int read, decoded, count; - /* + /* * Didn't get everything the buffer could offer */ @@ -6205,7 +6204,7 @@ ReadChars( /* FALL THROUGH - get more data (dstWrote == 0) */ } - /* + /* * The translation transformation can only reduce the number * of chars when it converts \r\n into \n. The reduction in * the number of chars is the difference in bytes read and written. @@ -6215,7 +6214,7 @@ ReadChars( if (charsToRead > 0 && numChars > charsToRead) { - /* + /* * TODO: This cannot happen anymore. * * We read more chars than allowed. Reset limits to @@ -6238,7 +6237,7 @@ ReadChars( assert (numChars == 0); - /* + /* * There is one situation where this is the correct final * result. If the src buffer contains only a single \n * byte, and we are in TCL_TRANSLATE_AUTO mode, and @@ -6331,7 +6330,7 @@ ReadChars( *--------------------------------------------------------------------------- */ -static void +static void TranslateInputEOL( ChannelState *statePtr, /* Channel being read, for EOL translation and * EOF character. */ @@ -6537,7 +6536,7 @@ Tcl_Ungets( /* * Clear the EOF flags, and clear the BLOCKED bit. */ - + if (GotFlag(statePtr, CHANNEL_EOF)) { statePtr->inputEncodingFlags |= TCL_ENCODING_START; } @@ -6694,7 +6693,7 @@ GetInput( ChannelState *statePtr = chanPtr->state; /* State info for channel */ - /* + /* * Verify that all callers know better than to call us when * it's recorded that the next char waiting to be read is the * eofchar. @@ -9206,7 +9205,7 @@ MBEvent( } } -static int +static int MBRead( CopyState *csPtr) { @@ -9227,7 +9226,7 @@ MBRead( } } -static int +static int MBWrite( CopyState *csPtr) { @@ -9654,7 +9653,7 @@ CopyData( * DoRead -- * * Stores up to "bytesToRead" bytes in memory pointed to by "dst". - * These bytes come from reading the channel "chanPtr" and + * These bytes come from reading the channel "chanPtr" and * performing the configured translations. No encoding conversions * are applied to the bytes being read. * @@ -9724,7 +9723,7 @@ DoRead( TclChannelPreserve((Tcl_Channel)chanPtr); while (bytesToRead) { /* - * Each pass through the loop is intended to process up to + * Each pass through the loop is intended to process up to * one channel buffer. */ @@ -9732,13 +9731,13 @@ DoRead( ChannelBuffer *bufPtr = statePtr->inQueueHead; /* - * Don't read more data if we have what we need. + * Don't read more data if we have what we need. */ while (!bufPtr || /* We got no buffer! OR */ (!IsBufferFull(bufPtr) && /* Our buffer has room AND */ (BytesLeft(bufPtr) < bytesToRead) ) ) { - /* Not enough bytes in it + /* Not enough bytes in it * yet to fill the dst */ int code; diff --git a/generic/tclIOGT.c b/generic/tclIOGT.c index 58d1a22..c1ce485 100644 --- a/generic/tclIOGT.c +++ b/generic/tclIOGT.c @@ -225,7 +225,7 @@ static void ReleaseData( TransformChannelData *dataPtr) { - if (--dataPtr->refCount) { + if (dataPtr->refCount-- > 1) { return; } ResultClear(&dataPtr->result); @@ -683,7 +683,7 @@ TransformInputProc( * Already saw EOF from downChan; don't ask again. * NOTE: Could move this up to avoid the last maxRead * execution. Believe this would still be correct behavior, - * but the test suite tests the whole command callback + * but the test suite tests the whole command callback * sequence, so leave it unchanged for now. */ diff --git a/generic/tclListObj.c b/generic/tclListObj.c index bd2dbc4..fa67ee6 100644 --- a/generic/tclListObj.c +++ b/generic/tclListObj.c @@ -137,7 +137,7 @@ NewListIntRep( * Creates a list internal rep with space for objc elements. objc * must be > 0. If objv!=NULL, initializes with the first objc values * in that array. If objv==NULL, initalize list internal rep to have - * 0 elements, with space to add objc more. + * 0 elements, with space to add objc more. * * Results: * A new List struct with refCount 0 is returned. If some failure @@ -1726,7 +1726,7 @@ FreeListInternalRep( { List *listRepPtr = ListRepPtr(listPtr); - if (--listRepPtr->refCount <= 0) { + if (listRepPtr->refCount-- <= 1) { Tcl_Obj **elemPtrs = &listRepPtr->elements; int i, numElems = listRepPtr->elemCount; diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c index 8f2f10e..3231ce6 100644 --- a/generic/tclNamesp.c +++ b/generic/tclNamesp.c @@ -343,7 +343,7 @@ Tcl_PushCallFrame( framePtr->clientData = NULL; framePtr->localCachePtr = NULL; framePtr->tailcallPtr = NULL; - + /* * Push the new call frame onto the interpreter's stack of procedure call * frames making it the current frame. @@ -402,7 +402,7 @@ Tcl_PopCallFrame( } if (framePtr->numCompiledLocals > 0) { TclDeleteCompiledLocalVars(iPtr, framePtr); - if (--framePtr->localCachePtr->refCount == 0) { + if (framePtr->localCachePtr->refCount-- <= 1) { TclFreeLocalCache(interp, framePtr->localCachePtr); } framePtr->localCachePtr = NULL; @@ -3056,7 +3056,7 @@ NamespaceCodeCmd( */ arg = TclGetStringFromObj(objv[1], &length); - if (*arg==':' && length > 20 + if (*arg==':' && length > 20 && strncmp(arg, "::namespace inscope ", 20) == 0) { Tcl_SetObjResult(interp, objv[1]); return TCL_OK; @@ -4929,7 +4929,7 @@ TclLogCommandInfo( if (Tcl_IsShared(iPtr->errorStack)) { Tcl_Obj *newObj; - + newObj = Tcl_DuplicateObj(iPtr->errorStack); Tcl_DecrRefCount(iPtr->errorStack); Tcl_IncrRefCount(newObj); @@ -4961,7 +4961,7 @@ TclLogCommandInfo( Tcl_ListObjAppendElement(NULL, iPtr->errorStack, Tcl_NewStringObj(command, length)); } - } + } if (!iPtr->framePtr->objc) { /* @@ -5014,7 +5014,7 @@ TclErrorStackResetIf( if (Tcl_IsShared(iPtr->errorStack)) { Tcl_Obj *newObj; - + newObj = Tcl_DuplicateObj(iPtr->errorStack); Tcl_DecrRefCount(iPtr->errorStack); Tcl_IncrRefCount(newObj); @@ -5034,7 +5034,7 @@ TclErrorStackResetIf( Tcl_ListObjAppendElement(NULL, iPtr->errorStack, iPtr->innerLiteral); Tcl_ListObjAppendElement(NULL, iPtr->errorStack, Tcl_NewStringObj(msg, length)); - } + } } /* diff --git a/generic/tclOOCall.c b/generic/tclOOCall.c index 2a81091..facf90d 100644 --- a/generic/tclOOCall.c +++ b/generic/tclOOCall.c @@ -156,7 +156,7 @@ void TclOODeleteChain( CallChain *callPtr) { - if (callPtr == NULL || --callPtr->refCount >= 1) { + if (callPtr == NULL || callPtr->refCount-- > 1) { return; } if (callPtr->chain != callPtr->staticChain) { diff --git a/generic/tclOOMethod.c b/generic/tclOOMethod.c index f586e8c..e18eeec 100644 --- a/generic/tclOOMethod.c +++ b/generic/tclOOMethod.c @@ -272,7 +272,7 @@ void TclOODelMethodRef( Method *mPtr) { - if ((mPtr != NULL) && (--mPtr->refCount <= 0)) { + if ((mPtr != NULL) && (mPtr->refCount-- <= 1)) { if (mPtr->typePtr != NULL && mPtr->typePtr->deleteProc != NULL) { mPtr->typePtr->deleteProc(mPtr->clientData); } @@ -720,7 +720,7 @@ InvokeProcedureMethod( Tcl_PopCallFrame(interp); TclStackFree(interp, fdPtr->framePtr); - if (--pmPtr->refCount < 1) { + if (pmPtr->refCount-- <= 1) { DeleteProcedureMethodRecord(pmPtr); } TclStackFree(interp, fdPtr); @@ -771,7 +771,7 @@ FinalizePMCall( * sensitive when it comes to performance! */ - if (--pmPtr->refCount < 1) { + if (pmPtr->refCount-- <= 1) { DeleteProcedureMethodRecord(pmPtr); } TclStackFree(interp, fdPtr); @@ -961,7 +961,7 @@ ProcedureMethodVarResolver( { int result; Tcl_ResolvedVarInfo *rPtr = NULL; - + result = ProcedureMethodCompiledVarResolver(interp, varName, strlen(varName), contextNs, &rPtr); @@ -1278,7 +1278,7 @@ DeleteProcedureMethod( { register ProcedureMethod *pmPtr = clientData; - if (--pmPtr->refCount < 1) { + if (pmPtr->refCount-- <= 1) { DeleteProcedureMethodRecord(pmPtr); } } @@ -1473,7 +1473,7 @@ FinalizeForwardCall( int result) { Tcl_Obj **argObjs = data[0]; - + TclStackFree(interp, argObjs); return result; } diff --git a/generic/tclPreserve.c b/generic/tclPreserve.c index 0bd8f93..0b33d22 100644 --- a/generic/tclPreserve.c +++ b/generic/tclPreserve.c @@ -195,7 +195,7 @@ Tcl_Release( continue; } - if (--refPtr->refCount != 0) { + if (refPtr->refCount-- > 1) { Tcl_MutexUnlock(&preserveMutex); return; } @@ -459,8 +459,7 @@ TclHandleRelease( handlePtr, handlePtr->ptr2, handlePtr->ptr); } #endif - handlePtr->refCount--; - if ((handlePtr->refCount == 0) && (handlePtr->ptr == NULL)) { + if ((handlePtr->refCount-- <= 1) && (handlePtr->ptr == NULL)) { ckfree(handlePtr); } } diff --git a/generic/tclProc.c b/generic/tclProc.c index 2679bf1..a9705eb 100644 --- a/generic/tclProc.c +++ b/generic/tclProc.c @@ -2147,8 +2147,7 @@ TclProcDeleteProc( { Proc *procPtr = clientData; - procPtr->refCount--; - if (procPtr->refCount <= 0) { + if (procPtr->refCount-- <= 1) { TclProcCleanupProc(procPtr); } } diff --git a/generic/tclRegexp.c b/generic/tclRegexp.c index 5bc3aa2..ea25d4b 100644 --- a/generic/tclRegexp.c +++ b/generic/tclRegexp.c @@ -755,7 +755,7 @@ FreeRegexpInternalRep( * If this is the last reference to the regexp, free it. */ - if (--(regexpRepPtr->refCount) <= 0) { + if (regexpRepPtr->refCount-- <= 1) { FreeRegexp(regexpRepPtr); } objPtr->typePtr = NULL; @@ -976,7 +976,7 @@ CompileRegexp( if (tsdPtr->patterns[NUM_REGEXPS-1] != NULL) { TclRegexp *oldRegexpPtr = tsdPtr->regexps[NUM_REGEXPS-1]; - if (--(oldRegexpPtr->refCount) <= 0) { + if (oldRegexpPtr->refCount-- <= 1) { FreeRegexp(oldRegexpPtr); } ckfree(tsdPtr->patterns[NUM_REGEXPS-1]); @@ -1050,7 +1050,7 @@ FinalizeRegexp( for (i = 0; (i < NUM_REGEXPS) && (tsdPtr->patterns[i] != NULL); i++) { regexpPtr = tsdPtr->regexps[i]; - if (--(regexpPtr->refCount) <= 0) { + if (regexpPtr->refCount-- <= 1) { FreeRegexp(regexpPtr); } ckfree(tsdPtr->patterns[i]); diff --git a/generic/tclTrace.c b/generic/tclTrace.c index 6184a89..fe52d59 100644 --- a/generic/tclTrace.c +++ b/generic/tclTrace.c @@ -544,7 +544,7 @@ TraceExecutionObjCmd( tcmdPtr->flags = 0; } - if ((--tcmdPtr->refCount) <= 0) { + if (tcmdPtr->refCount-- <= 1) { ckfree(tcmdPtr); } break; @@ -748,7 +748,7 @@ TraceCommandObjCmd( Tcl_UntraceCommand(interp, name, flags | TCL_TRACE_DELETE, TraceCommandProc, clientData); tcmdPtr->flags |= TCL_TRACE_DESTROYED; - if ((--tcmdPtr->refCount) <= 0) { + if (tcmdPtr->refCount-- <= 1) { ckfree(tcmdPtr); } break; @@ -1130,7 +1130,7 @@ Tcl_TraceCommand( /* * Bug 3484621: up the interp's epoch if this is a BC'ed command */ - + if ((cmdPtr->compileProc != NULL) && !(cmdPtr->flags & CMD_HAS_EXEC_TRACES)){ Interp *iPtr = (Interp *) interp; iPtr->compileEpoch++; @@ -1138,7 +1138,7 @@ Tcl_TraceCommand( cmdPtr->flags |= CMD_HAS_EXEC_TRACES; } - + return TCL_OK; } @@ -1223,7 +1223,7 @@ Tcl_UntraceCommand( } tracePtr->flags = 0; - if ((--tracePtr->refCount) <= 0) { + if (tracePtr->refCount-- <= 1) { ckfree(tracePtr); } @@ -1245,7 +1245,7 @@ Tcl_UntraceCommand( /* * Bug 3484621: up the interp's epoch if this is a BC'ed command */ - + if (cmdPtr->compileProc != NULL) { Interp *iPtr = (Interp *) interp; iPtr->compileEpoch++; @@ -1382,7 +1382,7 @@ TraceCommandProc( Tcl_RestoreInterpState(interp, state); tcmdPtr->refCount--; } - if ((--tcmdPtr->refCount) <= 0) { + if (tcmdPtr->refCount-- <= 1) { ckfree(tcmdPtr); } } @@ -1474,7 +1474,7 @@ TclCheckExecutionTraces( } traceCode = TraceExecutionProc(tcmdPtr, interp, curLevel, command, (Tcl_Command) cmdPtr, objc, objv); - if ((--tcmdPtr->refCount) <= 0) { + if (tcmdPtr->refCount-- <= 1) { ckfree(tcmdPtr); } } @@ -1721,7 +1721,7 @@ CommandObjTraceDeleted( { TraceCommandInfo *tcmdPtr = clientData; - if ((--tcmdPtr->refCount) <= 0) { + if (tcmdPtr->refCount-- <= 1) { ckfree(tcmdPtr); } } @@ -1936,7 +1936,7 @@ TraceExecutionProc( } } if (call) { - if ((--tcmdPtr->refCount) <= 0) { + if (tcmdPtr->refCount-- <= 1) { ckfree(tcmdPtr); } } -- cgit v0.12