Re: [dwm] ntags initialization

2007-10-10 Thread Szabolcs Nagy
On 10/10/07, Anselm R. Garbe <[EMAIL PROTECTED]> wrote: > Client struct looks like before. However I kept the static > initialization of ntags, seltags and the newly introduced > prevtags. This means that third-party patches may access any > variable except the latter ones (actually I see no reason

Re: [dwm] ntags initialization

2007-10-10 Thread Anselm R. Garbe
On Wed, Oct 10, 2007 at 05:35:16PM +0200, Szabolcs Nagy wrote: > On 10/10/07, Anselm R. Garbe <[EMAIL PROTECTED]> wrote: > > One question to this again. Actually I can't find any official > > reference why this should work in the C89 standard, call me > > blind or whatever. In C99 this definately w

Re: [dwm] ntags initialization

2007-10-10 Thread Szabolcs Nagy
On 10/10/07, Anselm R. Garbe <[EMAIL PROTECTED]> wrote: > One question to this again. Actually I can't find any official > reference why this should work in the C89 standard, call me > blind or whatever. In C99 this definately works. > > Do you have a pointer to confirm that this works with C89 as

Re: [dwm] ntags initialization

2007-10-10 Thread Anselm R. Garbe
On Sat, Oct 06, 2007 at 11:29:30AM -0300, Brendan MacDonell wrote: > On Fri, Oct 05, 2007 at 23:33:44 CEST, Anselm R. Garbe wrote: > > You miss that seltags and Client->tags are both globally defined > > in the same context as the tags definition. Afaik you can't > > evaluate the sizeof operator an

Re: [dwm] ntags initialization

2007-10-06 Thread Anselm R. Garbe
On Sat, Oct 06, 2007 at 11:29:30AM -0300, Brendan MacDonell wrote: > On Fri, Oct 05, 2007 at 23:33:44 CEST, Anselm R. Garbe wrote: > > You miss that seltags and Client->tags are both globally defined > > in the same context as the tags definition. Afaik you can't > > evaluate the sizeof operator an

Re: [dwm] ntags initialization

2007-10-06 Thread Stefano Soffia
On Fri, Oct 05, 2007 at 11:33:44PM +0200, Anselm R. Garbe wrote: > > and, as a side effect, knowing statically `ntags' allows to define > > `seltags' as an array without using > > `emallocz()'. > > What I am missing? > You miss that seltags and Client->tags are both globally defined > in the same

Re: [dwm] ntags initialization

2007-10-06 Thread Brendan MacDonell
On Fri, Oct 05, 2007 at 23:33:44 CEST, Anselm R. Garbe wrote: > You miss that seltags and Client->tags are both globally defined > in the same context as the tags definition. Afaik you can't > evaluate the sizeof operator and you can't perform a division > operation in a non-functional scope, so I

Re: [dwm] ntags initialization

2007-10-05 Thread Anselm R. Garbe
On Thu, Oct 04, 2007 at 08:17:51AM +0100, [EMAIL PROTECTED] wrote: > 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 st

[dwm] ntags initialization

2007-10-04 Thread [EMAIL PROTECTED]
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; ta