Re: [dwm] using bitaray for tags (PATCH)

From: Enno \ <gottox_AT_gmail.com>
Date: Wed, 21 May 2008 10:49:16 +0200

Hi!

2008/5/21, Szabolcs Nagy <nszabolcs_AT_gmail.com>:
> in config.h referencing tags has changed in rules but not in keys.
Yes, arg has discussed yesterday if it's possible to change const char
*arg to void *arg. if this works, i'll change the key behavior too.
> the (1 << tagnum) in rules is a bit nasty
> it is probably nicer to do the shifting in setup();
you mean in applyrules? - No I don't think so. It adds much more
flexibility. You can define bitmasks as 0b10001 to tag a client to the
first and the fifth tag or you can use ~0 to make it "sticky".
> instead of
> i < LENGTH(tags) && i < sizeof(int) * 8;
> what about checking once
> if(LENGTH(tags) > sizeof(int) * CHAR_BIT)
> eprint("Maximum number of tags: %d\n", sizeof(int) * CHAR_BIT);
> in setup();
The problem about this is it denies users from using one config.h with
many tags on different architectures. Furthermore I wouldn't check
this at runtime but at compiletime. (maybe we can use "#warning" as
compromise)
Anyway, the CHAR_BIT constant is a good idea.

Thanks!

-- 
http://www.gnuffy.org - Real Community Distro
http://www.gnuffy.org/index.php/GnuEm - Gnuffy on Ipaq (Codename Peggy)
Received on Wed May 21 2008 - 10:49:17 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:43:02 UTC