diff options
author | mig <mig> | 2011-03-19 17:23:05 (GMT) |
---|---|---|
committer | mig <mig> | 2011-03-19 17:23:05 (GMT) |
commit | 7594338af93c41ff22ddc17d9172d97b4a376d6c (patch) | |
tree | 96f31cc0d71c13b5f76ac90ce01ffe1f7a929f9d | |
parent | c2c2d39a30718bca7a5243506be96f9a59a84322 (diff) | |
download | tcl-7594338af93c41ff22ddc17d9172d97b4a376d6c.zip tcl-7594338af93c41ff22ddc17d9172d97b4a376d6c.tar.gz tcl-7594338af93c41ff22ddc17d9172d97b4a376d6c.tar.bz2 |
tclListObj.c: simplify macros
-rw-r--r-- | generic/tclListObj.c | 11 |
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( |