Re: [HACKERS] pg_bsd_indent - improvements around offsetof and sizeof

2016-08-22 Thread Alvaro Herrera
Bruce Momjian wrote: > On Tue, Aug 16, 2016 at 11:47:09AM -0700, Andres Freund wrote: > > On 2016-08-15 18:09:02 +, Piotr Stefaniak wrote: > > > There are more fixes I intend to do, of which the most relevant for > > > Postgres are: > > > 1) fixing "function pointer typedef formatting" > > >

Re: [HACKERS] pg_bsd_indent - improvements around offsetof and sizeof

2016-08-22 Thread Bruce Momjian
On Tue, Aug 16, 2016 at 11:47:09AM -0700, Andres Freund wrote: > On 2016-08-15 18:09:02 +, Piotr Stefaniak wrote: > > There are more fixes I intend to do, of which the most relevant for > > Postgres are: > > 1) fixing "function pointer typedef formatting" > > This alone would warrant a

Re: [HACKERS] pg_bsd_indent - improvements around offsetof and sizeof

2016-08-16 Thread Andres Freund
On 2016-08-15 18:09:02 +, Piotr Stefaniak wrote: > There are more fixes I intend to do, of which the most relevant for > Postgres are: > 1) fixing "function pointer typedef formatting" This alone would warrant a bottle of something rather expensive. -- Sent via pgsql-hackers mailing list

Re: [HACKERS] pg_bsd_indent - improvements around offsetof and sizeof

2016-08-15 Thread Piotr Stefaniak
On 2016-05-25 21:13, Tom Lane wrote: > Robert Haas writes: >> On Sun, May 22, 2016 at 4:16 PM, Piotr Stefaniak >> wrote: >>> I think I've managed to improve pg_bsd_indent's handling of two types of >>> cases. > >> Wow, that seems pretty great.

Re: [HACKERS] pg_bsd_indent - improvements around offsetof and sizeof

2016-06-26 Thread Piotr Stefaniak
On 2016-05-27 08:13, Piotr Stefaniak wrote: I'm trying to see if FreeBSD indent can successfully do pg_bsd_indent's job. So far I had to fix one thing, which is not adding a space after a cast operator, for which they added no option to turn it off. Currently I'm fighting one other bug, but I

Re: [HACKERS] pg_bsd_indent - improvements around offsetof and sizeof

2016-06-21 Thread Bruce Momjian
On Tue, Jun 21, 2016 at 03:22:09PM -0400, Tom Lane wrote: > Bruce Momjian writes: > > On Wed, May 25, 2016 at 03:13:23PM -0400, Tom Lane wrote: > >> ... If we make a change like this, I think we should > >> *strongly* consider reindenting all the live back branches along with >

Re: [HACKERS] pg_bsd_indent - improvements around offsetof and sizeof

2016-06-21 Thread Tom Lane
Bruce Momjian writes: > On Wed, May 25, 2016 at 03:13:23PM -0400, Tom Lane wrote: >> ... If we make a change like this, I think we should >> *strongly* consider reindenting all the live back branches along with >> HEAD. > Uh, we have been running on back branches anytime the

Re: [HACKERS] pg_bsd_indent - improvements around offsetof and sizeof

2016-06-21 Thread Bruce Momjian
On Wed, May 25, 2016 at 03:13:23PM -0400, Tom Lane wrote: > Robert Haas writes: > > On Sun, May 22, 2016 at 4:16 PM, Piotr Stefaniak > > wrote: > >> I think I've managed to improve pg_bsd_indent's handling of two types of > >> cases. > > >

Re: [HACKERS] pg_bsd_indent - improvements around offsetof and sizeof

2016-05-27 Thread Piotr Stefaniak
On 2016-05-25 21:13, Tom Lane wrote: Assuming this patch withstands more careful review, we will need to think about project policy for how/when to apply such fixes. I discovered yesterday that Bruce Evans had done the fix for sizeof in their fork of indent(1) in 2004 (r125623 [1]). The core

