diff options
Diffstat (limited to 'src/interfaces/ecpg')
| -rw-r--r-- | src/interfaces/ecpg/ecpglib/connect.c | 4 | ||||
| -rw-r--r-- | src/interfaces/ecpg/ecpglib/error.c | 8 | ||||
| -rw-r--r-- | src/interfaces/ecpg/ecpglib/execute.c | 4 | ||||
| -rw-r--r-- | src/interfaces/ecpg/ecpglib/misc.c | 8 | ||||
| -rw-r--r-- | src/interfaces/ecpg/preproc/ecpg.c | 3 | ||||
| -rw-r--r-- | src/interfaces/ecpg/preproc/type.c | 4 | ||||
| -rw-r--r-- | src/interfaces/ecpg/test/expected/preproc-outofscope.c | 50 | ||||
| -rw-r--r-- | src/interfaces/ecpg/test/expected/preproc-strings.c | 7 | ||||
| -rw-r--r-- | src/interfaces/ecpg/test/preproc/strings.h | 7 | ||||
| -rw-r--r-- | src/interfaces/ecpg/test/preproc/struct.h | 26 |
10 files changed, 69 insertions, 52 deletions
diff --git a/src/interfaces/ecpg/ecpglib/connect.c b/src/interfaces/ecpg/ecpglib/connect.c index a124a89495..c05dc9014e 100644 --- a/src/interfaces/ecpg/ecpglib/connect.c +++ b/src/interfaces/ecpg/ecpglib/connect.c @@ -1,4 +1,4 @@ -/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.55 2010/05/07 19:35:03 meskes Exp $ */ +/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.56 2010/07/06 19:19:00 momjian Exp $ */ #define POSTGRES_ECPG_INTERNAL #include "postgres_fe.h" @@ -495,7 +495,7 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p host ? "host=" : "", host ? host : "", port ? "port=" : "", port ? port : "", (user && strlen(user) > 0) ? "user=" : "", user ? user : "", - (passwd && strlen(passwd) > 0) ? "password=" : "", passwd ? passwd : "", + (passwd && strlen(passwd) > 0) ? "password=" : "", passwd ? passwd : "", options ? options : ""); /* diff --git a/src/interfaces/ecpg/ecpglib/error.c b/src/interfaces/ecpg/ecpglib/error.c index 5451fd2981..a8f3b051ff 100644 --- a/src/interfaces/ecpg/ecpglib/error.c +++ b/src/interfaces/ecpg/ecpglib/error.c @@ -1,4 +1,4 @@ -/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/error.c,v 1.26 2010/05/08 16:39:52 tgl Exp $ */ +/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/error.c,v 1.27 2010/07/06 19:19:00 momjian Exp $ */ #define POSTGRES_ECPG_INTERNAL #include "postgres_fe.h" @@ -308,8 +308,10 @@ ecpg_raise_backend(int line, PGresult *result, PGconn *conn, int compat) if (strcmp(sqlstate, ECPG_SQLSTATE_ECPG_INTERNAL_ERROR) == 0) { - /* we might get here if the connection breaks down, so let's - * check for this instead of giving just the generic internal error */ + /* + * we might get here if the connection breaks down, so let's check for + * this instead of giving just the generic internal error + */ if (PQstatus(conn) == CONNECTION_BAD) { sqlstate = "57P02"; diff --git a/src/interfaces/ecpg/ecpglib/execute.c b/src/interfaces/ecpg/ecpglib/execute.c index 868bc699b0..72eed58746 100644 --- a/src/interfaces/ecpg/ecpglib/execute.c +++ b/src/interfaces/ecpg/ecpglib/execute.c @@ -1,4 +1,4 @@ -/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/execute.c,v 1.97 2010/05/25 17:28:20 meskes Exp $ */ +/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/execute.c,v 1.98 2010/07/06 19:19:00 momjian Exp $ */ /* * The aim is to get a simpler inteface to the database routines. @@ -708,7 +708,7 @@ ecpg_store_input(const int lineno, const bool force_indicator, const struct vari strcpy(mallocedval, "array ["); for (element = 0; element < asize; element++) - sprintf(mallocedval + strlen(mallocedval), "%llu,", ((unsigned long long int*) var->value)[element]); + sprintf(mallocedval + strlen(mallocedval), "%llu,", ((unsigned long long int *) var->value)[element]); strcpy(mallocedval + strlen(mallocedval) - 1, "]"); } diff --git a/src/interfaces/ecpg/ecpglib/misc.c b/src/interfaces/ecpg/ecpglib/misc.c index 6095c04b62..9a5dca763b 100644 --- a/src/interfaces/ecpg/ecpglib/misc.c +++ b/src/interfaces/ecpg/ecpglib/misc.c @@ -1,4 +1,4 @@ -/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/misc.c,v 1.58 2010/05/25 17:28:20 meskes Exp $ */ +/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/misc.c,v 1.59 2010/07/06 19:19:00 momjian Exp $ */ #define POSTGRES_ECPG_INTERNAL #include "postgres_fe.h" @@ -23,9 +23,9 @@ #define LONG_LONG_MIN LLONG_MIN #else #define LONG_LONG_MIN LONGLONG_MIN -#endif /* LLONG_MIN */ -#endif /* LONG_LONG_MIN */ -#endif /* HAVE_LONG_LONG_INT */ +#endif /* LLONG_MIN */ +#endif /* LONG_LONG_MIN */ +#endif /* HAVE_LONG_LONG_INT */ bool ecpg_internal_regression_mode = false; diff --git a/src/interfaces/ecpg/preproc/ecpg.c b/src/interfaces/ecpg/preproc/ecpg.c index 3247e95982..db52bf5c20 100644 --- a/src/interfaces/ecpg/preproc/ecpg.c +++ b/src/interfaces/ecpg/preproc/ecpg.c @@ -1,4 +1,4 @@ -/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.c,v 1.115 2010/04/03 19:30:49 meskes Exp $ */ +/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.c,v 1.116 2010/07/06 19:19:00 momjian Exp $ */ /* Main for ecpg, the PostgreSQL embedded SQL precompiler. */ /* Copyright (c) 1996-2010, PostgreSQL Global Development Group */ @@ -469,6 +469,7 @@ main(int argc, char *const argv[]) fclose(yyin); if (out_option == 0 && yyout != stdout) fclose(yyout); + /* * If there was an error, delete the output file. */ diff --git a/src/interfaces/ecpg/preproc/type.c b/src/interfaces/ecpg/preproc/type.c index 32fb144a70..eb7d4aeb9b 100644 --- a/src/interfaces/ecpg/preproc/type.c +++ b/src/interfaces/ecpg/preproc/type.c @@ -1,4 +1,4 @@ -/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/type.c,v 1.92 2010/04/03 07:53:29 petere Exp $ */ +/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/type.c,v 1.93 2010/07/06 19:19:00 momjian Exp $ */ #include "postgres_fe.h" @@ -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_siz, const char *struct_sizeof, const char *ind_struct_sizeof) diff --git a/src/interfaces/ecpg/test/expected/preproc-outofscope.c b/src/interfaces/ecpg/test/expected/preproc-outofscope.c index d510eb0e03..e8c4f5c0b4 100644 --- a/src/interfaces/ecpg/test/expected/preproc-outofscope.c +++ b/src/interfaces/ecpg/test/expected/preproc-outofscope.c @@ -100,61 +100,63 @@ int PGTYPESnumeric_from_decimal(decimal *, numeric *); #line 1 "struct.h" - - - - /* dec_t */ - - + + + + + /* dec_t */ + + typedef struct mytype MYTYPE ; -#line 9 "struct.h" +#line 10 "struct.h" - - - - - - + + + + + + + typedef struct mynulltype MYNULLTYPE ; -#line 18 "struct.h" +#line 20 "struct.h" #line 11 "outofscope.pgc" struct mytype { -#line 3 "struct.h" +#line 4 "struct.h" int id ; -#line 4 "struct.h" +#line 5 "struct.h" char t [ 64 ] ; -#line 5 "struct.h" +#line 6 "struct.h" double d1 ; -#line 6 "struct.h" +#line 7 "struct.h" double d2 ; -#line 7 "struct.h" +#line 8 "struct.h" char c [ 30 ] ; } ; struct mynulltype { -#line 12 "struct.h" +#line 14 "struct.h" int id ; -#line 13 "struct.h" +#line 15 "struct.h" int t ; -#line 14 "struct.h" +#line 16 "struct.h" int d1 ; -#line 15 "struct.h" +#line 17 "struct.h" int d2 ; -#line 16 "struct.h" +#line 18 "struct.h" int c ; } ;/* exec sql end declare section */ #line 12 "outofscope.pgc" diff --git a/src/interfaces/ecpg/test/expected/preproc-strings.c b/src/interfaces/ecpg/test/expected/preproc-strings.c index dd13cf36cf..310dbb837e 100644 --- a/src/interfaces/ecpg/test/expected/preproc-strings.c +++ b/src/interfaces/ecpg/test/expected/preproc-strings.c @@ -18,7 +18,12 @@ #line 3 "strings.pgc" /* exec sql begin declare section */ #line 1 "strings.h" - + + + + + + #line 5 "strings.pgc" diff --git a/src/interfaces/ecpg/test/preproc/strings.h b/src/interfaces/ecpg/test/preproc/strings.h index 4779af9881..07c04f9103 100644 --- a/src/interfaces/ecpg/test/preproc/strings.h +++ b/src/interfaces/ecpg/test/preproc/strings.h @@ -1 +1,6 @@ -char *s1, *s2, *s3, *s4, *s5, *s6; +char *s1, + *s2, + *s3, + *s4, + *s5, + *s6; diff --git a/src/interfaces/ecpg/test/preproc/struct.h b/src/interfaces/ecpg/test/preproc/struct.h index cc4681b74f..75e802ac6f 100644 --- a/src/interfaces/ecpg/test/preproc/struct.h +++ b/src/interfaces/ecpg/test/preproc/struct.h @@ -1,18 +1,20 @@ -struct mytype { - int id; - char t[64]; - double d1; /* dec_t */ - double d2; - char c[30]; +struct mytype +{ + int id; + char t[64]; + double d1; /* dec_t */ + double d2; + char c[30]; }; typedef struct mytype MYTYPE; -struct mynulltype { - int id; - int t; - int d1; - int d2; - int c; +struct mynulltype +{ + int id; + int t; + int d1; + int d2; + int c; }; typedef struct mynulltype MYNULLTYPE; |
