summaryrefslogtreecommitdiffstats
path: root/generic/tcl.h
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2007-10-05 17:15:00 (GMT)
committerdgp <dgp@users.sourceforge.net>2007-10-05 17:15:00 (GMT)
commit450ab8007a4bb80ea9ee89e2b79395b0139e2ede (patch)
treef5bfee1844fa3040d4d1b350e47be6437b11096e /generic/tcl.h
parent87b8d6fdaaf7099ddae37ea49806ee1f61ba80dd (diff)
downloadtcl-450ab8007a4bb80ea9ee89e2b79395b0139e2ede.zip
tcl-450ab8007a4bb80ea9ee89e2b79395b0139e2ede.tar.gz
tcl-450ab8007a4bb80ea9ee89e2b79395b0139e2ede.tar.bz2
merge updates from HEAD
Diffstat (limited to 'generic/tcl.h')
-rw-r--r--generic/tcl.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/generic/tcl.h b/generic/tcl.h
index 3cc3084..01840de 100644
--- a/generic/tcl.h
+++ b/generic/tcl.h
@@ -13,7 +13,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tcl.h,v 1.231.2.6 2007/10/02 20:11:48 dgp Exp $
+ * RCS: @(#) $Id: tcl.h,v 1.231.2.7 2007/10/05 17:15:01 dgp Exp $
*/
#ifndef _TCL
@@ -2296,10 +2296,11 @@ EXTERN CONST char *Tcl_PkgInitStubsCheck _ANSI_ARGS_((Tcl_Interp *interp,
# define Tcl_IncrRefCount(objPtr) \
++(objPtr)->refCount
/*
- * Use empty if ; else to handle use in unbraced outer if/else conditions
+ * Use do/while0 idiom for optimum correctness without compiler warnings
+ * http://c2.com/cgi/wiki?TrivialDoWhileLoop
*/
# define Tcl_DecrRefCount(objPtr) \
- if (--(objPtr)->refCount > 0) ; else TclFreeObj(objPtr)
+ do { if (--(objPtr)->refCount <= 0) TclFreeObj(objPtr); } while(0)
# define Tcl_IsShared(objPtr) \
((objPtr)->refCount > 1)
#endif