1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

Run pgindent on 9.2 source tree in preparation for first 9.3

commit-fest.
This commit is contained in:
Bruce Momjian
2012-06-10 15:20:04 -04:00
parent 60801944fa
commit 927d61eeff
494 changed files with 7343 additions and 7046 deletions

View File

@ -267,7 +267,8 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p
struct sqlca_t *sqlca = ECPGget_sqlca();
enum COMPAT_MODE compat = c;
struct connection *this;
int i, connect_params = 0;
int i,
connect_params = 0;
char *dbname = name ? ecpg_strdup(name, lineno) : NULL,
*host = NULL,
*tmp,
@ -505,10 +506,10 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p
connect_params++;
/* allocate enough space for all connection parameters */
conn_keywords = (const char **) ecpg_alloc((connect_params + 1) * sizeof (char *), lineno);
conn_values = (const char **) ecpg_alloc(connect_params * sizeof (char *), lineno);
conn_keywords = (const char **) ecpg_alloc((connect_params + 1) * sizeof(char *), lineno);
conn_values = (const char **) ecpg_alloc(connect_params * sizeof(char *), lineno);
if (conn_keywords == NULL || conn_values == NULL)
{
{
if (host)
ecpg_free(host);
if (port)
@ -560,23 +561,25 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p
}
if (options)
{
char *str;
char *str;
/* options look like this "option1 = value1 option2 = value2 ... */
/* we have to break up the string into single options */
for (str = options; *str;)
{
int e, a;
char *token1, *token2;
int e,
a;
char *token1,
*token2;
for (token1 = str; *token1 && *token1 == ' '; token1++);
for (token1 = str; *token1 && *token1 == ' '; token1++);
for (e = 0; token1[e] && token1[e] != '='; e++);
if (token1[e]) /* found "=" */
if (token1[e]) /* found "=" */
{
token1[e] = '\0';
for (token2 = token1 + e + 1; *token2 && *token2 == ' '; token2++);
for (a = 0; token2[a] && token2[a] != '&'; a++);
if (token2[a]) /* found "&" => another option follows */
if (token2[a]) /* found "&" => another option follows */
{
token2[a] = '\0';
str = token2 + a + 1;
@ -587,10 +590,10 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p
conn_keywords[i] = token1;
conn_values[i] = token2;
i++;
}
}
else
/* the parser should not be able to create this invalid option */
str = token1 + e;
str = token1 + e;
}
}

View File

@ -1441,7 +1441,7 @@ ecpg_execute(struct statement * stmt)
ecpg_log("ecpg_execute on line %d: query: %s; with %d parameter(s) on connection %s\n", stmt->lineno, stmt->command, nParams, stmt->connection->name);
if (stmt->statement_type == ECPGst_execute)
{
results = PQexecPrepared(stmt->connection->connection, stmt->name, nParams, (const char *const*) paramValues, NULL, NULL, 0);
results = PQexecPrepared(stmt->connection->connection, stmt->name, nParams, (const char *const *) paramValues, NULL, NULL, 0);
ecpg_log("ecpg_execute on line %d: using PQexecPrepared for \"%s\"\n", stmt->lineno, stmt->command);
}
else
@ -1453,7 +1453,7 @@ ecpg_execute(struct statement * stmt)
}
else
{
results = PQexecParams(stmt->connection->connection, stmt->command, nParams, NULL, (const char *const*) paramValues, NULL, NULL, 0);
results = PQexecParams(stmt->connection->connection, stmt->command, nParams, NULL, (const char *const *) paramValues, NULL, NULL, 0);
ecpg_log("ecpg_execute on line %d: using PQexecParams\n", stmt->lineno);
}
}

View File

@ -123,8 +123,8 @@ struct variable
struct var_list
{
int number;
void *pointer;
int number;
void *pointer;
struct var_list *next;
};
@ -170,7 +170,7 @@ void ecpg_raise(int line, int code, const char *sqlstate, const char *str);
void ecpg_raise_backend(int line, PGresult *result, PGconn *conn, int compat);
char *ecpg_prepared(const char *, struct connection *);
bool ecpg_deallocate_all_conn(int lineno, enum COMPAT_MODE c, struct connection * conn);
void ecpg_log(const char *format, ...) __attribute__((format(PG_PRINTF_ATTRIBUTE, 1, 2)));
void ecpg_log(const char *format,...) __attribute__((format(PG_PRINTF_ATTRIBUTE, 1, 2)));
bool ecpg_auto_prepare(int, const char *, const int, char **, const char *);
void ecpg_init_sqlca(struct sqlca_t * sqlca);

View File

@ -334,12 +334,12 @@ do { \
int DecodeInterval(char **, int *, int, int *, struct tm *, fsec_t *);
int DecodeTime(char *, int *, struct tm *, fsec_t *);
int EncodeDateTime(struct tm *tm, fsec_t fsec, bool print_tz, int tz, const char *tzn, int style, char *str, bool EuroDates);
int EncodeInterval(struct tm *tm, fsec_t fsec, int style, char *str);
int EncodeDateTime(struct tm * tm, fsec_t fsec, bool print_tz, int tz, const char *tzn, int style, char *str, bool EuroDates);
int EncodeInterval(struct tm * tm, fsec_t fsec, int style, char *str);
int tm2timestamp(struct tm *, fsec_t, int *, timestamp *);
int DecodeUnits(int field, char *lowtoken, int *val);
bool CheckDateTokenTables(void);
int EncodeDateOnly(struct tm *tm, int style, char *str, bool EuroDates);
int EncodeDateOnly(struct tm * tm, int style, char *str, bool EuroDates);
int GetEpochTime(struct tm *);
int ParseDateTime(char *, char *, char **, int *, int *, char **);
int DecodeDateTime(char **, int *, int, int *, struct tm *, fsec_t *, bool);

View File

@ -396,7 +396,10 @@ ECPGdump_a_simple(FILE *o, const char *name, enum ECPGttype type,
else
sprintf(variable, "&(%s%s)", prefix ? prefix : "", name);
/* If we created a varchar structure atomatically, counter is greater than 0. */
/*
* If we created a varchar structure atomatically, counter is
* greater than 0.
*/
if (counter)
sprintf(offset, "sizeof(struct varchar_%d)", counter);
else