diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2017-06-21 15:35:54 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2017-06-21 15:35:54 -0400 |
commit | 382ceffdf7f620d8f2d50e451b4167d291ae2348 (patch) | |
tree | f558251492f2c6f86e3566f7a82f9d00509122c2 /src/backend/utils/cache | |
parent | c7b8998ebbf310a156aa38022555a24d98fdbfb4 (diff) | |
download | postgresql-382ceffdf7f620d8f2d50e451b4167d291ae2348.tar.gz postgresql-382ceffdf7f620d8f2d50e451b4167d291ae2348.zip |
Phase 3 of pgindent updates.
Don't move parenthesized lines to the left, even if that means they
flow past the right margin.
By default, BSD indent lines up statement continuation lines that are
within parentheses so that they start just to the right of the preceding
left parenthesis. However, traditionally, if that resulted in the
continuation line extending to the right of the desired right margin,
then indent would push it left just far enough to not overrun the margin,
if it could do so without making the continuation line start to the left of
the current statement indent. That makes for a weird mix of indentations
unless one has been completely rigid about never violating the 80-column
limit.
This behavior has been pretty universally panned by Postgres developers.
Hence, disable it with indent's new -lpl switch, so that parenthesized
lines are always lined up with the preceding left paren.
This patch is much less interesting than the first round of indent
changes, but also bulkier, so I thought it best to separate the effects.
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/backend/utils/cache')
-rw-r--r-- | src/backend/utils/cache/inval.c | 8 | ||||
-rw-r--r-- | src/backend/utils/cache/plancache.c | 4 | ||||
-rw-r--r-- | src/backend/utils/cache/relcache.c | 22 | ||||
-rw-r--r-- | src/backend/utils/cache/relmapper.c | 4 | ||||
-rw-r--r-- | src/backend/utils/cache/ts_cache.c | 2 |
5 files changed, 20 insertions, 20 deletions
diff --git a/src/backend/utils/cache/inval.c b/src/backend/utils/cache/inval.c index 5652c3abe07..d0e54b85352 100644 --- a/src/backend/utils/cache/inval.c +++ b/src/backend/utils/cache/inval.c @@ -236,7 +236,7 @@ AddInvalidationMessage(InvalidationChunk **listHdr, chunk = (InvalidationChunk *) MemoryContextAlloc(CurTransactionContext, offsetof(InvalidationChunk, msgs) + - FIRSTCHUNKSIZE * sizeof(SharedInvalidationMessage)); + FIRSTCHUNKSIZE * sizeof(SharedInvalidationMessage)); chunk->nitems = 0; chunk->maxitems = FIRSTCHUNKSIZE; chunk->next = *listHdr; @@ -464,7 +464,7 @@ ProcessInvalidationMessages(InvalidationListHeader *hdr, */ static void ProcessInvalidationMessagesMulti(InvalidationListHeader *hdr, - void (*func) (const SharedInvalidationMessage *msgs, int n)) + void (*func) (const SharedInvalidationMessage *msgs, int n)) { ProcessMessageListMulti(hdr->cclist, func(msgs, n)); ProcessMessageListMulti(hdr->rclist, func(msgs, n)); @@ -778,7 +778,7 @@ MakeSharedInvalidMessagesArray(const SharedInvalidationMessage *msgs, int n) * We're so close to EOXact that we now we're going to lose it anyhow. */ SharedInvalidMessagesArray = palloc(maxSharedInvalidMessagesArray - * sizeof(SharedInvalidationMessage)); + * sizeof(SharedInvalidationMessage)); } if ((numSharedInvalidMessagesArray + n) > maxSharedInvalidMessagesArray) @@ -788,7 +788,7 @@ MakeSharedInvalidMessagesArray(const SharedInvalidationMessage *msgs, int n) SharedInvalidMessagesArray = repalloc(SharedInvalidMessagesArray, maxSharedInvalidMessagesArray - * sizeof(SharedInvalidationMessage)); + * sizeof(SharedInvalidationMessage)); } /* diff --git a/src/backend/utils/cache/plancache.c b/src/backend/utils/cache/plancache.c index dfe5592a25a..ad8a82f1e3f 100644 --- a/src/backend/utils/cache/plancache.c +++ b/src/backend/utils/cache/plancache.c @@ -1180,7 +1180,7 @@ GetCachedPlan(CachedPlanSource *plansource, ParamListInfo boundParams, { /* otherwise, it should be a sibling of the plansource */ MemoryContextSetParent(plan->context, - MemoryContextGetParent(plansource->context)); + MemoryContextGetParent(plansource->context)); } /* Update generic_cost whenever we make a new generic plan */ plansource->generic_cost = cached_plan_cost(plan, false); @@ -1520,7 +1520,7 @@ AcquireExecutorLocks(List *stmt_list, bool acquire) * acquire a non-conflicting lock. */ if (list_member_int(plannedstmt->resultRelations, rt_index) || - list_member_int(plannedstmt->nonleafResultRelations, rt_index)) + list_member_int(plannedstmt->nonleafResultRelations, rt_index)) lockmode = RowExclusiveLock; else if ((rc = get_plan_rowmark(plannedstmt->rowMarks, rt_index)) != NULL && RowMarkRequiresRowShareLock(rc->markType)) diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c index 93bcac1e776..43238dd8cbd 100644 --- a/src/backend/utils/cache/relcache.c +++ b/src/backend/utils/cache/relcache.c @@ -627,7 +627,7 @@ RelationBuildTupleDesc(Relation relation) constr->num_check = relation->rd_rel->relchecks; constr->check = (ConstrCheck *) MemoryContextAllocZero(CacheMemoryContext, - constr->num_check * sizeof(ConstrCheck)); + constr->num_check * sizeof(ConstrCheck)); CheckConstraintFetch(relation); } else @@ -1446,7 +1446,7 @@ RelationInitPhysicalAddr(Relation relation) Form_pg_class physrel; phys_tuple = ScanPgRelation(RelationGetRelid(relation), - RelationGetRelid(relation) != ClassOidIndexId, + RelationGetRelid(relation) != ClassOidIndexId, true); if (!HeapTupleIsValid(phys_tuple)) elog(ERROR, "could not find pg_class entry for %u", @@ -2889,7 +2889,7 @@ RememberToFreeTupleDescAtEOX(TupleDesc td) Assert(EOXactTupleDescArrayLen > 0); EOXactTupleDescArray = (TupleDesc *) repalloc(EOXactTupleDescArray, - newlen * sizeof(TupleDesc)); + newlen * sizeof(TupleDesc)); EOXactTupleDescArrayLen = newlen; } @@ -3782,7 +3782,7 @@ RelationCacheInitializePhase3(void) Form_pg_class relp; htup = SearchSysCache1(RELOID, - ObjectIdGetDatum(RelationGetRelid(relation))); + ObjectIdGetDatum(RelationGetRelid(relation))); if (!HeapTupleIsValid(htup)) elog(FATAL, "cache lookup failed for relation %u", RelationGetRelid(relation)); @@ -4045,7 +4045,7 @@ AttrDefaultFetch(Relation relation) continue; if (attrdef[i].adbin != NULL) elog(WARNING, "multiple attrdef records found for attr %s of rel %s", - NameStr(relation->rd_att->attrs[adform->adnum - 1]->attname), + NameStr(relation->rd_att->attrs[adform->adnum - 1]->attname), RelationGetRelationName(relation)); else found++; @@ -4055,7 +4055,7 @@ AttrDefaultFetch(Relation relation) adrel->rd_att, &isnull); if (isnull) elog(WARNING, "null adbin for attr %s of rel %s", - NameStr(relation->rd_att->attrs[adform->adnum - 1]->attname), + NameStr(relation->rd_att->attrs[adform->adnum - 1]->attname), RelationGetRelationName(relation)); else { @@ -4947,19 +4947,19 @@ restart: if (attrnum != 0) { indexattrs = bms_add_member(indexattrs, - attrnum - FirstLowInvalidHeapAttributeNumber); + attrnum - FirstLowInvalidHeapAttributeNumber); if (isKey) uindexattrs = bms_add_member(uindexattrs, - attrnum - FirstLowInvalidHeapAttributeNumber); + attrnum - FirstLowInvalidHeapAttributeNumber); if (isPK) pkindexattrs = bms_add_member(pkindexattrs, - attrnum - FirstLowInvalidHeapAttributeNumber); + attrnum - FirstLowInvalidHeapAttributeNumber); if (isIDKey) idindexattrs = bms_add_member(idindexattrs, - attrnum - FirstLowInvalidHeapAttributeNumber); + attrnum - FirstLowInvalidHeapAttributeNumber); } } @@ -5790,7 +5790,7 @@ write_relcache_init_file(bool shared) (errcode_for_file_access(), errmsg("could not create relation-cache initialization file \"%s\": %m", tempfilename), - errdetail("Continuing anyway, but there's something wrong."))); + errdetail("Continuing anyway, but there's something wrong."))); return; } diff --git a/src/backend/utils/cache/relmapper.c b/src/backend/utils/cache/relmapper.c index 6836c601e0e..f5394dc43d4 100644 --- a/src/backend/utils/cache/relmapper.c +++ b/src/backend/utils/cache/relmapper.c @@ -684,8 +684,8 @@ load_relmap_file(bool shared) if (!EQ_CRC32C(crc, map->crc)) ereport(FATAL, - (errmsg("relation mapping file \"%s\" contains incorrect checksum", - mapfilename))); + (errmsg("relation mapping file \"%s\" contains incorrect checksum", + mapfilename))); } /* diff --git a/src/backend/utils/cache/ts_cache.c b/src/backend/utils/cache/ts_cache.c index 88e4ffb66d9..da5c8ea345b 100644 --- a/src/backend/utils/cache/ts_cache.c +++ b/src/backend/utils/cache/ts_cache.c @@ -334,7 +334,7 @@ lookup_ts_dictionary_cache(Oid dictId) entry->dictData = DatumGetPointer(OidFunctionCall1(template->tmplinit, - PointerGetDatum(dictoptions))); + PointerGetDatum(dictoptions))); MemoryContextSwitchTo(oldcontext); } |