diff options
| author | Tom Lane | 2017-06-21 18:39:04 +0000 |
|---|---|---|
| committer | Tom Lane | 2017-06-21 18:39:04 +0000 |
| commit | e3860ffa4dd0dad0dd9eea4be9cc1412373a8c89 (patch) | |
| tree | 8dc7df95c340803546152724fbc17aee4b8527f9 /src/bin/pgbench | |
| parent | 8ff6d4ec7840b0af56f1207073f44b7f2afae96d (diff) | |
Initial pgindent run with pg_bsd_indent version 2.0.
The new indent version includes numerous fixes thanks to Piotr Stefaniak.
The main changes visible in this commit are:
* Nicer formatting of function-pointer declarations.
* No longer unexpectedly removes spaces in expressions using casts,
sizeof, or offsetof.
* No longer wants to add a space in "struct structname *varname", as
well as some similar cases for const- or volatile-qualified pointers.
* Declarations using PG_USED_FOR_ASSERTS_ONLY are formatted more nicely.
* Fixes bug where comments following declarations were sometimes placed
with no space separating them from the code.
* Fixes some odd decisions for comments following case labels.
* Fixes some cases where comments following code were indented to less
than the expected column 33.
On the less good side, it now tends to put more whitespace around typedef
names that are not listed in typedefs.list. This might encourage us to
put more effort into typedef name collection; it's not really a bug in
indent itself.
There are more changes coming after this round, having to do with comment
indentation and alignment of lines appearing within parentheses. I wanted
to limit the size of the diffs to something that could be reviewed without
one's eyes completely glazing over, so it seemed better to split up the
changes as much as practical.
Discussion: https://postgr.es/m/E1dAmxK-0006EE-1r@gemulon.postgresql.org
Discussion: https://postgr.es/m/30527.1495162840@sss.pgh.pa.us
Diffstat (limited to 'src/bin/pgbench')
| -rw-r--r-- | src/bin/pgbench/pgbench.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/bin/pgbench/pgbench.c b/src/bin/pgbench/pgbench.c index 14aa587a27..e420b37e39 100644 --- a/src/bin/pgbench/pgbench.c +++ b/src/bin/pgbench/pgbench.c @@ -1002,7 +1002,7 @@ makeVariableNumeric(Variable *var) setIntValue(&var->num_value, strtoint64(var->value)); var->is_numeric = true; } - else /* type should be double */ + else /* type should be double */ { double dv; char xs; @@ -1357,7 +1357,7 @@ evalFunc(TState *thread, CState *st, Assert(0); } } - else /* we have integer operands, or % */ + else /* we have integer operands, or % */ { int64 li, ri; @@ -1595,7 +1595,7 @@ evalFunc(TState *thread, CState *st, Assert(nargs == 2); setIntValue(retval, getrand(thread, imin, imax)); } - else /* gaussian & exponential */ + else /* gaussian & exponential */ { double param; @@ -1617,7 +1617,7 @@ evalFunc(TState *thread, CState *st, setIntValue(retval, getGaussianRand(thread, imin, imax, param)); } - else /* exponential */ + else /* exponential */ { if (param <= 0.0) { @@ -1899,7 +1899,7 @@ sendCommand(CState *st, Command *command) r = PQsendQueryPrepared(st->con, name, command->argc - 1, params, NULL, NULL, 0); } - else /* unknown sql mode */ + else /* unknown sql mode */ r = 0; if (r == 0) @@ -3397,7 +3397,7 @@ findBuiltin(const char *name) /* error cases */ if (found == 0) fprintf(stderr, "no builtin script found for name \"%s\"\n", name); - else /* found > 1 */ + else /* found > 1 */ fprintf(stderr, "ambiguous builtin name: %d builtin scripts found for prefix \"%s\"\n", found, name); @@ -4290,7 +4290,7 @@ main(int argc, char **argv) /* compute when to stop */ if (duration > 0) end_time = INSTR_TIME_GET_MICROSEC(thread->start_time) + - (int64) 1000000 *duration; + (int64) 1000000 * duration; /* the first thread (i = 0) is executed by main thread */ if (i > 0) @@ -4313,7 +4313,7 @@ main(int argc, char **argv) /* compute when to stop */ if (duration > 0) end_time = INSTR_TIME_GET_MICROSEC(threads[0].start_time) + - (int64) 1000000 *duration; + (int64) 1000000 * duration; threads[0].thread = INVALID_THREAD; #endif /* ENABLE_THREAD_SAFETY */ @@ -4690,7 +4690,7 @@ threadRun(void *arg) */ do { - next_report += (int64) progress *1000000; + next_report += (int64) progress * 1000000; } while (now >= next_report); } } |
