summaryrefslogtreecommitdiff
path: root/src/pl
diff options
context:
space:
mode:
authorTom Lane2017-06-21 18:39:04 +0000
committerTom Lane2017-06-21 18:39:04 +0000
commite3860ffa4dd0dad0dd9eea4be9cc1412373a8c89 (patch)
tree8dc7df95c340803546152724fbc17aee4b8527f9 /src/pl
parent8ff6d4ec7840b0af56f1207073f44b7f2afae96d (diff)
Initial pgindent run with pg_bsd_indent version 2.0.
The new indent version includes numerous fixes thanks to Piotr Stefaniak. The main changes visible in this commit are: * Nicer formatting of function-pointer declarations. * No longer unexpectedly removes spaces in expressions using casts, sizeof, or offsetof. * No longer wants to add a space in "struct structname *varname", as well as some similar cases for const- or volatile-qualified pointers. * Declarations using PG_USED_FOR_ASSERTS_ONLY are formatted more nicely. * Fixes bug where comments following declarations were sometimes placed with no space separating them from the code. * Fixes some odd decisions for comments following case labels. * Fixes some cases where comments following code were indented to less than the expected column 33. On the less good side, it now tends to put more whitespace around typedef names that are not listed in typedefs.list. This might encourage us to put more effort into typedef name collection; it's not really a bug in indent itself. There are more changes coming after this round, having to do with comment indentation and alignment of lines appearing within parentheses. I wanted to limit the size of the diffs to something that could be reviewed without one's eyes completely glazing over, so it seemed better to split up the changes as much as practical. Discussion: https://postgr.es/m/E1dAmxK-0006EE-1r@gemulon.postgresql.org Discussion: https://postgr.es/m/30527.1495162840@sss.pgh.pa.us
Diffstat (limited to 'src/pl')
-rw-r--r--src/pl/plperl/plperl.c2
-rw-r--r--src/pl/plpgsql/src/pl_comp.c4
-rw-r--r--src/pl/plpgsql/src/pl_exec.c2
-rw-r--r--src/pl/plpgsql/src/pl_funcs.c2
-rw-r--r--src/pl/plpgsql/src/plpgsql.h2
-rw-r--r--src/pl/plpython/plpy_exec.c2
-rw-r--r--src/pl/tcl/pltcl.c2
7 files changed, 8 insertions, 8 deletions
diff --git a/src/pl/plperl/plperl.c b/src/pl/plperl/plperl.c
index ce72dd488e7..5b0d5aa8e83 100644
--- a/src/pl/plperl/plperl.c
+++ b/src/pl/plperl/plperl.c
@@ -2443,7 +2443,7 @@ plperl_trigger_handler(PG_FUNCTION_ARGS)
HV *hvTD;
ErrorContextCallback pl_error_context;
TriggerData *tdata;
- int rc PG_USED_FOR_ASSERTS_ONLY;
+ int rc PG_USED_FOR_ASSERTS_ONLY;
/* Connect to SPI manager */
if (SPI_connect() != SPI_OK_CONNECT)
diff --git a/src/pl/plpgsql/src/pl_comp.c b/src/pl/plpgsql/src/pl_comp.c
index cc093556e5b..aeb8e4dfe72 100644
--- a/src/pl/plpgsql/src/pl_comp.c
+++ b/src/pl/plpgsql/src/pl_comp.c
@@ -501,7 +501,7 @@ do_compile(FunctionCallInfo fcinfo,
rettypeid = INT4ARRAYOID;
else if (rettypeid == ANYRANGEOID)
rettypeid = INT4RANGEOID;
- else /* ANYELEMENT or ANYNONARRAY */
+ else /* ANYELEMENT or ANYNONARRAY */
rettypeid = INT4OID;
/* XXX what could we use for ANYENUM? */
}
@@ -2520,7 +2520,7 @@ plpgsql_resolve_polymorphic_argtypes(int numargs,
{
case ANYELEMENTOID:
case ANYNONARRAYOID:
- case ANYENUMOID: /* XXX dubious */
+ case ANYENUMOID: /* XXX dubious */
argtypes[i] = INT4OID;
break;
case ANYARRAYOID:
diff --git a/src/pl/plpgsql/src/pl_exec.c b/src/pl/plpgsql/src/pl_exec.c
index 7a40c99ce03..da86702bdd6 100644
--- a/src/pl/plpgsql/src/pl_exec.c
+++ b/src/pl/plpgsql/src/pl_exec.c
@@ -5095,7 +5095,7 @@ plpgsql_exec_get_datum_type_info(PLpgSQL_execstate *estate,
*typmod = -1;
if (fno > 0)
*collation = rec->tupdesc->attrs[fno - 1]->attcollation;
- else /* no system column types have collation */
+ else /* no system column types have collation */
*collation = InvalidOid;
break;
}
diff --git a/src/pl/plpgsql/src/pl_funcs.c b/src/pl/plpgsql/src/pl_funcs.c
index 93f89814b34..cd44a8e9a3a 100644
--- a/src/pl/plpgsql/src/pl_funcs.c
+++ b/src/pl/plpgsql/src/pl_funcs.c
@@ -99,7 +99,7 @@ plpgsql_ns_additem(PLpgSQL_nsitem_type itemtype, int itemno, const char *name)
/* first item added must be a label */
Assert(ns_top != NULL || itemtype == PLPGSQL_NSTYPE_LABEL);
- nse = palloc(offsetof(PLpgSQL_nsitem, name) +strlen(name) + 1);
+ nse = palloc(offsetof(PLpgSQL_nsitem, name) + strlen(name) + 1);
nse->itemtype = itemtype;
nse->itemno = itemno;
nse->prev = ns_top;
diff --git a/src/pl/plpgsql/src/plpgsql.h b/src/pl/plpgsql/src/plpgsql.h
index 43e7eb317b7..0f790ee536d 100644
--- a/src/pl/plpgsql/src/plpgsql.h
+++ b/src/pl/plpgsql/src/plpgsql.h
@@ -977,7 +977,7 @@ typedef struct PLpgSQL_plugin
/* Function pointers set by PL/pgSQL itself */
void (*error_callback) (void *arg);
void (*assign_expr) (PLpgSQL_execstate *estate, PLpgSQL_datum *target,
- PLpgSQL_expr *expr);
+ PLpgSQL_expr *expr);
} PLpgSQL_plugin;
/*
diff --git a/src/pl/plpython/plpy_exec.c b/src/pl/plpython/plpy_exec.c
index aa4d68664f4..a1ecc6d2a46 100644
--- a/src/pl/plpython/plpy_exec.c
+++ b/src/pl/plpython/plpy_exec.c
@@ -345,7 +345,7 @@ PLy_exec_trigger(FunctionCallInfo fcinfo, PLyProcedure *proc)
PG_TRY();
{
- int rc PG_USED_FOR_ASSERTS_ONLY;
+ int rc PG_USED_FOR_ASSERTS_ONLY;
rc = SPI_register_trigger_data(tdata);
Assert(rc >= 0);
diff --git a/src/pl/tcl/pltcl.c b/src/pl/tcl/pltcl.c
index ae9ba80cf79..89bb46fb4a9 100644
--- a/src/pl/tcl/pltcl.c
+++ b/src/pl/tcl/pltcl.c
@@ -1039,7 +1039,7 @@ pltcl_trigger_handler(PG_FUNCTION_ARGS, pltcl_call_state *call_state,
const char *result;
int result_Objc;
Tcl_Obj **result_Objv;
- int rc PG_USED_FOR_ASSERTS_ONLY;
+ int rc PG_USED_FOR_ASSERTS_ONLY;
call_state->trigdata = trigdata;