mirror of
https://github.com/postgres/postgres.git
synced 2025-06-16 06:01:02 +03:00
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: https://postgr.es/m/CAEepm=0P3FeTXRcU5B2W3jv3PgRVZ-kGUXLGfd42FFhUROO3ug@mail.gmail.com
This commit is contained in:
@ -50,7 +50,7 @@ getlexeme(char *start, char *end, int *len)
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
compare_subnode(ltree_level *t, char *qn, int len, int (*cmpptr) (const char *, const char *, size_t), bool anyend)
|
compare_subnode(ltree_level *t, char *qn, int len, int (*cmpptr) (const char *, const char *, size_t), bool anyend)
|
||||||
{
|
{
|
||||||
char *endt = t->name + t->len;
|
char *endt = t->name + t->len;
|
||||||
char *endq = qn + len;
|
char *endq = qn + len;
|
||||||
|
@ -414,15 +414,15 @@ typedef unsigned long long int uint64;
|
|||||||
|
|
||||||
typedef PG_INT128_TYPE int128
|
typedef PG_INT128_TYPE int128
|
||||||
#if defined(pg_attribute_aligned)
|
#if defined(pg_attribute_aligned)
|
||||||
pg_attribute_aligned(MAXIMUM_ALIGNOF)
|
pg_attribute_aligned(MAXIMUM_ALIGNOF)
|
||||||
#endif
|
#endif
|
||||||
;
|
;
|
||||||
|
|
||||||
typedef unsigned PG_INT128_TYPE uint128
|
typedef unsigned PG_INT128_TYPE uint128
|
||||||
#if defined(pg_attribute_aligned)
|
#if defined(pg_attribute_aligned)
|
||||||
pg_attribute_aligned(MAXIMUM_ALIGNOF)
|
pg_attribute_aligned(MAXIMUM_ALIGNOF)
|
||||||
#endif
|
#endif
|
||||||
;
|
;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
@ -330,7 +330,8 @@ extern void GenerateTypeDependencies(Oid typeObjectId,
|
|||||||
Form_pg_type typeForm,
|
Form_pg_type typeForm,
|
||||||
Node *defaultExpr,
|
Node *defaultExpr,
|
||||||
void *typacl,
|
void *typacl,
|
||||||
char relationKind, /* only for relation rowtypes */
|
char relationKind, /* only for relation
|
||||||
|
* rowtypes */
|
||||||
bool isImplicitArray,
|
bool isImplicitArray,
|
||||||
bool isDependentType,
|
bool isDependentType,
|
||||||
bool rebuild);
|
bool rebuild);
|
||||||
|
@ -41,8 +41,8 @@ typedef struct ItemPointerData
|
|||||||
|
|
||||||
/* If compiler understands packed and aligned pragmas, use those */
|
/* If compiler understands packed and aligned pragmas, use those */
|
||||||
#if defined(pg_attribute_packed) && defined(pg_attribute_aligned)
|
#if defined(pg_attribute_packed) && defined(pg_attribute_aligned)
|
||||||
pg_attribute_packed()
|
pg_attribute_packed()
|
||||||
pg_attribute_aligned(2)
|
pg_attribute_aligned(2)
|
||||||
#endif
|
#endif
|
||||||
ItemPointerData;
|
ItemPointerData;
|
||||||
|
|
||||||
|
@ -567,7 +567,8 @@ extern void PQprintTuples(const PGresult *res,
|
|||||||
FILE *fout, /* output stream */
|
FILE *fout, /* output stream */
|
||||||
int printAttName, /* print attribute names */
|
int printAttName, /* print attribute names */
|
||||||
int terseOutput, /* delimiter bars */
|
int terseOutput, /* delimiter bars */
|
||||||
int width); /* width of column, if 0, use variable width */
|
int width); /* width of column, if 0, use variable
|
||||||
|
* width */
|
||||||
|
|
||||||
|
|
||||||
/* === in fe-lobj.c === */
|
/* === in fe-lobj.c === */
|
||||||
|
@ -12,7 +12,7 @@ use IO::Handle;
|
|||||||
use Getopt::Long;
|
use Getopt::Long;
|
||||||
|
|
||||||
# Update for pg_bsd_indent version
|
# Update for pg_bsd_indent version
|
||||||
my $INDENT_VERSION = "2.0";
|
my $INDENT_VERSION = "2.1";
|
||||||
|
|
||||||
# Our standard indent settings
|
# Our standard indent settings
|
||||||
my $indent_opts =
|
my $indent_opts =
|
||||||
@ -250,22 +250,6 @@ sub post_indent
|
|||||||
# Use a single space before '*' in function return types
|
# Use a single space before '*' in function return types
|
||||||
$source =~ s!^([A-Za-z_]\S*)[ \t]+\*$!$1 *!gm;
|
$source =~ s!^([A-Za-z_]\S*)[ \t]+\*$!$1 *!gm;
|
||||||
|
|
||||||
# Move prototype names to the same line as return type. Useful
|
|
||||||
# for ctags. Indent should do this, but it does not. It formats
|
|
||||||
# prototypes just like real functions.
|
|
||||||
|
|
||||||
my $ident = qr/[a-zA-Z_][a-zA-Z_0-9]*/;
|
|
||||||
my $comment = qr!/\*.*\*/!;
|
|
||||||
|
|
||||||
$source =~ s!
|
|
||||||
(\n$ident[^(\n]*)\n # e.g. static void
|
|
||||||
(
|
|
||||||
$ident\(\n? # func_name(
|
|
||||||
(.*,([ \t]*$comment)?\n)* # args b4 final ln
|
|
||||||
.*\);([ \t]*$comment)?$ # final line
|
|
||||||
)
|
|
||||||
!$1 . (substr($1,-1,1) eq '*' ? '' : ' ') . $2!gmxe;
|
|
||||||
|
|
||||||
return $source;
|
return $source;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user