Re: confusing typedefs in jsonfuncs.c
От | Tom Lane |
---|---|
Тема | Re: confusing typedefs in jsonfuncs.c |
Дата | |
Msg-id | 555.1374197684@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | confusing typedefs in jsonfuncs.c (Peter Eisentraut <peter_e@gmx.net>) |
Ответы |
Re: confusing typedefs in jsonfuncs.c
|
Список | pgsql-hackers |
Peter Eisentraut <peter_e@gmx.net> writes: > The new jsonfuncs.c has some confusing typedef scheme. For example, it > has a bunch of definitions like this: > typedef struct getState > { > ... > } getState, *GetState; > So GetState is a pointer to getState. I have never seen that kind of > convention before. Yeah, this is randomly different from everywhere else in PG. The more usual convention if you want typedefs for both the struct and the pointer type is that the pointer type is FooBar and the struct type is FooBarData. This way seems seriously typo-prone. > I think a more typical PostgreSQL code convention is to use capitalized > camelcase for structs, and use explicit pointers for pointers. I have > attached a patch that cleans this up, in my opinion. That way is fine with me too. If you commit this, please hit 9.3 as well, so that we don't have back-patching issues. regards, tom lane
В списке pgsql-hackers по дате отправления: