diff options
| author | Bruce Momjian <bruce@momjian.us> | 1998-06-15 19:30:31 +0000 |
|---|---|---|
| committer | Bruce Momjian <bruce@momjian.us> | 1998-06-15 19:30:31 +0000 |
| commit | 6bd323c6b3f65b26273d5efb7ddd0ac04d039546 (patch) | |
| tree | 6106db4e7512e765ca8c48963fb750cb63fec96f /src/bin | |
| parent | 27db9ecd0b15abca733a99dab3bf9771ad70507d (diff) | |
| download | postgresql-6bd323c6b3f65b26273d5efb7ddd0ac04d039546.tar.gz | |
Remove un-needed braces around single statements.
Diffstat (limited to 'src/bin')
| -rw-r--r-- | src/bin/pg_dump/common.c | 8 | ||||
| -rw-r--r-- | src/bin/pg_dump/pg_dump.c | 16 | ||||
| -rw-r--r-- | src/bin/pg_id/pg_id.c | 4 | ||||
| -rw-r--r-- | src/bin/pgtclsh/pgtclAppInit.c | 4 | ||||
| -rw-r--r-- | src/bin/pgtclsh/pgtkAppInit.c | 6 | ||||
| -rw-r--r-- | src/bin/psql/psql.c | 30 |
6 files changed, 4 insertions, 64 deletions
diff --git a/src/bin/pg_dump/common.c b/src/bin/pg_dump/common.c index dddc211ea8..bc58b8e45c 100644 --- a/src/bin/pg_dump/common.c +++ b/src/bin/pg_dump/common.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/bin/pg_dump/common.c,v 1.20 1998/02/26 04:38:41 momjian Exp $ + * $Header: /cvsroot/pgsql/src/bin/pg_dump/common.c,v 1.21 1998/06/15 19:30:00 momjian Exp $ * * Modifications - 6/12/96 - dave@bensoft.com - version 1.13.dhb.2 * @@ -126,9 +126,7 @@ findParentsByOid(TableInfo *tblinfo, int numTables, for (i = 0; i < numInherits; i++) { if (strcmp(inhinfo[i].inhrel, oid) == 0) - { numParents++; - } } *numParentsPtr = numParents; @@ -396,9 +394,7 @@ flagInhAttrs(TableInfo *tblinfo, int numTables, if (strInArray(tblinfo[i].attnames[j], tblinfo[parentInd].attnames, tblinfo[parentInd].numatts) != -1) - { tblinfo[i].inhAttrs[j] = 1; - } } } } @@ -493,8 +489,6 @@ fmtId(const char *rawid) cp = id; } else - { cp = rawid; - } return (cp); } /* fmtId() */ diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index f386231d14..b57c8bf85b 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -21,7 +21,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.71 1998/05/06 23:53:27 momjian Exp $ + * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.72 1998/06/15 19:30:01 momjian Exp $ * * Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb * @@ -351,9 +351,7 @@ dumpClasses_dumpData(FILE *fout, const char *classname, do { if (PQgetisnull(res, tuple, field)) - { fprintf(fout, "NULL"); - } else { switch (PQftype(res, field)) @@ -613,9 +611,7 @@ main(int argc, char **argv) /* open the output file */ if (filename == NULL) - { g_fout = stdout; - } else { g_fout = fopen(filename, "w"); @@ -688,9 +684,7 @@ main(int argc, char **argv) tblinfo = dumpSchema(NULL, &numTables, tablename, acls); if (!schemaOnly) - { dumpClasses(tblinfo, numTables, g_fout, tablename, oids); - } if (!dataOnly) /* dump indexes and triggers at the end * for performance */ @@ -2011,9 +2005,7 @@ dumpFuncs(FILE *fout, FuncInfo *finfo, int numFuncs, int i; for (i = 0; i < numFuncs; i++) - { dumpOneFunc(fout, finfo, i, tinfo, numTypes); - } } /* @@ -2228,9 +2220,7 @@ dumpAggs(FILE *fout, AggInfo *agginfo, int numAggs, if (strcmp(agginfo[i].aggfinalfn, "-") == 0) finalfunc[0] = '\0'; else - { sprintf(finalfunc, "FINALFUNC = %s", agginfo[i].aggfinalfn); - } if (sfunc1[0] != '\0' && sfunc2[0] != '\0') { comma1[0] = ','; @@ -2581,9 +2571,7 @@ dumpIndices(FILE *fout, IndInfo *indinfo, int numIndices, fmtId(indinfo[i].indrelname)); if (strcmp(indinfo[i].indproc, "0") == 0) - { funcname = NULL; - } else { @@ -2729,9 +2717,7 @@ dumpTuples(PGresult *res, FILE *fout, int *attrmap) for (j = 0; j < n; j++) { for (k = 0; k < m; k++) - { outVals[attrmap[k]] = PQgetvalue(res, j, k); - } for (k = 0; k < m; k++) { char *pval = outVals[k]; diff --git a/src/bin/pg_id/pg_id.c b/src/bin/pg_id/pg_id.c index b246131b84..7388946051 100644 --- a/src/bin/pg_id/pg_id.c +++ b/src/bin/pg_id/pg_id.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/bin/pg_id/Attic/pg_id.c,v 1.5 1997/09/08 02:32:52 momjian Exp $ + * $Header: /cvsroot/pgsql/src/bin/pg_id/Attic/pg_id.c,v 1.6 1998/06/15 19:30:03 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -53,9 +53,7 @@ main(int argc, char **argv) printf("%ld\n", (long) pw->pw_uid); } else - { printf("%ld\n", (long) getuid()); - } exit(0); } diff --git a/src/bin/pgtclsh/pgtclAppInit.c b/src/bin/pgtclsh/pgtclAppInit.c index f344dd403e..d121d28a14 100644 --- a/src/bin/pgtclsh/pgtclAppInit.c +++ b/src/bin/pgtclsh/pgtclAppInit.c @@ -76,9 +76,7 @@ int Tcl_AppInit(Tcl_Interp * interp) { if (Tcl_Init(interp) == TCL_ERROR) - { return TCL_ERROR; - } /* * Call the init procedures for included packages. Each call should @@ -90,9 +88,7 @@ Tcl_AppInit(Tcl_Interp * interp) */ if (Pgtcl_Init(interp) == TCL_ERROR) - { return TCL_ERROR; - } /* * Call Tcl_CreateCommand for application-specific commands, if they diff --git a/src/bin/pgtclsh/pgtkAppInit.c b/src/bin/pgtclsh/pgtkAppInit.c index bdb569cb3c..0bf685bd1a 100644 --- a/src/bin/pgtclsh/pgtkAppInit.c +++ b/src/bin/pgtclsh/pgtkAppInit.c @@ -75,13 +75,9 @@ int Tcl_AppInit(Tcl_Interp * interp) { if (Tcl_Init(interp) == TCL_ERROR) - { return TCL_ERROR; - } if (Tk_Init(interp) == TCL_ERROR) - { return TCL_ERROR; - } /* * Call the init procedures for included packages. Each call should @@ -93,9 +89,7 @@ Tcl_AppInit(Tcl_Interp * interp) */ if (Pgtcl_Init(interp) == TCL_ERROR) - { return TCL_ERROR; - } /* * Call Tcl_CreateCommand for application-specific commands, if they diff --git a/src/bin/psql/psql.c b/src/bin/psql/psql.c index e698f68fb5..9f699ad8d7 100644 --- a/src/bin/psql/psql.c +++ b/src/bin/psql/psql.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.144 1998/05/15 01:57:33 momjian Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.145 1998/06/15 19:30:07 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -307,9 +307,7 @@ handle_sigint (SIGNAL_ARGS) exit(1); /* accept signal if no connection */ /* Try to send cancel request */ if (PQrequestCancel(cancelConn)) - { fprintf(stderr, "\nCANCEL request sent\n"); - } else { fprintf(stderr, "\nCannot send cancel request:\n%s\n", @@ -1361,13 +1359,9 @@ do_copy(const char *args, PsqlSettings *pset) strcat(query, " TO stdout"); if (from) - { copystream = fopen(file, "r"); - } else - { copystream = fopen(file, "w"); - } if (copystream == NULL) fprintf(stderr, "Unable to open file %s which to copy, errno = %s (%d).", @@ -2176,9 +2170,7 @@ MainLoop(PsqlSettings *pset, char *query, FILE *source) } else - { query_alloced = true; - } } interactive = ((source == stdin) && !pset->notty); @@ -2321,9 +2313,7 @@ MainLoop(PsqlSettings *pset, char *query, FILE *source) strcat(query, query_start); } else - { strcpy(query, query_start); - } } line[i] = hold_char; query_start = line + i; @@ -2345,9 +2335,7 @@ MainLoop(PsqlSettings *pset, char *query, FILE *source) /* inside a quote? */ if (in_quote && (line[i] != '\'' || was_bslash)) - { /* do nothing */ ; - } else if (xcomment != NULL) /* inside an extended * comment? */ { @@ -2375,9 +2363,7 @@ MainLoop(PsqlSettings *pset, char *query, FILE *source) break; } else if (line[i] == '\'') - { in_quote ^= 1; - } /* semi-colon? then send query now */ else if (!paren_level && line[i] == ';') { @@ -2411,9 +2397,7 @@ MainLoop(PsqlSettings *pset, char *query, FILE *source) } else if (paren_level && line[i] == ')') - { paren_level--; - } } } @@ -2544,9 +2528,7 @@ main(int argc, char **argv) case 'c': singleQuery = strdup(optarg); if (singleQuery[0] == '\\') - { singleSlashCmd = 1; - } break; case 'd': dbname = optarg; @@ -2625,9 +2607,7 @@ main(int argc, char **argv) free(connect_string); } else - { settings.db = PQsetdb(host, port, NULL, NULL, dbname); - } dbname = PQdb(settings.db); @@ -2642,9 +2622,7 @@ main(int argc, char **argv) cancelConn = settings.db; /* enable SIGINT to send cancel */ if (listDatabases) - { exit(listAllDbs(&settings)); - } if (!settings.quiet && !settings.notty && !singleQuery && !qfilename) { printf("Welcome to the POSTGRESQL interactive sql monitor:\n"); @@ -2802,9 +2780,7 @@ handleCopyIn(PGresult *res, const bool mustprompt, FILE *copystream) for (; buflen > 1 && !(linedone = (c = getc(copystream)) == '\n' || c == EOF); --buflen) - { *s++ = c; - } if (c == EOF) { PQputline(res->conn, "\\."); @@ -2816,9 +2792,7 @@ handleCopyIn(PGresult *res, const bool mustprompt, FILE *copystream) if (firstload) { if (!strcmp(copybuf, "\\.")) - { copydone = true; - } firstload = false; } } @@ -2949,9 +2923,7 @@ make_connect_string(char *host, char *port, char *dbname, connect_string = (char *) malloc(connect_string_len); if (!connect_string) - { return 0; - } connect_string[0] = '\0'; if (host) { |