Re: [HACKERS] pg_bsd_indent - improvements around offsetof and sizeof

2016-05-25 Thread Tom Lane
Andres Freund writes: > Might be worthwhile to look into 'uncrustify'. It's fairly > customizable. A colleague at citus made all citus code be formatted by > it; and while there's some minor details I dislike, it seems to work > ok. Hmm ... a quick look says that it's been

Re: [HACKERS] pg_bsd_indent - improvements around offsetof and sizeof

2016-05-25 Thread Tom Lane
Alvaro Herrera writes: > Andres Freund wrote: >> On 2016-05-25 22:01:53 +0200, Piotr Stefaniak wrote: >>> On 2016-05-25 21:13, Tom Lane wrote: I'd love to see a fix for its brain damage around function pointer typedef formatting, too. >>> Show me a few

Re: [HACKERS] pg_bsd_indent - improvements around offsetof and sizeof

2016-05-25 Thread Andres Freund
On 2016-05-25 18:17:51 -0400, Alvaro Herrera wrote: > Andres Freund wrote: > > On 2016-05-25 22:01:53 +0200, Piotr Stefaniak wrote: > > FWIW, I looked at using clang-format at some point, and it looked like > > it'd be a number of additional options to make it work for our case > > without

Re: [HACKERS] pg_bsd_indent - improvements around offsetof and sizeof

2016-05-25 Thread Alvaro Herrera
Andres Freund wrote: > On 2016-05-25 22:01:53 +0200, Piotr Stefaniak wrote: > > On 2016-05-25 21:13, Tom Lane wrote: > > > I'd love to see a fix for its brain damage around function pointer > > > typedef formatting, too. > > > > Show me a few examples and I'll look into it. See

Re: [HACKERS] pg_bsd_indent - improvements around offsetof and sizeof

2016-05-25 Thread Andres Freund
On 2016-05-25 22:01:53 +0200, Piotr Stefaniak wrote: > On 2016-05-25 21:13, Tom Lane wrote: > > I'd love to see a fix for its brain damage around function pointer typedef > > formatting, too. > > Show me a few examples and I'll look into it. > > > I'm excited about this too, not least because

Re: [HACKERS] pg_bsd_indent - improvements around offsetof and sizeof

2016-05-25 Thread Piotr Stefaniak
On 2016-05-25 21:13, Tom Lane wrote: I'd love to see a fix for its brain damage around function pointer typedef formatting, too. Show me a few examples and I'll look into it. I'm excited about this too, not least because it suggests that maybe bsdindent isn't quite as opaque as it appears.

Re: [HACKERS] pg_bsd_indent - improvements around offsetof and sizeof

2016-05-25 Thread Tom Lane
Robert Haas writes: > On Sun, May 22, 2016 at 4:16 PM, Piotr Stefaniak > wrote: >> I think I've managed to improve pg_bsd_indent's handling of two types of >> cases. > Wow, that seems pretty great. I haven't scrutinized your changes to >

Re: [HACKERS] pg_bsd_indent - improvements around offsetof and sizeof

2016-05-25 Thread Robert Haas
On Sun, May 22, 2016 at 4:16 PM, Piotr Stefaniak wrote: > I think I've managed to improve pg_bsd_indent's handling of two types of > cases. Wow, that seems pretty great. I haven't scrutinized your changes to pg_bsd_indent, but effect_on_pg.diff looks like a large

[HACKERS] pg_bsd_indent - improvements around offsetof and sizeof

2016-05-22 Thread Piotr Stefaniak
Hello, I think I've managed to improve pg_bsd_indent's handling of two types of cases. The first are like in this example: - hashp = (HTAB *) DynaHashAlloc(sizeof(HTAB) + strlen(tabname) +1); + hashp = (HTAB *) DynaHashAlloc(sizeof(HTAB) + strlen(tabname) + 1); Pristine