minor fixes after pgindent prototype fixes

Started by Andres Freundover 6 years ago4 messageshackers
Jump to latest
#1Andres Freund
andres@anarazel.de

Hi,

I noticed that after

commit 8255c7a5eeba8f1a38b7a431c04909bde4f5e67d
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2019-05-22 13:04:48 -0400

Phase 2 pgindent run for v12.

Switch to 2.1 version of pg_bsd_indent. This formats
multiline function declarations "correctly", that is with
additional lines of parameter declarations indented to match
where the first line's left parenthesis is.

Discussion: /messages/by-id/CAEepm=0P3FeTXRcU5B2W3jv3PgRVZ-kGUXLGfd42FFhUROO3ug@mail.gmail.com

a few prototypes look odd. It appears to be cases where previously the
odd indentation was put to some use, by indenting parameters less:

extern void DefineCustomBoolVariable(
const char *name,
const char *short_desc,
const char *long_desc,
bool *valueAddr,
bool bootValue,
GucContext context,
int flags,
GucBoolCheckHook check_hook,
GucBoolAssignHook assign_hook,
GucShowHook show_hook);

but now that looks odd:

extern void DefineCustomBoolVariable(
const char *name,
const char *short_desc,
const char *long_desc,
bool *valueAddr,
bool bootValue,
GucContext context,
int flags,
GucBoolCheckHook check_hook,
GucBoolAssignHook assign_hook,
GucShowHook show_hook);

Unless somebody protests I'm going to remove the now pretty useless
looking newline in the cases I can find. I used
ack --type cc --type cpp '^[a-zA-Z_].*\(\n'
to find the ones I did. Not sure that catches everything.

Greetings,

Andres Freund

Attachments:

pgindent-newline.difftext/x-diff; charset=us-asciiDownload+24-46
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andres Freund (#1)
Re: minor fixes after pgindent prototype fixes

Andres Freund <andres@anarazel.de> writes:

a few prototypes look odd. It appears to be cases where previously the
odd indentation was put to some use, by indenting parameters less:
...
but now that looks odd:
extern void DefineCustomBoolVariable(
const char *name,
const char *short_desc,

Unless somebody protests I'm going to remove the now pretty useless
looking newline in the cases I can find.

+1. I think Alvaro was muttering something about doing this,
but you beat him to it.

regards, tom lane

#3Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Tom Lane (#2)
Re: minor fixes after pgindent prototype fixes

On 2019-Jul-28, Tom Lane wrote:

Andres Freund <andres@anarazel.de> writes:

a few prototypes look odd. It appears to be cases where previously the
odd indentation was put to some use, by indenting parameters less:
...
but now that looks odd:
extern void DefineCustomBoolVariable(
const char *name,
const char *short_desc,

Unless somebody protests I'm going to remove the now pretty useless
looking newline in the cases I can find.

+1. I think Alvaro was muttering something about doing this,
but you beat him to it.

No, this is a different issue ... I was talking about function *calls*
ending in parens, and it changed because of the previous round of
pgindent changes, not the last one. The number of affected places was a
lot larger than the patch Andres posted.

--
�lvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

#4Andres Freund
andres@anarazel.de
In reply to: Tom Lane (#2)
Re: minor fixes after pgindent prototype fixes

On 2019-07-28 00:09:51 -0400, Tom Lane wrote:

Andres Freund <andres@anarazel.de> writes:

a few prototypes look odd. It appears to be cases where previously the
odd indentation was put to some use, by indenting parameters less:
...
but now that looks odd:
extern void DefineCustomBoolVariable(
const char *name,
const char *short_desc,

Unless somebody protests I'm going to remove the now pretty useless
looking newline in the cases I can find.

+1. I think Alvaro was muttering something about doing this,
but you beat him to it.

And pushed...

- Andres