Re: [dev] [surf] [PATCH] Simplify eval arg handling

From: koneu <koneu93_AT_googlemail.com>
Date: Thu, 23 Apr 2015 21:09:10 +0200

Jochen Sprickerhof wrote:
> * Jason Woofenden <jason_AT_jasonwoof.com> [2015-04-23 14:36]:
> > Both implementations (before and after your patch) pass a char*.
> > But (assuming I'm reading the code correctly) they don't pass the
> > same address.
>
> True, the old one assumes a char** (an array of strings), whereas the
> new one assumes a char*, i.e., string. As evascript() later only accepts
> one char*, it doesn't make sense to put it behind an other layer of
> indirection into the arg->v.
>
> Cheers Jochen

Careful though, arg.v is _not_ the address you want to pass to
evascript(), *(arg.v) is! (or at least that's what the old code suggests)

On a side note, I never really understood why all suckless projects pass
their arg unions by reference. It's a goddamn union, pass it by value!
Received on Thu Apr 23 2015 - 21:09:10 CEST

This archive was generated by hypermail 2.3.0 : Thu Apr 23 2015 - 21:12:08 CEST