diff options
author | Bruce Momjian <bruce@momjian.us> | 2012-06-10 15:20:04 -0400 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2012-06-10 15:20:04 -0400 |
commit | 927d61eeff78363ea3938c818d07e511ebaf75cf (patch) | |
tree | 2f0bcecf53327f76272a8ce690fa62505520fab9 /src/interfaces/ecpg | |
parent | 60801944fa105252b48ea5688d47dfc05c695042 (diff) | |
download | postgresql-927d61eeff78363ea3938c818d07e511ebaf75cf.tar.gz postgresql-927d61eeff78363ea3938c818d07e511ebaf75cf.zip |
Run pgindent on 9.2 source tree in preparation for first 9.3
commit-fest.
Diffstat (limited to 'src/interfaces/ecpg')
-rw-r--r-- | src/interfaces/ecpg/ecpglib/connect.c | 27 | ||||
-rw-r--r-- | src/interfaces/ecpg/ecpglib/execute.c | 4 | ||||
-rw-r--r-- | src/interfaces/ecpg/ecpglib/extern.h | 6 | ||||
-rw-r--r-- | src/interfaces/ecpg/pgtypeslib/dt.h | 6 | ||||
-rw-r--r-- | src/interfaces/ecpg/preproc/type.c | 5 |
5 files changed, 27 insertions, 21 deletions
diff --git a/src/interfaces/ecpg/ecpglib/connect.c b/src/interfaces/ecpg/ecpglib/connect.c index b54b1f55036..49f2d546bbe 100644 --- a/src/interfaces/ecpg/ecpglib/connect.c +++ b/src/interfaces/ecpg/ecpglib/connect.c @@ -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; } } diff --git a/src/interfaces/ecpg/ecpglib/execute.c b/src/interfaces/ecpg/ecpglib/execute.c index 50a2d95347e..1a7876ecf2d 100644 --- a/src/interfaces/ecpg/ecpglib/execute.c +++ b/src/interfaces/ecpg/ecpglib/execute.c @@ -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); } } diff --git a/src/interfaces/ecpg/ecpglib/extern.h b/src/interfaces/ecpg/ecpglib/extern.h index bd1ffb096c0..835e70c38f4 100644 --- a/src/interfaces/ecpg/ecpglib/extern.h +++ b/src/interfaces/ecpg/ecpglib/extern.h @@ -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); diff --git a/src/interfaces/ecpg/pgtypeslib/dt.h b/src/interfaces/ecpg/pgtypeslib/dt.h index 269af7822b1..dfe6f9e6872 100644 --- a/src/interfaces/ecpg/pgtypeslib/dt.h +++ b/src/interfaces/ecpg/pgtypeslib/dt.h @@ -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); diff --git a/src/interfaces/ecpg/preproc/type.c b/src/interfaces/ecpg/preproc/type.c index ff1224754ea..c743616a6ca 100644 --- a/src/interfaces/ecpg/preproc/type.c +++ b/src/interfaces/ecpg/preproc/type.c @@ -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 |