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

From: Premysl Hruby <dfenze_AT_gmail.com>
Date: Wed, 21 May 2008 12:14:27 +0200

On (21/05/08 12:06), markus schnalke wrote:
> To: dwm_AT_suckless.org
> From: markus schnalke <meillo_AT_marmaro.de>
> Subject: Re: [dwm] using bitaray for tags (PATCH)
> Mail-Followup-To: dwm_AT_suckless.org
> User-Agent: Mutt/1.5.13 (2006-08-11)
> Reply-To: dynamic window manager <dwm_AT_suckless.org>
> List-Id: dynamic window manager <dwm.suckless.org>
>
> Premysl Hruby <dfenze_AT_gmail.com> wrote:
> >
> > This is realization of Gottox's proposal discuted on IRC today.
> > It handles tags not as Bool [], but as bit-array saved in int.
>
> I read, that bit-arrays are not very portable between different
> architectures. (It was in "The practice of programming", I think)
>
> Maybe this is not relevant here; also I cannot recall the exact
> explanaition, why one should avoid it.
> Please check if there is any thruth in that statement.
>
>
> Second, I want to mention, that bit-shifts might look really leet, but
> _do_ obfuscate, what could be written much more clearly!
>
> Please stick to _clear_ code.
>
>
> meillo

That's the reason why i wrote it as macros. That bitops can also be
written as inline functions, without any harm to binary size or
performance.

And yes, with bitarrays there are some portability issues. But asside of
limiting number of possible tags, there's no portability downside for
dwm, imho. (it will compile, but maximum of tags is architecture
dependent)

-- 
Premysl "Anydot" Hruby, http://www.redrum.cz/
Received on Wed May 21 2008 - 12:14:33 UTC

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