Re: [dwm] [patch] mwfact per tag

From: Evan Gates <evan.gates_AT_gmail.com>
Date: Wed, 5 Sep 2007 21:00:19 -0400

Ok, second try. I declared mwfact in main.c and as extern in dwm.h so
that I can use it in tile.c and I used emallocz and initialized it in
the initlayouts() function in screen.c which is called from the
setup() function in main.c (seemed to be the most appropriate place).

Hope this is a better solution. I'm still learning.

Thanks for your help,
-Evan

On 9/5/07, y i y u s <yiyu.jgl_AT_gmail.com> wrote:
> > I wanted to use ntags to define the size of
> > mwfact[], but can't due to compiler errors. ...
>
> You can't make double mwfact[ntags] because ntags is a variable, what
> you can do is:
>
> double *mwfact;
> mwfact = emalloc(ntags * sizeof(double));
>
> emalloc is just a wrapper on the standard malloc to print an error
> message and exit if something goes wrong.
> And about initialization, why not doing it in the setup function in
> main.c where everything is initialized?
> I hope this tips were useful to you, regards,
>
>
> --
>
>
> - yiyus || JGL .
>
>

Received on Thu Sep 06 2007 - 03:00:21 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 14:52:33 UTC