summaryrefslogtreecommitdiffstats
path: root/generic/tclInt.h
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2007-04-18 22:49:48 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2007-04-18 22:49:48 (GMT)
commitf983cd5f117adbc96f5eedfd8c98a5677519760a (patch)
tree793076029bc1fdd959c78a1c5aa1883c233cbe68 /generic/tclInt.h
parent3f66d3d7fe0596082573ea01a6b5027b6adb870f (diff)
downloadtcl-f983cd5f117adbc96f5eedfd8c98a5677519760a.zip
tcl-f983cd5f117adbc96f5eedfd8c98a5677519760a.tar.gz
tcl-f983cd5f117adbc96f5eedfd8c98a5677519760a.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/tclInt.h')
-rw-r--r--generic/tclInt.h13
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); \
} \
}