[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:

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

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

  ntags = sizeof tags / sizeof tags[0] -

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

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