Re: [HACKERS] portability of "designated initializers"

2008-12-10 Thread Tom Lane
Alvaro Herrera <[EMAIL PROTECTED]> writes: > Do we need a struct, or can we get away with storing the values directly > in RelationData? Something like this: The intention behind having a separate struct was that there could possibly be different sets of reloptions for different types of relation

Re: [HACKERS] portability of "designated initializers"

2008-12-10 Thread Alvaro Herrera
Tom Lane wrote: > Alvaro Herrera <[EMAIL PROTECTED]> writes: > > I've already modified your patch a bit ... please send your updated > > patch so I can merge it into mine. However, my changes were also > > relatively minor. Since Tom wants it to be entirely rewritten then > > maybe merging minor

Re: [HACKERS] portability of "designated initializers"

2008-12-05 Thread Alvaro Herrera
Euler Taveira de Oliveira wrote: > Alvaro Herrera escreveu: > > > I've already modified your patch a bit ... please send your updated > > patch so I can merge it into mine. However, my changes were also > > relatively minor. Since Tom wants it to be entirely rewritten then > > maybe merging mino

Re: [HACKERS] portability of "designated initializers"

2008-12-04 Thread Euler Taveira de Oliveira
Alvaro Herrera escreveu: > I've already modified your patch a bit ... please send your updated > patch so I can merge it into mine. However, my changes were also > relatively minor. Since Tom wants it to be entirely rewritten then > maybe merging minor fixes to it is a waste of time ... > Since

Re: [HACKERS] portability of "designated initializers"

2008-11-23 Thread Tom Lane
I wrote: > The thing I'm complaining about is having dropped the intermediate > struct that represents the fully decoded set of reloptions. After looking at the patch a bit more I have a couple of other comments: * I disagree with changing the argument of the RelationGetXXX macros from Relation t

Re: [HACKERS] portability of "designated initializers"

2008-11-22 Thread Tom Lane
Alvaro Herrera <[EMAIL PROTECTED]> writes: > I've already modified your patch a bit ... please send your updated > patch so I can merge it into mine. However, my changes were also > relatively minor. Since Tom wants it to be entirely rewritten then > maybe merging minor fixes to it is a waste of

Re: [HACKERS] portability of "designated initializers"

2008-11-22 Thread Alvaro Herrera
Euler Taveira de Oliveira wrote: > Tom Lane escreveu: > > > Hmm ... I'd not looked at that patch before, but now that I have I think > > it's gone pretty seriously off on the overdesigned-and-inefficient end > > of the spectrum. Turning RelationGetFillFactor and friends from simple > > macros int

Re: [HACKERS] portability of "designated initializers"

2008-11-22 Thread Euler Taveira de Oliveira
Tom Lane escreveu: > Hmm ... I'd not looked at that patch before, but now that I have I think > it's gone pretty seriously off on the overdesigned-and-inefficient end > of the spectrum. Turning RelationGetFillFactor and friends from simple > macros into functions that are probably *at least* a th

Re: [HACKERS] portability of "designated initializers"

2008-11-22 Thread Euler Taveira de Oliveira
Alvaro Herrera escreveu: > The reloptions patch uses three arrays, one for each type of option > (bool, int, float). I'm wondering if we could use a single array with > all options, and a union containing the values. The only problem with > that (AFAICS) is the initialization. > I already tried

Re: [HACKERS] portability of "designated initializers"

2008-11-22 Thread Tom Lane
Alvaro Herrera <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> Where/why do you need to do that? > The reloptions patch uses three arrays, one for each type of option > (bool, int, float). I'm wondering if we could use a single array with > all options, and a union containing the values. The on

Re: [HACKERS] portability of "designated initializers"

2008-11-22 Thread Alvaro Herrera
Tom Lane wrote: > Alvaro Herrera <[EMAIL PROTECTED]> writes: > > I mean something like this: > > Where/why do you need to do that? The reloptions patch uses three arrays, one for each type of option (bool, int, float). I'm wondering if we could use a single array with all options, and a union c

Re: [HACKERS] portability of "designated initializers"

2008-11-22 Thread Tom Lane
Alvaro Herrera <[EMAIL PROTECTED]> writes: > I wonder how portable designated initializers are. As far as I can tell > they were only defined in C99. Can we use them in our source? I'd vote no. We're still targeting ANSI C (eg, no // comments). > I mean something like this: Where/why do you n

[HACKERS] portability of "designated initializers"

2008-11-22 Thread Alvaro Herrera
Hi, I wonder how portable designated initializers are. As far as I can tell they were only defined in C99. Can we use them in our source? If not, is there a way to do this in C89? I mean something like this: typedef struct foo { chartype; union { int iv