summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormig <mig>2011-03-19 17:23:05 (GMT)
committermig <mig>2011-03-19 17:23:05 (GMT)
commit7594338af93c41ff22ddc17d9172d97b4a376d6c (patch)
tree96f31cc0d71c13b5f76ac90ce01ffe1f7a929f9d
parentc2c2d39a30718bca7a5243506be96f9a59a84322 (diff)
downloadtcl-7594338af93c41ff22ddc17d9172d97b4a376d6c.zip
tcl-7594338af93c41ff22ddc17d9172d97b4a376d6c.tar.gz
tcl-7594338af93c41ff22ddc17d9172d97b4a376d6c.tar.bz2
tclListObj.c: simplify macros
-rw-r--r--generic/tclListObj.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/generic/tclListObj.c b/generic/tclListObj.c
index 814acd7..4c1e219 100644
--- a/generic/tclListObj.c
+++ b/generic/tclListObj.c
@@ -67,14 +67,11 @@ const Tcl_ObjType tclListType = {
*----------------------------------------------------------------------
*/
-#define Elems2Size(n) \
- ((n > 1) \
- ? (sizeof(List) + (n-1)*sizeof(Tcl_Obj *)) \
- : (sizeof(List)))
+#define Elems2Size(n) \
+ (sizeof(List) - sizeof(Tcl_Obj *) + n*sizeof(Tcl_Obj *))
+
#define Size2Elems(s) \
- ((s > sizeof(List) + sizeof(Tcl_Obj *) -1) \
- ? (s - sizeof(List) + sizeof(Tcl_Obj *))/sizeof(Tcl_Obj *) \
- : 1)
+ (s - (sizeof(List) - sizeof(Tcl_Obj *)))/sizeof(Tcl_Obj *)
static List *
NewListIntRep(