diff options
| author | Miguel Sofer <miguel.sofer@gmail.com> | 2007-04-18 22:49:48 (GMT) | 
|---|---|---|
| committer | Miguel Sofer <miguel.sofer@gmail.com> | 2007-04-18 22:49:48 (GMT) | 
| commit | d8fc0e1ffa2ca2c7faae32f22d81d4e5be3b4ebc (patch) | |
| tree | 793076029bc1fdd959c78a1c5aa1883c233cbe68 /generic | |
| parent | 9ca09a32abaa6d913d8fff4a8f66ab512141f0d8 (diff) | |
| download | tcl-d8fc0e1ffa2ca2c7faae32f22d81d4e5be3b4ebc.zip tcl-d8fc0e1ffa2ca2c7faae32f22d81d4e5be3b4ebc.tar.gz tcl-d8fc0e1ffa2ca2c7faae32f22d81d4e5be3b4ebc.tar.bz2  | |
	* generic/tclInt.h (TclDecrRefCount): change the order of the
	branches, use empty 'if ; else' to handle use in unbraced outer
	if/else conditions (as already done in tcl.h)
Diffstat (limited to 'generic')
| -rw-r--r-- | generic/tclInt.h | 13 | 
1 files changed, 7 insertions, 6 deletions
diff --git a/generic/tclInt.h b/generic/tclInt.h index 140a67c..df2ea41 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -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: tclInt.h,v 1.305 2007/04/10 14:47:15 dkf Exp $ + * RCS: @(#) $Id: tclInt.h,v 1.306 2007/04/18 22:49:48 msofer Exp $   */  #ifndef _TCLINT @@ -2954,14 +2954,13 @@ MODULE_SCOPE void	TclInvalidateNsPath(Namespace *nsPtr);  /*   * Invalidate the string rep first so we can use the bytes value for our   * pointer chain, and signal an obj deletion (as opposed to shimmering) with - * 'length == -1' + * 'length == -1'. + * Use empty 'if ; else' to handle use in unbraced outer if/else conditions   */  # define TclDecrRefCount(objPtr) \ -    if (--(objPtr)->refCount <= 0) { \ -	if ((objPtr)->typePtr && (objPtr)->typePtr->freeIntRepProc) { \ -	    TclFreeObj(objPtr); \ -	} else { \ +    if (--(objPtr)->refCount > 0) ; else { \ +	if (!(objPtr)->typePtr || !(objPtr)->typePtr->freeIntRepProc) { \    	    if ((objPtr)->bytes \  	            && ((objPtr)->bytes != tclEmptyStringRep)) { \  	        ckfree((char *) (objPtr)->bytes); \ @@ -2969,6 +2968,8 @@ MODULE_SCOPE void	TclInvalidateNsPath(Namespace *nsPtr);              (objPtr)->length = -1; \  	    TclFreeObjStorage(objPtr); \  	    TclIncrObjsFreed(); \ +	} else { \ +	    TclFreeObj(objPtr); \  	} \      }  | 
