[dwm] ntags initialization

From: <ste.buffaishere_AT_tin.it>
Date: Thu, 4 Oct 2007 08:17:51 +0100 (GMT+01:00)

Hi, to all.
I am not new to dwm; I am using it since a year or so.
However, I have not delved in the code till now. My
initial goal was
to add a key-binding to allow me to switch to the next/prior tag. I was
brewing the new
feature by looking at the dwm code when I found:

  for
(ntags = 0; tags[ntags]; ntags++);

which, I suppose, is used to
initialize the `ntags' variable. However this point is not clear to me
since
`tags' is statically defined, then it would be possible to
compute statically `ntags' as

  ntags = sizeof tags / sizeof tags[0] -
1;

and, as a side effect, knowing statically `ntags' allows to define
`seltags' as an array without using
`emallocz()'.
What I am missing?

greets,
gingioerge
Received on Thu Oct 04 2007 - 09:18:21 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 14:57:28 UTC