Re: [hackers] [dwm] [PATCH] decouple color-scheme count from dwm.c
Anselm R Garbe wrote:
> On 27 October 2016 at 12:34, Markus Teich <markus.teich_AT_stusta.mhn.de> wrote:
> > Anselm R Garbe wrote:
> >> Why wouldn't dwm just work fine without this change, if editing config.h
> >> would incorporate assigning SchemeLast with a value instead? Then all the
> >> nasty heap allocation would become unnecessary.
> >
> > that would be the other option I considered. I choose the heap one to reduce
> > config.h complexity. You would have to make sure SchemeLast and the size of
> > `colors` stay the same manually which is more error prone than letting the
> > code figure it out. However if you think that is a better option, I'd adapt
> > the patch accordingly.
>
> I prefer requiring SchemeLast = N.
Heyho Anselm,
sorry I forgot to update that one last week. Do you prefer SchemeLast as enum
element (The whole enum definition has to move to config.def.h) or as `#define`?
Either way the declaration of the `scheme` array has to be moved below the
config.h include which breaks the current structure of `dwm.c`. I really prefer
the ecalloc version which at least does not fail during runtime on OOM, because
it is only called in `setup()`.
--Markus
Received on Mon Oct 31 2016 - 13:18:10 CET
This archive was generated by hypermail 2.3.0
: Mon Oct 31 2016 - 13:24:15 CET