summaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg
diff options
context:
space:
mode:
authorTom Lane2017-06-21 19:35:54 +0000
committerTom Lane2017-06-21 19:35:54 +0000
commit382ceffdf7f620d8f2d50e451b4167d291ae2348 (patch)
treef558251492f2c6f86e3566f7a82f9d00509122c2 /src/interfaces/ecpg
parentc7b8998ebbf310a156aa38022555a24d98fdbfb4 (diff)
Phase 3 of pgindent updates.
Don't move parenthesized lines to the left, even if that means they flow past the right margin. By default, BSD indent lines up statement continuation lines that are within parentheses so that they start just to the right of the preceding left parenthesis. However, traditionally, if that resulted in the continuation line extending to the right of the desired right margin, then indent would push it left just far enough to not overrun the margin, if it could do so without making the continuation line start to the left of the current statement indent. That makes for a weird mix of indentations unless one has been completely rigid about never violating the 80-column limit. This behavior has been pretty universally panned by Postgres developers. Hence, disable it with indent's new -lpl switch, so that parenthesized lines are always lined up with the preceding left paren. This patch is much less interesting than the first round of indent changes, but also bulkier, so I thought it best to separate the effects. 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/interfaces/ecpg')
-rw-r--r--src/interfaces/ecpg/ecpglib/data.c4
-rw-r--r--src/interfaces/ecpg/ecpglib/error.c8
-rw-r--r--src/interfaces/ecpg/ecpglib/execute.c4
-rw-r--r--src/interfaces/ecpg/ecpglib/extern.h2
-rw-r--r--src/interfaces/ecpg/ecpglib/prepare.c4
-rw-r--r--src/interfaces/ecpg/pgtypeslib/dt_common.c16
-rw-r--r--src/interfaces/ecpg/preproc/descriptor.c2
-rw-r--r--src/interfaces/ecpg/preproc/ecpg.c2
-rw-r--r--src/interfaces/ecpg/preproc/type.c2
9 files changed, 22 insertions, 22 deletions
diff --git a/src/interfaces/ecpg/ecpglib/data.c b/src/interfaces/ecpg/ecpglib/data.c
index b80e1d4c5b1..5dbfded8733 100644
--- a/src/interfaces/ecpg/ecpglib/data.c
+++ b/src/interfaces/ecpg/ecpglib/data.c
@@ -202,7 +202,7 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno,
else
{
ecpg_raise(lineno, ECPG_MISSING_INDICATOR,
- ECPG_SQLSTATE_NULL_VALUE_NO_INDICATOR_PARAMETER,
+ ECPG_SQLSTATE_NULL_VALUE_NO_INDICATOR_PARAMETER,
NULL);
return (false);
}
@@ -580,7 +580,7 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno,
else
{
ecpg_raise(lineno, ECPG_OUT_OF_MEMORY,
- ECPG_SQLSTATE_ECPG_OUT_OF_MEMORY, NULL);
+ ECPG_SQLSTATE_ECPG_OUT_OF_MEMORY, NULL);
return (false);
}
}
diff --git a/src/interfaces/ecpg/ecpglib/error.c b/src/interfaces/ecpg/ecpglib/error.c
index 656b2c420ac..77d6cc2dae7 100644
--- a/src/interfaces/ecpg/ecpglib/error.c
+++ b/src/interfaces/ecpg/ecpglib/error.c
@@ -44,7 +44,7 @@ ecpg_raise(int line, int code, const char *sqlstate, const char *str)
snprintf(sqlca->sqlerrm.sqlerrmc, sizeof(sqlca->sqlerrm.sqlerrmc),
/*------
translator: this string will be truncated at 149 characters expanded. */
- ecpg_gettext("unsupported type \"%s\" on line %d"), str, line);
+ ecpg_gettext("unsupported type \"%s\" on line %d"), str, line);
break;
case ECPG_TOO_MANY_ARGUMENTS:
@@ -106,7 +106,7 @@ ecpg_raise(int line, int code, const char *sqlstate, const char *str)
snprintf(sqlca->sqlerrm.sqlerrmc, sizeof(sqlca->sqlerrm.sqlerrmc),
/*------
translator: this string will be truncated at 149 characters expanded. */
- ecpg_gettext("null value without indicator on line %d"), line);
+ ecpg_gettext("null value without indicator on line %d"), line);
break;
case ECPG_NO_ARRAY:
@@ -162,7 +162,7 @@ ecpg_raise(int line, int code, const char *sqlstate, const char *str)
snprintf(sqlca->sqlerrm.sqlerrmc, sizeof(sqlca->sqlerrm.sqlerrmc),
/*------
translator: this string will be truncated at 149 characters expanded. */
- ecpg_gettext("descriptor index out of range on line %d"), line);
+ ecpg_gettext("descriptor index out of range on line %d"), line);
break;
case ECPG_UNKNOWN_DESCRIPTOR_ITEM:
@@ -190,7 +190,7 @@ ecpg_raise(int line, int code, const char *sqlstate, const char *str)
snprintf(sqlca->sqlerrm.sqlerrmc, sizeof(sqlca->sqlerrm.sqlerrmc),
/*------
translator: this string will be truncated at 149 characters expanded. */
- ecpg_gettext("error in transaction processing on line %d"), line);
+ ecpg_gettext("error in transaction processing on line %d"), line);
break;
case ECPG_CONNECT:
diff --git a/src/interfaces/ecpg/ecpglib/execute.c b/src/interfaces/ecpg/ecpglib/execute.c
index 92b74f432c4..03c55d35930 100644
--- a/src/interfaces/ecpg/ecpglib/execute.c
+++ b/src/interfaces/ecpg/ecpglib/execute.c
@@ -431,7 +431,7 @@ ecpg_store_result(const PGresult *results, int act_field,
int len = strlen(PQgetvalue(results, act_tuple, act_field)) + 1;
if (!ecpg_get_data(results, act_tuple, act_field, stmt->lineno,
- var->type, var->ind_type, current_data_location,
+ var->type, var->ind_type, current_data_location,
var->ind_value, len, 0, var->ind_offset, isarray, stmt->compat, stmt->force_indicator))
status = false;
else
@@ -1389,7 +1389,7 @@ ecpg_build_params(struct statement *stmt)
if (next_insert(stmt->command, position, stmt->questionmarks) >= 0)
{
ecpg_raise(stmt->lineno, ECPG_TOO_FEW_ARGUMENTS,
- ECPG_SQLSTATE_USING_CLAUSE_DOES_NOT_MATCH_PARAMETERS, NULL);
+ ECPG_SQLSTATE_USING_CLAUSE_DOES_NOT_MATCH_PARAMETERS, NULL);
ecpg_free_params(stmt, false);
return false;
}
diff --git a/src/interfaces/ecpg/ecpglib/extern.h b/src/interfaces/ecpg/ecpglib/extern.h
index 94810c07b7b..91c7367b8b0 100644
--- a/src/interfaces/ecpg/ecpglib/extern.h
+++ b/src/interfaces/ecpg/ecpglib/extern.h
@@ -163,7 +163,7 @@ struct descriptor *ecpggetdescp(int, char *);
struct descriptor *ecpg_find_desc(int line, const char *name);
struct prepared_statement *ecpg_find_prepared_statement(const char *,
- struct connection *, struct prepared_statement **);
+ struct connection *, struct prepared_statement **);
bool ecpg_store_result(const PGresult *results, int act_field,
const struct statement *stmt, struct variable *var);
diff --git a/src/interfaces/ecpg/ecpglib/prepare.c b/src/interfaces/ecpg/ecpglib/prepare.c
index f05d0c0dc4d..151aa80dc66 100644
--- a/src/interfaces/ecpg/ecpglib/prepare.c
+++ b/src/interfaces/ecpg/ecpglib/prepare.c
@@ -28,7 +28,7 @@ static const int stmtCacheEntPerBucket = 8; /* # entries/bucket */
static stmtCacheEntry stmtCacheEntries[16384] = {{0, {0}, 0, 0, 0}};
static bool deallocate_one(int lineno, enum COMPAT_MODE c, struct connection *con,
- struct prepared_statement *prev, struct prepared_statement *this);
+ struct prepared_statement *prev, struct prepared_statement *this);
static bool
isvarchar(unsigned char c)
@@ -180,7 +180,7 @@ ECPGprepare(int lineno, const char *connection_name, const bool questionmarks, c
struct prepared_statement *
ecpg_find_prepared_statement(const char *name,
- struct connection *con, struct prepared_statement **prev_)
+ struct connection *con, struct prepared_statement **prev_)
{
struct prepared_statement *this,
*prev;
diff --git a/src/interfaces/ecpg/pgtypeslib/dt_common.c b/src/interfaces/ecpg/pgtypeslib/dt_common.c
index 9bbe5c501ba..a26d61b32cd 100644
--- a/src/interfaces/ecpg/pgtypeslib/dt_common.c
+++ b/src/interfaces/ecpg/pgtypeslib/dt_common.c
@@ -1204,7 +1204,7 @@ DecodeNumberField(int len, char *str, int fmask,
*/
static int
DecodeNumber(int flen, char *str, int fmask,
- int *tmask, struct tm *tm, fsec_t *fsec, int *is2digits, bool EuroDates)
+ int *tmask, struct tm *tm, fsec_t *fsec, int *is2digits, bool EuroDates)
{
int val;
char *cp;
@@ -1894,7 +1894,7 @@ DecodeDateTime(char **field, int *ftype, int nf,
* time
*/
if ((ftype[i] = DecodeNumberField(strlen(field[i]), field[i], fmask,
- &tmask, tm, fsec, &is2digits)) < 0)
+ &tmask, tm, fsec, &is2digits)) < 0)
return -1;
/*
@@ -2074,7 +2074,7 @@ DecodeDateTime(char **field, int *ftype, int nf,
case DTK_TIME:
/* previous field was "t" for ISO time */
if ((ftype[i] = DecodeNumberField(strlen(field[i]), field[i], (fmask | DTK_DATE_M),
- &tmask, tm, fsec, &is2digits)) < 0)
+ &tmask, tm, fsec, &is2digits)) < 0)
return -1;
if (tmask != DTK_TIME_M)
@@ -2112,18 +2112,18 @@ DecodeDateTime(char **field, int *ftype, int nf,
* Example: 20011223 or 040506
*/
if ((ftype[i] = DecodeNumberField(flen, field[i], fmask,
- &tmask, tm, fsec, &is2digits)) < 0)
+ &tmask, tm, fsec, &is2digits)) < 0)
return -1;
}
else if (flen > 4)
{
if ((ftype[i] = DecodeNumberField(flen, field[i], fmask,
- &tmask, tm, fsec, &is2digits)) < 0)
+ &tmask, tm, fsec, &is2digits)) < 0)
return -1;
}
/* otherwise it is a single date/time field... */
else if (DecodeNumber(flen, field[i], fmask,
- &tmask, tm, fsec, &is2digits, EuroDates) != 0)
+ &tmask, tm, fsec, &is2digits, EuroDates) != 0)
return -1;
}
break;
@@ -2151,7 +2151,7 @@ DecodeDateTime(char **field, int *ftype, int nf,
*dtype = DTK_DATE;
GetCurrentDateTime(tm);
j2date(date2j(tm->tm_year, tm->tm_mon, tm->tm_mday) - 1,
- &tm->tm_year, &tm->tm_mon, &tm->tm_mday);
+ &tm->tm_year, &tm->tm_mon, &tm->tm_mday);
tm->tm_hour = 0;
tm->tm_min = 0;
tm->tm_sec = 0;
@@ -2171,7 +2171,7 @@ DecodeDateTime(char **field, int *ftype, int nf,
*dtype = DTK_DATE;
GetCurrentDateTime(tm);
j2date(date2j(tm->tm_year, tm->tm_mon, tm->tm_mday) + 1,
- &tm->tm_year, &tm->tm_mon, &tm->tm_mday);
+ &tm->tm_year, &tm->tm_mon, &tm->tm_mday);
tm->tm_hour = 0;
tm->tm_min = 0;
tm->tm_sec = 0;
diff --git a/src/interfaces/ecpg/preproc/descriptor.c b/src/interfaces/ecpg/preproc/descriptor.c
index c6442c18058..729f063f62e 100644
--- a/src/interfaces/ecpg/preproc/descriptor.c
+++ b/src/interfaces/ecpg/preproc/descriptor.c
@@ -300,7 +300,7 @@ output_set_descr(char *desc_name, char *index)
fprintf(base_yyout, "%s,", get_dtype(results->value));
ECPGdump_a_type(base_yyout, v->name, v->type, v->brace_level,
- NULL, NULL, -1, NULL, NULL, str_zero, NULL, NULL);
+ NULL, NULL, -1, NULL, NULL, str_zero, NULL, NULL);
free(str_zero);
}
break;
diff --git a/src/interfaces/ecpg/preproc/ecpg.c b/src/interfaces/ecpg/preproc/ecpg.c
index aaecbf8122c..bad0a667fc2 100644
--- a/src/interfaces/ecpg/preproc/ecpg.c
+++ b/src/interfaces/ecpg/preproc/ecpg.c
@@ -51,7 +51,7 @@ help(const char *progname)
printf(_(" -I DIRECTORY search DIRECTORY for include files\n"));
printf(_(" -o OUTFILE write result to OUTFILE\n"));
printf(_(" -r OPTION specify run-time behavior; OPTION can be:\n"
- " \"no_indicator\", \"prepare\", \"questionmarks\"\n"));
+ " \"no_indicator\", \"prepare\", \"questionmarks\"\n"));
printf(_(" --regression run in regression testing mode\n"));
printf(_(" -t turn on autocommit of transactions\n"));
printf(_(" -V, --version output version information, then exit\n"));
diff --git a/src/interfaces/ecpg/preproc/type.c b/src/interfaces/ecpg/preproc/type.c
index 0d240d9df47..750cdf9c7ce 100644
--- a/src/interfaces/ecpg/preproc/type.c
+++ b/src/interfaces/ecpg/preproc/type.c
@@ -237,7 +237,7 @@ static void ECPGdump_a_struct(FILE *o, const char *name, const char *ind_name, c
void
ECPGdump_a_type(FILE *o, const char *name, struct ECPGtype *type, const int brace_level,
- const char *ind_name, struct ECPGtype *ind_type, const int ind_brace_level,
+ const char *ind_name, struct ECPGtype *ind_type, const int ind_brace_level,
const char *prefix, const char *ind_prefix,
char *arr_str_size, const char *struct_sizeof,
const char *ind_struct_sizeof)