summaryrefslogtreecommitdiff
path: root/src/interfaces
diff options
context:
space:
mode:
authorTom Lane2019-05-22 16:55:34 +0000
committerTom Lane2019-05-22 16:55:34 +0000
commitbe76af171cdb3e7465c4ef234af403f97ad79b7b (patch)
tree1fa62d2b7a6680a4237a1548f7002fa0b234b143 /src/interfaces
parent66a4bad83aaa6613a45a00a488c04427f9969fb4 (diff)
Initial pgindent run for v12.
This is still using the 2.0 version of pg_bsd_indent. I thought it would be good to commit this separately, so as to document the differences between 2.0 and 2.1 behavior. Discussion: https://postgr.es/m/[email protected]
Diffstat (limited to 'src/interfaces')
-rw-r--r--src/interfaces/ecpg/ecpglib/cursor.c42
-rw-r--r--src/interfaces/ecpg/ecpglib/descriptor.c9
-rw-r--r--src/interfaces/ecpg/ecpglib/ecpglib_extern.h14
-rw-r--r--src/interfaces/ecpg/ecpglib/error.c4
-rw-r--r--src/interfaces/ecpg/ecpglib/execute.c45
-rw-r--r--src/interfaces/ecpg/ecpglib/prepare.c124
-rw-r--r--src/interfaces/ecpg/include/ecpglib.h6
-rw-r--r--src/interfaces/ecpg/preproc/ecpg.c8
-rw-r--r--src/interfaces/ecpg/preproc/output.c14
-rw-r--r--src/interfaces/ecpg/preproc/preproc_extern.h2
-rw-r--r--src/interfaces/ecpg/preproc/type.h2
-rw-r--r--src/interfaces/libpq/fe-connect.c3
-rw-r--r--src/interfaces/libpq/libpq-fe.h2
-rw-r--r--src/interfaces/libpq/pqexpbuffer.c7
14 files changed, 146 insertions, 136 deletions
diff --git a/src/interfaces/ecpg/ecpglib/cursor.c b/src/interfaces/ecpg/ecpglib/cursor.c
index 133d62321bf..c364a3c97d1 100644
--- a/src/interfaces/ecpg/ecpglib/cursor.c
+++ b/src/interfaces/ecpg/ecpglib/cursor.c
@@ -25,14 +25,14 @@ static bool find_cursor(const char *, const struct connection *);
* others --- keep same as the parameters in ECPGdo() function
*/
bool
-ECPGopen(const char *cursor_name,const char *prepared_name,
- const int lineno, const int compat,const int force_indicator,
- const char *connection_name, const bool questionmarks,
- const int st, const char *query,...)
+ECPGopen(const char *cursor_name, const char *prepared_name,
+ const int lineno, const int compat, const int force_indicator,
+ const char *connection_name, const bool questionmarks,
+ const int st, const char *query,...)
{
va_list args;
bool status;
- const char *real_connection_name = NULL;
+ const char *real_connection_name = NULL;
if (!query)
{
@@ -53,8 +53,8 @@ ECPGopen(const char *cursor_name,const char *prepared_name,
else
{
/*
- * If can't get the connection name by declared name then using connection name
- * coming from the parameter connection_name
+ * If can't get the connection name by declared name then using
+ * connection name coming from the parameter connection_name
*/
real_connection_name = connection_name;
}
@@ -81,13 +81,13 @@ ECPGopen(const char *cursor_name,const char *prepared_name,
*/
bool
ECPGfetch(const char *cursor_name,
- const int lineno, const int compat,const int force_indicator,
- const char *connection_name, const bool questionmarks,
- const int st, const char *query,...)
+ const int lineno, const int compat, const int force_indicator,
+ const char *connection_name, const bool questionmarks,
+ const int st, const char *query,...)
{
va_list args;
bool status;
- const char *real_connection_name = NULL;
+ const char *real_connection_name = NULL;
if (!query)
{
@@ -99,8 +99,8 @@ ECPGfetch(const char *cursor_name,
if (real_connection_name == NULL)
{
/*
- * If can't get the connection name by cursor name then using connection name
- * coming from the parameter connection_name
+ * If can't get the connection name by cursor name then using
+ * connection name coming from the parameter connection_name
*/
real_connection_name = connection_name;
}
@@ -123,13 +123,13 @@ ECPGfetch(const char *cursor_name,
*/
bool
ECPGclose(const char *cursor_name,
- const int lineno, const int compat,const int force_indicator,
- const char *connection_name, const bool questionmarks,
- const int st, const char *query,...)
+ const int lineno, const int compat, const int force_indicator,
+ const char *connection_name, const bool questionmarks,
+ const int st, const char *query,...)
{
va_list args;
bool status;
- const char *real_connection_name = NULL;
+ const char *real_connection_name = NULL;
struct connection *con = NULL;
if (!query)
@@ -142,8 +142,8 @@ ECPGclose(const char *cursor_name,
if (real_connection_name == NULL)
{
/*
- * If can't get the connection name by cursor name then using connection name
- * coming from the parameter connection_name
+ * If can't get the connection name by cursor name then using
+ * connection name coming from the parameter connection_name
*/
real_connection_name = connection_name;
}
@@ -192,12 +192,12 @@ add_cursor(const int lineno, const char *cursor_name, const char *connection_nam
if (!con)
{
ecpg_raise(lineno, ECPG_NO_CONN, ECPG_SQLSTATE_CONNECTION_DOES_NOT_EXIST,
- connection_name ? connection_name : ecpg_gettext("NULL"));
+ connection_name ? connection_name : ecpg_gettext("NULL"));
return;
}
/* allocate a node to store the new cursor */
- new = (struct cursor_statement *)ecpg_alloc(sizeof(struct cursor_statement), lineno);
+ new = (struct cursor_statement *) ecpg_alloc(sizeof(struct cursor_statement), lineno);
if (new)
{
new->name = ecpg_strdup(cursor_name, lineno);
diff --git a/src/interfaces/ecpg/ecpglib/descriptor.c b/src/interfaces/ecpg/ecpglib/descriptor.c
index 97849d0793b..d5ec3a61203 100644
--- a/src/interfaces/ecpg/ecpglib/descriptor.c
+++ b/src/interfaces/ecpg/ecpglib/descriptor.c
@@ -589,7 +589,7 @@ ECPGset_desc_header(int lineno, const char *desc_name, int count)
static void
set_desc_attr(struct descriptor_item *desc_item, struct variable *var,
- char *tobeinserted)
+ char *tobeinserted)
{
if (var->type != ECPGt_bytea)
desc_item->is_binary = false;
@@ -603,8 +603,7 @@ set_desc_attr(struct descriptor_item *desc_item, struct variable *var,
desc_item->data_len = variable->len;
}
- ecpg_free(desc_item->data); /* free() takes care of a
- * potential NULL value */
+ ecpg_free(desc_item->data); /* free() takes care of a potential NULL value */
desc_item->data = (char *) tobeinserted;
}
@@ -875,8 +874,8 @@ ECPGdescribe(int line, int compat, bool input, const char *connection_name, cons
if (real_connection_name == NULL)
{
/*
- * If can't get the connection name by declared name then using connection name
- * coming from the parameter connection_name
+ * If can't get the connection name by declared name then using
+ * connection name coming from the parameter connection_name
*/
real_connection_name = connection_name;
}
diff --git a/src/interfaces/ecpg/ecpglib/ecpglib_extern.h b/src/interfaces/ecpg/ecpglib/ecpglib_extern.h
index d63efd5459e..d34a75c04d8 100644
--- a/src/interfaces/ecpg/ecpglib/ecpglib_extern.h
+++ b/src/interfaces/ecpg/ecpglib/ecpglib_extern.h
@@ -90,9 +90,9 @@ struct statement
/* structure to store declared statements */
struct declared_statement
{
- char *name; /* declared name */
- char *connection_name;
- char *cursor_name;
+ char *name; /* declared name */
+ char *connection_name;
+ char *cursor_name;
struct declared_statement *next;
};
@@ -107,7 +107,7 @@ struct prepared_statement
struct cursor_statement
{
- char *name; /*cursor name*/
+ char *name; /* cursor name */
struct cursor_statement *next;
};
@@ -204,10 +204,10 @@ struct descriptor *ecpg_find_desc(int line, const char *name);
struct prepared_statement *ecpg_find_prepared_statement(const char *,
struct connection *, struct prepared_statement **);
-void ecpg_update_declare_statement(const char *, const char *, const int);
-char *ecpg_get_con_name_by_declared_name(const char *);
+void ecpg_update_declare_statement(const char *, const char *, const int);
+char *ecpg_get_con_name_by_declared_name(const char *);
const char *ecpg_get_con_name_by_cursor_name(const char *);
-void ecpg_release_declared_statement(const char *);
+void ecpg_release_declared_statement(const char *);
bool ecpg_store_result(const PGresult *results, int act_field,
const struct statement *stmt, struct variable *var);
diff --git a/src/interfaces/ecpg/ecpglib/error.c b/src/interfaces/ecpg/ecpglib/error.c
index 397aa28190e..fb519195fc5 100644
--- a/src/interfaces/ecpg/ecpglib/error.c
+++ b/src/interfaces/ecpg/ecpglib/error.c
@@ -201,10 +201,10 @@ ecpg_raise(int line, int code, const char *sqlstate, const char *str)
break;
case ECPG_INVALID_CURSOR:
- snprintf(sqlca->sqlerrm.sqlerrmc, sizeof(sqlca->sqlerrm.sqlerrmc),
+ snprintf(sqlca->sqlerrm.sqlerrmc, sizeof(sqlca->sqlerrm.sqlerrmc),
/*------
translator: this string will be truncated at 149 characters expanded. */
- ecpg_gettext("The cursor is invalid on line %d"),line);
+ ecpg_gettext("The cursor is invalid on line %d"), line);
break;
default:
diff --git a/src/interfaces/ecpg/ecpglib/execute.c b/src/interfaces/ecpg/ecpglib/execute.c
index 2db1b620586..6dbf2fa9e01 100644
--- a/src/interfaces/ecpg/ecpglib/execute.c
+++ b/src/interfaces/ecpg/ecpglib/execute.c
@@ -488,11 +488,12 @@ sprintf_float_value(char *ptr, float value, const char *delim)
sprintf(ptr, "%.15g%s", value, delim);
}
-static char*
+static char *
convert_bytea_to_string(char *from_data, int from_len, int lineno)
{
- char *to_data;
- int to_len = ecpg_hex_enc_len(from_len) + 4 + 1; /* backslash + 'x' + quote + quote */
+ char *to_data;
+ int to_len = ecpg_hex_enc_len(from_len) + 4 + 1; /* backslash + 'x' +
+ * quote + quote */
to_data = ecpg_alloc(to_len, lineno);
if (!to_data)
@@ -1080,16 +1081,16 @@ ecpg_store_input(const int lineno, const bool force_indicator, const struct vari
static void
print_param_value(char *value, int len, int is_binary, int lineno, int nth)
{
- char *value_s;
- bool malloced = false;
+ char *value_s;
+ bool malloced = false;
if (value == NULL)
value_s = "null";
- else if (! is_binary)
+ else if (!is_binary)
value_s = value;
else
{
- value_s = ecpg_alloc(ecpg_hex_enc_len(len)+1, lineno);
+ value_s = ecpg_alloc(ecpg_hex_enc_len(len) + 1, lineno);
if (value_s != NULL)
{
ecpg_hex_encode(value, len, value_s);
@@ -1101,7 +1102,7 @@ print_param_value(char *value, int len, int is_binary, int lineno, int nth)
}
ecpg_log("ecpg_free_params on line %d: parameter %d = %s\n",
- lineno, nth, value_s);
+ lineno, nth, value_s);
if (malloced)
ecpg_free(value_s);
@@ -1116,7 +1117,7 @@ ecpg_free_params(struct statement *stmt, bool print)
{
if (print)
print_param_value(stmt->paramvalues[n], stmt->paramlengths[n],
- stmt->paramformats[n], stmt->lineno, n + 1);
+ stmt->paramformats[n], stmt->lineno, n + 1);
ecpg_free(stmt->paramvalues[n]);
}
ecpg_free(stmt->paramvalues);
@@ -1162,13 +1163,13 @@ insert_tobeinserted(int position, int ph_len, struct statement *stmt, char *tobe
static bool
store_input_from_desc(struct statement *stmt, struct descriptor_item *desc_item,
- char **tobeinserted)
+ char **tobeinserted)
{
struct variable var;
/*
- * In case of binary data, only allocate memory and memcpy because
- * binary data have been already stored into desc_item->data with
+ * In case of binary data, only allocate memory and memcpy because binary
+ * data have been already stored into desc_item->data with
* ecpg_store_input() at ECPGset_desc().
*/
if (desc_item->is_binary)
@@ -1454,7 +1455,8 @@ ecpg_build_params(struct statement *stmt)
stmt->statement_type == ECPGst_exec_with_exprlist)
{
/* Add double quote both side for embedding statement name. */
- char *str = ecpg_alloc(strlen(tobeinserted) + 2 + 1, stmt->lineno);
+ char *str = ecpg_alloc(strlen(tobeinserted) + 2 + 1, stmt->lineno);
+
sprintf(str, "\"%s\"", tobeinserted);
ecpg_free(tobeinserted);
tobeinserted = str;
@@ -1471,7 +1473,8 @@ ecpg_build_params(struct statement *stmt)
if (binary_format)
{
- char *p = convert_bytea_to_string(tobeinserted, binary_length, stmt->lineno);
+ char *p = convert_bytea_to_string(tobeinserted, binary_length, stmt->lineno);
+
if (!p)
{
ecpg_free_params(stmt, false);
@@ -1541,8 +1544,8 @@ ecpg_build_params(struct statement *stmt)
}
/*
- * Check if there are unmatched things left.
- * PREPARE AS has no parameter. Check other statement.
+ * Check if there are unmatched things left. PREPARE AS has no parameter.
+ * Check other statement.
*/
if (stmt->statement_type != ECPGst_prepare &&
next_insert(stmt->command, position, stmt->questionmarks, std_strings) >= 0)
@@ -1617,7 +1620,7 @@ ecpg_execute(struct statement *stmt)
if (stmt->statement_type == ECPGst_prepare)
{
- if(! ecpg_register_prepared_stmt(stmt))
+ if (!ecpg_register_prepared_stmt(stmt))
{
ecpg_free_params(stmt, true);
return false;
@@ -2266,7 +2269,7 @@ ECPGdo(const int lineno, const int compat, const int force_indicator, const char
{
va_list args;
bool ret;
- const char *real_connection_name = NULL;
+ const char *real_connection_name = NULL;
real_connection_name = connection_name;
@@ -2283,11 +2286,11 @@ ECPGdo(const int lineno, const int compat, const int force_indicator, const char
if (real_connection_name == NULL)
{
/*
- * If can't get the connection name by declared name then using connection name
- * coming from the parameter connection_name
+ * If can't get the connection name by declared name then using
+ * connection name coming from the parameter connection_name
*/
real_connection_name = connection_name;
- }
+ }
}
va_start(args, query);
diff --git a/src/interfaces/ecpg/ecpglib/prepare.c b/src/interfaces/ecpg/ecpglib/prepare.c
index 83de5e88b1e..387e4f27ce7 100644
--- a/src/interfaces/ecpg/ecpglib/prepare.c
+++ b/src/interfaces/ecpg/ecpglib/prepare.c
@@ -63,51 +63,51 @@ ecpg_register_prepared_stmt(struct statement *stmt)
struct prepared_statement *this;
struct connection *con = NULL;
struct prepared_statement *prev = NULL;
- char *real_connection_name;
- int lineno = stmt->lineno;
-
- real_connection_name = ecpg_get_con_name_by_declared_name(stmt->name);
- if (real_connection_name == NULL)
- real_connection_name = stmt->connection->name;
-
- con = ecpg_get_connection(real_connection_name);
- if (!ecpg_init(con, real_connection_name, stmt->lineno))
- return false;
-
- /* check if we already have prepared this statement */
- this = ecpg_find_prepared_statement(stmt->name, con, &prev);
- if (this && !deallocate_one(lineno, ECPG_COMPAT_PGSQL, con, prev, this))
- return false;
-
- /* allocate new statement */
- this = (struct prepared_statement *) ecpg_alloc(sizeof(struct prepared_statement), lineno);
- if (!this)
- return false;
-
- prep_stmt = (struct statement *) ecpg_alloc(sizeof(struct statement), lineno);
- if (!stmt)
- {
- ecpg_free(this);
- return false;
- }
- memset(prep_stmt, 0, sizeof(struct statement));
-
- /* create statement */
- prep_stmt->lineno = lineno;
- prep_stmt->connection = con;
- prep_stmt->command = ecpg_strdup(stmt->command, lineno);
- prep_stmt->inlist = prep_stmt->outlist = NULL;
- this->name = ecpg_strdup(stmt->name, lineno);
- this->stmt = prep_stmt;
- this->prepared = true;
-
- if (con->prep_stmts == NULL)
- this->next = NULL;
- else
- this->next = con->prep_stmts;
-
- con->prep_stmts = this;
- return true;
+ char *real_connection_name;
+ int lineno = stmt->lineno;
+
+ real_connection_name = ecpg_get_con_name_by_declared_name(stmt->name);
+ if (real_connection_name == NULL)
+ real_connection_name = stmt->connection->name;
+
+ con = ecpg_get_connection(real_connection_name);
+ if (!ecpg_init(con, real_connection_name, stmt->lineno))
+ return false;
+
+ /* check if we already have prepared this statement */
+ this = ecpg_find_prepared_statement(stmt->name, con, &prev);
+ if (this && !deallocate_one(lineno, ECPG_COMPAT_PGSQL, con, prev, this))
+ return false;
+
+ /* allocate new statement */
+ this = (struct prepared_statement *) ecpg_alloc(sizeof(struct prepared_statement), lineno);
+ if (!this)
+ return false;
+
+ prep_stmt = (struct statement *) ecpg_alloc(sizeof(struct statement), lineno);
+ if (!stmt)
+ {
+ ecpg_free(this);
+ return false;
+ }
+ memset(prep_stmt, 0, sizeof(struct statement));
+
+ /* create statement */
+ prep_stmt->lineno = lineno;
+ prep_stmt->connection = con;
+ prep_stmt->command = ecpg_strdup(stmt->command, lineno);
+ prep_stmt->inlist = prep_stmt->outlist = NULL;
+ this->name = ecpg_strdup(stmt->name, lineno);
+ this->stmt = prep_stmt;
+ this->prepared = true;
+
+ if (con->prep_stmts == NULL)
+ this->next = NULL;
+ else
+ this->next = con->prep_stmts;
+
+ con->prep_stmts = this;
+ return true;
}
static bool
@@ -239,8 +239,8 @@ ECPGprepare(int lineno, const char *connection_name, const bool questionmarks,
if (real_connection_name == NULL)
{
/*
- * If can't get the connection name by declared name then using connection name
- * coming from the parameter connection_name
+ * If can't get the connection name by declared name then using
+ * connection name coming from the parameter connection_name
*/
real_connection_name = connection_name;
}
@@ -345,8 +345,8 @@ ECPGdeallocate(int lineno, int c, const char *connection_name, const char *name)
if (real_connection_name == NULL)
{
/*
- * If can't get the connection name by declared name then using connection name
- * coming from the parameter connection_name
+ * If can't get the connection name by declared name then using
+ * connection name coming from the parameter connection_name
*/
real_connection_name = connection_name;
}
@@ -408,8 +408,8 @@ ECPGprepared_statement(const char *connection_name, const char *name, int lineno
if (real_connection_name == NULL)
{
/*
- * If can't get the connection name by declared name then using connection name
- * coming from the parameter connection_name
+ * If can't get the connection name by declared name then using
+ * connection name coming from the parameter connection_name
*/
real_connection_name = connection_name;
}
@@ -667,11 +667,11 @@ ECPGdeclare(int lineno, const char *connection_name, const char *name)
{
/*
* Going to here means not using AT clause in the DECLARE STATEMENT
- * ECPG pre-processor allows this case.
- * However, we don't allocate a node to store the declared name
- * because the DECLARE STATEMENT without using AT clause will be ignored.
- * The following statement such as PREPARE, EXECUTE are executed
- * as usual on the current connection.
+ * ECPG pre-processor allows this case. However, we don't allocate a
+ * node to store the declared name because the DECLARE STATEMENT
+ * without using AT clause will be ignored. The following statement
+ * such as PREPARE, EXECUTE are executed as usual on the current
+ * connection.
*/
return true;
}
@@ -682,7 +682,10 @@ ECPGdeclare(int lineno, const char *connection_name, const char *name)
if (ecpg_find_declared_statement(name))
{
- /* Should not go to here because the pre-compiler has check the duplicate name */
+ /*
+ * Should not go to here because the pre-compiler has check the
+ * duplicate name
+ */
return false;
}
@@ -751,7 +754,7 @@ ecpg_update_declare_statement(const char *declared_name, const char *cursor_name
/* Find the declared node by declared name */
p = ecpg_find_declared_statement(declared_name);
if (p)
- p->cursor_name = ecpg_strdup(cursor_name,lineno);
+ p->cursor_name = ecpg_strdup(cursor_name, lineno);
}
/*
@@ -831,7 +834,10 @@ ecpg_release_declared_statement(const char *connection_name)
ecpg_free(cur->cursor_name);
ecpg_free(cur);
- /* One connection can be used by multiple declared name, so no break here */
+ /*
+ * One connection can be used by multiple declared name, so no
+ * break here
+ */
}
else
prev = cur;
diff --git a/src/interfaces/ecpg/include/ecpglib.h b/src/interfaces/ecpg/include/ecpglib.h
index 1edf272ada4..f1031d25956 100644
--- a/src/interfaces/ecpg/include/ecpglib.h
+++ b/src/interfaces/ecpg/include/ecpglib.h
@@ -56,9 +56,9 @@ bool ECPGprepare(int, const char *, const bool, const char *, const char *);
bool ECPGdeallocate(int, int, const char *, const char *);
bool ECPGdeallocate_all(int, int, const char *);
bool ECPGdeclare(int, const char *, const char *);
-bool ECPGopen(const char*, const char*, const int, const int, const int, const char *, const bool, const int, const char *,...);
-bool ECPGfetch(const char*, const int, const int, const int, const char *, const bool, const int, const char *,...);
-bool ECPGclose(const char*, const int, const int, const int, const char *, const bool, const int, const char *,...);
+bool ECPGopen(const char *, const char *, const int, const int, const int, const char *, const bool, const int, const char *,...);
+bool ECPGfetch(const char *, const int, const int, const int, const char *, const bool, const int, const char *,...);
+bool ECPGclose(const char *, const int, const int, const int, const char *, const bool, const int, const char *,...);
char *ECPGprepared_statement(const char *, const char *, int);
PGconn *ECPGget_PGconn(const char *);
PGTransactionStatusType ECPGtransactionStatus(const char *);
diff --git a/src/interfaces/ecpg/preproc/ecpg.c b/src/interfaces/ecpg/preproc/ecpg.c
index a6a43f5a3f7..861a2d98d5e 100644
--- a/src/interfaces/ecpg/preproc/ecpg.c
+++ b/src/interfaces/ecpg/preproc/ecpg.c
@@ -121,8 +121,8 @@ free_argument(struct arguments *arg)
free_argument(arg->next);
/*
- * Don't free variables in it because the original codes don't free it either
- * variables are static structures instead of allocating
+ * Don't free variables in it because the original codes don't free it
+ * either variables are static structures instead of allocating
*/
free(arg);
}
@@ -520,13 +520,13 @@ main(int argc, char *const argv[])
free(input_filename);
}
- if(g_declared_list)
+ if (g_declared_list)
{
free_declared_stmt(g_declared_list);
g_declared_list = NULL;
}
- if(cur)
+ if (cur)
{
free_cursor(cur);
cur = NULL;
diff --git a/src/interfaces/ecpg/preproc/output.c b/src/interfaces/ecpg/preproc/output.c
index 1851809e63f..9419a39f9e9 100644
--- a/src/interfaces/ecpg/preproc/output.c
+++ b/src/interfaces/ecpg/preproc/output.c
@@ -142,9 +142,9 @@ output_statement(char *stmt, int whenever_mode, enum ECPG_statement_type st)
st = ECPGst_normal;
/*
- * In following cases, stmt is CSTRING or char_variable. They must be output directly.
- * - prepared_name of EXECUTE without exprlist
- * - execstring of EXECUTE IMMEDIATE
+ * In following cases, stmt is CSTRING or char_variable. They must be
+ * output directly. - prepared_name of EXECUTE without exprlist -
+ * execstring of EXECUTE IMMEDIATE
*/
fprintf(base_yyout, "%s, ", ecpg_statement_type_name[st]);
if (st == ECPGst_execute || st == ECPGst_exec_immediate)
@@ -317,9 +317,9 @@ output_cursor_name(char *str)
j++;
} while (str[j] == ' ' || str[j] == '\t');
- if ((str[j] != '\n') && (str[j] != '\r' || str[j + 1] != '\n')) /* not followed by a
- * newline */
- fputs("\\\\",base_yyout);
+ if ((str[j] != '\n') && (str[j] != '\r' || str[j + 1] != '\n')) /* not followed by a
+ * newline */
+ fputs("\\\\", base_yyout);
}
else if (str[i] == '\r' && str[i + 1] == '\n')
{
@@ -362,7 +362,7 @@ output_declare_statement(char *name)
void
output_cursor_statement(int cursor_stmt, char *cursor_name, char *prepared_name, char *stmt, int whenever_mode, enum ECPG_statement_type st)
{
- switch(cursor_stmt)
+ switch (cursor_stmt)
{
case ECPGcst_open:
fprintf(base_yyout, "{ ECPGopen(");
diff --git a/src/interfaces/ecpg/preproc/preproc_extern.h b/src/interfaces/ecpg/preproc/preproc_extern.h
index 8ccfdf0d1fb..552ffc627bc 100644
--- a/src/interfaces/ecpg/preproc/preproc_extern.h
+++ b/src/interfaces/ecpg/preproc/preproc_extern.h
@@ -72,7 +72,7 @@ extern void output_prepare_statement(char *, char *);
extern void output_deallocate_prepare_statement(char *);
extern void output_simple_statement(char *, int);
extern void output_declare_statement(char *);
-extern void output_cursor_statement(int , char *, char *, char *, int , enum ECPG_statement_type);
+extern void output_cursor_statement(int, char *, char *, char *, int, enum ECPG_statement_type);
extern char *hashline_number(void);
extern int base_yyparse(void);
extern int base_yylex(void);
diff --git a/src/interfaces/ecpg/preproc/type.h b/src/interfaces/ecpg/preproc/type.h
index 4d6afd93b8a..b16a92c3f28 100644
--- a/src/interfaces/ecpg/preproc/type.h
+++ b/src/interfaces/ecpg/preproc/type.h
@@ -145,7 +145,7 @@ struct cursor
/* structure to store declared name */
struct declared_name_st
{
- char *name; /* declared name */
+ char *name; /* declared name */
struct declared_name_st *next;
};
diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c
index b89df08c297..d3bcb982752 100644
--- a/src/interfaces/libpq/fe-connect.c
+++ b/src/interfaces/libpq/fe-connect.c
@@ -313,7 +313,7 @@ static const internalPQconninfoOption PQconninfoOptions[] = {
* and "prefer".
*/
{"gssencmode", "PGGSSENCMODE", DefaultGSSMode, NULL,
- "GSSENC-Mode", "", 7, /* sizeof("disable") == 7 */
+ "GSSENC-Mode", "", 7, /* sizeof("disable") == 7 */
offsetof(struct pg_conn, gssencmode)},
#if defined(ENABLE_GSS) || defined(ENABLE_SSPI)
@@ -2420,6 +2420,7 @@ keep_going: /* We will come back to here until there is
getHostaddr(conn, host_addr, NI_MAXHOST);
if (strlen(host_addr) > 0)
conn->connip = strdup(host_addr);
+
/*
* purposely ignore strdup failure; not a big problem if
* it fails anyway.
diff --git a/src/interfaces/libpq/libpq-fe.h b/src/interfaces/libpq/libpq-fe.h
index f44030b4b0d..54c951723ce 100644
--- a/src/interfaces/libpq/libpq-fe.h
+++ b/src/interfaces/libpq/libpq-fe.h
@@ -349,7 +349,7 @@ extern void PQinitSSL(int do_init);
extern void PQinitOpenSSL(int do_ssl, int do_crypto);
/* Return true if GSSAPI encryption is in use */
-extern int PQgssEncInUse(PGconn *conn);
+extern int PQgssEncInUse(PGconn *conn);
/* Returns GSSAPI context if GSSAPI is in use */
extern void *PQgetgssctx(PGconn *conn);
diff --git a/src/interfaces/libpq/pqexpbuffer.c b/src/interfaces/libpq/pqexpbuffer.c
index dc7c3ea07d4..b3c53b0cda3 100644
--- a/src/interfaces/libpq/pqexpbuffer.c
+++ b/src/interfaces/libpq/pqexpbuffer.c
@@ -36,8 +36,9 @@
/* All "broken" PQExpBuffers point to this string. */
static const char oom_buffer[1] = "";
+
/* Need a char * for unconstify() compatiblity */
-static const char * oom_buffer_ptr = oom_buffer;
+static const char *oom_buffer_ptr = oom_buffer;
static bool appendPQExpBufferVA(PQExpBuffer str, const char *fmt, va_list args) pg_attribute_printf(2, 0);
@@ -93,7 +94,7 @@ initPQExpBuffer(PQExpBuffer str)
str->data = (char *) malloc(INITIAL_EXPBUFFER_SIZE);
if (str->data == NULL)
{
- str->data = unconstify(char *, oom_buffer_ptr); /* see comment above */
+ str->data = unconstify(char *, oom_buffer_ptr); /* see comment above */
str->maxlen = 0;
str->len = 0;
}
@@ -132,7 +133,7 @@ termPQExpBuffer(PQExpBuffer str)
if (str->data != oom_buffer)
free(str->data);
/* just for luck, make the buffer validly empty. */
- str->data = unconstify(char *, oom_buffer_ptr); /* see comment above */
+ str->data = unconstify(char *, oom_buffer_ptr); /* see comment above */
str->maxlen = 0;
str->len = 0;
}