Re: [PATCH v2 3/4] config: make parsing stack struct independent from actual data source
- From
Jeff King <peff@peff.net>
- Date
- Mar 12, 2013, 19:27 UTC
- Message-ID
- <20130312192737.GF17099@sigill.intra.peff.net>
- In-Reply-To
- <20130312162734.GB4704@sandbox-ub.fritz.box>
On Tue, Mar 12, 2013 at 05:27:35PM +0100, Heiko Voigt wrote:
Show 14 quoted lines
> > Would a union be more appropriate here? We do not ever have to pass it > > directly as a parameter, since we pass the "struct config_source" to the > > method functions. > > > > It's still possible to screw up using a union, but it's slightly harder > > than screwing up using a void pointer. And I do not think we need the > > run-time flexibility offered by the void pointer in this case. > > No we do not need the void pointer flexibility. But that means every new > source would need to add to this union. Junio complained about that fact > when I first added the extra members directly to the struct. A union > does not waste that much space and we get some seperation using the > union members. Since this struct is local only I think that should be > ok.
Right. I think that is not a big deal, as we are not exposing this struct outside of the config.c; any additions would need to add a new git_config_from_foo function, anyway.
-Peff