diff options
| author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2020-01-30 13:42:14 -0300 |
|---|---|---|
| committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2020-01-30 13:42:14 -0300 |
| commit | c9d29775195922136c09cc980bb1b7091bf3d859 (patch) | |
| tree | 2a7ffae1890975a24c18aa92f6dfe5307051492a /src/backend/utils | |
| parent | 4e89c79a52f8a898edd648b56a00f0f4f840cfe7 (diff) | |
| download | postgresql-c9d29775195922136c09cc980bb1b7091bf3d859.tar.gz | |
Clean up newlines following left parentheses
We used to strategically place newlines after some function call left
parentheses to make pgindent move the argument list a few chars to the
left, so that the whole line would fit under 80 chars. However,
pgindent no longer does that, so the newlines just made the code
vertically longer for no reason. Remove those newlines, and reflow some
of those lines for some extra naturality.
Reviewed-by: Michael Paquier, Tom Lane
Discussion: https://postgr.es/m/20200129200401.GA6303@alvherre.pgsql
Diffstat (limited to 'src/backend/utils')
| -rw-r--r-- | src/backend/utils/adt/formatting.c | 3 | ||||
| -rw-r--r-- | src/backend/utils/adt/pgstatfuncs.c | 6 | ||||
| -rw-r--r-- | src/backend/utils/adt/rangetypes_spgist.c | 3 | ||||
| -rw-r--r-- | src/backend/utils/adt/rangetypes_typanalyze.c | 9 | ||||
| -rw-r--r-- | src/backend/utils/adt/ruleutils.c | 3 | ||||
| -rw-r--r-- | src/backend/utils/adt/timestamp.c | 6 | ||||
| -rw-r--r-- | src/backend/utils/adt/tsgistidx.c | 12 | ||||
| -rw-r--r-- | src/backend/utils/adt/tsquery_op.c | 11 | ||||
| -rw-r--r-- | src/backend/utils/adt/tsvector_op.c | 22 | ||||
| -rw-r--r-- | src/backend/utils/misc/pg_controldata.c | 3 |
10 files changed, 31 insertions, 47 deletions
diff --git a/src/backend/utils/adt/formatting.c b/src/backend/utils/adt/formatting.c index 792f9ca4fa..f58331de75 100644 --- a/src/backend/utils/adt/formatting.c +++ b/src/backend/utils/adt/formatting.c @@ -6217,8 +6217,7 @@ int8_to_char(PG_FUNCTION_ARGS) if (IS_ROMAN(&Num)) { /* Currently don't support int8 conversion to roman... */ - numstr = orgnum = int_to_roman(DatumGetInt32( - DirectFunctionCall1(int84, Int64GetDatum(value)))); + numstr = orgnum = int_to_roman(DatumGetInt32(DirectFunctionCall1(int84, Int64GetDatum(value)))); } else if (IS_EEEE(&Num)) { diff --git a/src/backend/utils/adt/pgstatfuncs.c b/src/backend/utils/adt/pgstatfuncs.c index 74f899f24d..7b2da2b36f 100644 --- a/src/backend/utils/adt/pgstatfuncs.c +++ b/src/backend/utils/adt/pgstatfuncs.c @@ -1501,8 +1501,7 @@ pg_stat_get_db_conflict_all(PG_FUNCTION_ARGS) if ((dbentry = pgstat_fetch_stat_dbentry(dbid)) == NULL) result = 0; else - result = (int64) ( - dbentry->n_conflict_tablespace + + result = (int64) (dbentry->n_conflict_tablespace + dbentry->n_conflict_lock + dbentry->n_conflict_snapshot + dbentry->n_conflict_bufferpin + @@ -1973,6 +1972,5 @@ pg_stat_get_archiver(PG_FUNCTION_ARGS) values[6] = TimestampTzGetDatum(archiver_stats->stat_reset_timestamp); /* Returns the record as Datum */ - PG_RETURN_DATUM(HeapTupleGetDatum( - heap_form_tuple(tupdesc, values, nulls))); + PG_RETURN_DATUM(HeapTupleGetDatum(heap_form_tuple(tupdesc, values, nulls))); } diff --git a/src/backend/utils/adt/rangetypes_spgist.c b/src/backend/utils/adt/rangetypes_spgist.c index 6fbd523bbb..dd2bc742aa 100644 --- a/src/backend/utils/adt/rangetypes_spgist.c +++ b/src/backend/utils/adt/rangetypes_spgist.c @@ -346,8 +346,7 @@ spg_range_quad_inner_consistent(PG_FUNCTION_ARGS) * is RANGESTRAT_CONTAINS_ELEM. */ if (strategy != RANGESTRAT_CONTAINS_ELEM) - empty = RangeIsEmpty( - DatumGetRangeTypeP(in->scankeys[i].sk_argument)); + empty = RangeIsEmpty(DatumGetRangeTypeP(in->scankeys[i].sk_argument)); else empty = false; diff --git a/src/backend/utils/adt/rangetypes_typanalyze.c b/src/backend/utils/adt/rangetypes_typanalyze.c index fe6a75a0ca..57413b0720 100644 --- a/src/backend/utils/adt/rangetypes_typanalyze.c +++ b/src/backend/utils/adt/rangetypes_typanalyze.c @@ -165,8 +165,7 @@ compute_range_stats(VacAttrStats *stats, AnalyzeAttrFetchFunc fetchfunc, * For an ordinary range, use subdiff function between upper * and lower bound values. */ - length = DatumGetFloat8(FunctionCall2Coll( - &typcache->rng_subdiff_finfo, + length = DatumGetFloat8(FunctionCall2Coll(&typcache->rng_subdiff_finfo, typcache->rng_collation, upper.val, lower.val)); } @@ -246,8 +245,10 @@ compute_range_stats(VacAttrStats *stats, AnalyzeAttrFetchFunc fetchfunc, for (i = 0; i < num_hist; i++) { - bound_hist_values[i] = PointerGetDatum(range_serialize( - typcache, &lowers[pos], &uppers[pos], false)); + bound_hist_values[i] = PointerGetDatum(range_serialize(typcache, + &lowers[pos], + &uppers[pos], + false)); pos += delta; posfrac += deltafrac; if (posfrac >= (num_hist - 1)) diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c index 116e00bce4..158784474d 100644 --- a/src/backend/utils/adt/ruleutils.c +++ b/src/backend/utils/adt/ruleutils.c @@ -6453,8 +6453,7 @@ get_update_query_targetlist_def(Query *query, List *targetList, { cur_ma_sublink = (SubLink *) lfirst(next_ma_cell); next_ma_cell = lnext(ma_sublinks, next_ma_cell); - remaining_ma_columns = count_nonjunk_tlist_entries( - ((Query *) cur_ma_sublink->subselect)->targetList); + remaining_ma_columns = count_nonjunk_tlist_entries(((Query *) cur_ma_sublink->subselect)->targetList); Assert(((Param *) expr)->paramid == ((cur_ma_sublink->subLinkId << 16) | 1)); appendStringInfoChar(buf, '('); diff --git a/src/backend/utils/adt/timestamp.c b/src/backend/utils/adt/timestamp.c index ef99365b87..0b6c9d5ea8 100644 --- a/src/backend/utils/adt/timestamp.c +++ b/src/backend/utils/adt/timestamp.c @@ -5459,8 +5459,7 @@ generate_series_timestamp(PG_FUNCTION_ARGS) timestamp_cmp_internal(result, fctx->finish) >= 0) { /* increment current in preparation for next iteration */ - fctx->current = DatumGetTimestamp( - DirectFunctionCall2(timestamp_pl_interval, + fctx->current = DatumGetTimestamp(DirectFunctionCall2(timestamp_pl_interval, TimestampGetDatum(fctx->current), PointerGetDatum(&fctx->step))); @@ -5540,8 +5539,7 @@ generate_series_timestamptz(PG_FUNCTION_ARGS) timestamp_cmp_internal(result, fctx->finish) >= 0) { /* increment current in preparation for next iteration */ - fctx->current = DatumGetTimestampTz( - DirectFunctionCall2(timestamptz_pl_interval, + fctx->current = DatumGetTimestampTz(DirectFunctionCall2(timestamptz_pl_interval, TimestampTzGetDatum(fctx->current), PointerGetDatum(&fctx->step))); diff --git a/src/backend/utils/adt/tsgistidx.c b/src/backend/utils/adt/tsgistidx.c index 7fd32bcceb..8320dcda80 100644 --- a/src/backend/utils/adt/tsgistidx.c +++ b/src/backend/utils/adt/tsgistidx.c @@ -704,9 +704,9 @@ gtsvector_picksplit(PG_FUNCTION_ARGS) if (ISALLTRUE(datum_l) && cache[j].allistrue) size_alpha = 0; else - size_alpha = SIGLENBIT - sizebitvec( - (cache[j].allistrue) ? GETSIGN(datum_l) : GETSIGN(cache[j].sign) - ); + size_alpha = SIGLENBIT - sizebitvec((cache[j].allistrue) ? + GETSIGN(datum_l) : + GETSIGN(cache[j].sign)); } else size_alpha = hemdistsign(cache[j].sign, GETSIGN(datum_l)); @@ -716,9 +716,9 @@ gtsvector_picksplit(PG_FUNCTION_ARGS) if (ISALLTRUE(datum_r) && cache[j].allistrue) size_beta = 0; else - size_beta = SIGLENBIT - sizebitvec( - (cache[j].allistrue) ? GETSIGN(datum_r) : GETSIGN(cache[j].sign) - ); + size_beta = SIGLENBIT - sizebitvec((cache[j].allistrue) ? + GETSIGN(datum_r) : + GETSIGN(cache[j].sign)); } else size_beta = hemdistsign(cache[j].sign, GETSIGN(datum_r)); diff --git a/src/backend/utils/adt/tsquery_op.c b/src/backend/utils/adt/tsquery_op.c index 663b434b6a..ea40804110 100644 --- a/src/backend/utils/adt/tsquery_op.c +++ b/src/backend/utils/adt/tsquery_op.c @@ -148,8 +148,7 @@ tsquery_phrase_distance(PG_FUNCTION_ARGS) Datum tsquery_phrase(PG_FUNCTION_ARGS) { - PG_RETURN_POINTER(DirectFunctionCall3( - tsquery_phrase_distance, + PG_RETURN_POINTER(DirectFunctionCall3(tsquery_phrase_distance, PG_GETARG_DATUM(0), PG_GETARG_DATUM(1), Int32GetDatum(1))); @@ -353,11 +352,7 @@ tsq_mcontains(PG_FUNCTION_ARGS) Datum tsq_mcontained(PG_FUNCTION_ARGS) { - PG_RETURN_DATUM( - DirectFunctionCall2( - tsq_mcontains, + PG_RETURN_DATUM(DirectFunctionCall2(tsq_mcontains, PG_GETARG_DATUM(1), - PG_GETARG_DATUM(0) - ) - ); + PG_GETARG_DATUM(0))); } diff --git a/src/backend/utils/adt/tsvector_op.c b/src/backend/utils/adt/tsvector_op.c index e33ca5abe7..cab6874e70 100644 --- a/src/backend/utils/adt/tsvector_op.c +++ b/src/backend/utils/adt/tsvector_op.c @@ -666,9 +666,7 @@ tsvector_unnest(PG_FUNCTION_ARGS) bool nulls[] = {false, false, false}; Datum values[3]; - values[0] = PointerGetDatum( - cstring_to_text_with_len(data + arrin[i].pos, arrin[i].len) - ); + values[0] = PointerGetDatum(cstring_to_text_with_len(data + arrin[i].pos, arrin[i].len)); if (arrin[i].haspos) { @@ -689,15 +687,14 @@ tsvector_unnest(PG_FUNCTION_ARGS) { positions[j] = Int16GetDatum(WEP_GETPOS(posv->pos[j])); weight = 'D' - WEP_GETWEIGHT(posv->pos[j]); - weights[j] = PointerGetDatum( - cstring_to_text_with_len(&weight, 1) - ); + weights[j] = PointerGetDatum(cstring_to_text_with_len(&weight, + 1)); } - values[1] = PointerGetDatum( - construct_array(positions, posv->npos, INT2OID, 2, true, 's')); - values[2] = PointerGetDatum( - construct_array(weights, posv->npos, TEXTOID, -1, false, 'i')); + values[1] = PointerGetDatum(construct_array(positions, posv->npos, + INT2OID, 2, true, 's')); + values[2] = PointerGetDatum(construct_array(weights, posv->npos, + TEXTOID, -1, false, 'i')); } else { @@ -730,9 +727,8 @@ tsvector_to_array(PG_FUNCTION_ARGS) for (i = 0; i < tsin->size; i++) { - elements[i] = PointerGetDatum( - cstring_to_text_with_len(STRPTR(tsin) + arrin[i].pos, arrin[i].len) - ); + elements[i] = PointerGetDatum(cstring_to_text_with_len(STRPTR(tsin) + arrin[i].pos, + arrin[i].len)); } array = construct_array(elements, tsin->size, TEXTOID, -1, false, 'i'); diff --git a/src/backend/utils/misc/pg_controldata.c b/src/backend/utils/misc/pg_controldata.c index f2b4997392..419b58330f 100644 --- a/src/backend/utils/misc/pg_controldata.c +++ b/src/backend/utils/misc/pg_controldata.c @@ -199,8 +199,7 @@ pg_control_checkpoint(PG_FUNCTION_ARGS) values[16] = TransactionIdGetDatum(ControlFile->checkPointCopy.newestCommitTsXid); nulls[16] = false; - values[17] = TimestampTzGetDatum( - time_t_to_timestamptz(ControlFile->checkPointCopy.time)); + values[17] = TimestampTzGetDatum(time_t_to_timestamptz(ControlFile->checkPointCopy.time)); nulls[17] = false; htup = heap_form_tuple(tupdesc, values, nulls); |
