Re: [dwm] idxoftag

From: Szabolcs Nagy <nszabolcs_AT_gmail.com>
Date: Mon, 22 Oct 2007 12:03:50 +0200

On 10/22/07, Stefano Soffia <stefano.soffia_AT_studenti.unipr.it> wrote:
> On Mon, Oct 22, 2007 at 10:26:38AM +0200, Enno Gottox Boland wrote:
> > This heavy usage of defines and macros makes the sourcecode more
> > weird. ntags for example should be renamed to NTAGS to make it more
> > clear that it's a macro. Same at index_to_tag. But nevertheless I
> > dislike this solution. It fucks up the source.
>
> I know that the solution provided by this patch is quite dirty. However, my
> intention was to show that the use of idxoftag can be avoided; certainly
> exist cleaner solutions.

i'm not happy about pointer <--> int conversions either

you could do

#define index_to_tag(i) (tags + i)
#define tag_to_index(t) (t - tags)

as well and define every function with a void * argument
(in this case you don't need these macros or ugly casts)
Received on Mon Oct 22 2007 - 12:03:52 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:01:33 UTC