On Thu, 8 January 2009 18:10:01 +0100, Johannes Berg wrote:
[ Changed the function name above. It really isn't a lookup, it returns
a key, not a value. My fault. ]
Looks correct otherwise. Probably needs a comment that without "tmp" we
would skip a 0 key. Or am I the only one who wants to simplify the code
before spotting this little subtlety?
Not sure what you mean. Something with the same effect as this?
#define btree_for_each_val(head, geo, key, val) \
for (key = btree_last(head, geo), \
val = btree_lookup(head, geo, key); \
val; \
key = btree_get_prev_key(head, geo, key), \
val = btree_lookup(head, geo, key))
Jörn
--
Time? What's that? Time is only worth what you do with it.
-- Theo de Raadt
--