diff options
author | Bruce Momjian <bruce@momjian.us> | 1999-05-25 16:15:34 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 1999-05-25 16:15:34 +0000 |
commit | 07842084fe3e11041f83563c851236395f481470 (patch) | |
tree | ab9960e67325bec5a97b8b4dd4b2075ce60cc420 /src/backend/utils/cache | |
parent | 4b04b01aaa460f1e52980f24173dc7a4535efd2d (diff) | |
download | postgresql-07842084fe3e11041f83563c851236395f481470.tar.gz postgresql-07842084fe3e11041f83563c851236395f481470.zip |
pgindent run over code.
Diffstat (limited to 'src/backend/utils/cache')
-rw-r--r-- | src/backend/utils/cache/catcache.c | 5 | ||||
-rw-r--r-- | src/backend/utils/cache/inval.c | 12 | ||||
-rw-r--r-- | src/backend/utils/cache/rel.c | 6 | ||||
-rw-r--r-- | src/backend/utils/cache/relcache.c | 39 | ||||
-rw-r--r-- | src/backend/utils/cache/syscache.c | 22 | ||||
-rw-r--r-- | src/backend/utils/cache/temprel.c | 34 |
6 files changed, 60 insertions, 58 deletions
diff --git a/src/backend/utils/cache/catcache.c b/src/backend/utils/cache/catcache.c index 869df05df7c..80444d0a143 100644 --- a/src/backend/utils/cache/catcache.c +++ b/src/backend/utils/cache/catcache.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.40 1999/05/10 00:46:03 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.41 1999/05/25 16:12:22 momjian Exp $ * * Notes: * XXX This needs to use exception.h to handle recovery when @@ -196,6 +196,7 @@ CatalogCacheInitializeCache(struct catcache * cache, if (cache->cc_key[i] > 0) { + /* * Yoiks. The implementation of the hashing code and the * implementation of int28's are at loggerheads. The right @@ -277,7 +278,7 @@ CatalogCacheSetId(CatCache *cacheInOutP, int id) #endif /* ---------------- - * comphash + * comphash * Compute a hash value, somehow. * * XXX explain algorithm here. diff --git a/src/backend/utils/cache/inval.c b/src/backend/utils/cache/inval.c index 40155b36aa1..7cf66e22808 100644 --- a/src/backend/utils/cache/inval.c +++ b/src/backend/utils/cache/inval.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/cache/inval.c,v 1.22 1999/05/10 00:46:07 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/cache/inval.c,v 1.23 1999/05/25 16:12:23 momjian Exp $ * * Note - this code is real crufty... * @@ -106,7 +106,7 @@ InvalidationEntryAllocate(uint16 size) } /* -------------------------------- - * LocalInvalidRegister + * LocalInvalidRegister * Returns a new local cache invalidation state containing a new entry. * -------------------------------- */ @@ -117,7 +117,7 @@ LocalInvalidRegister(LocalInvalid invalid, Assert(PointerIsValid(entry)); ((InvalidationUserData *) entry)->dataP[-1] = - (InvalidationUserData *) invalid; + (InvalidationUserData *) invalid; return entry; } @@ -504,7 +504,7 @@ InitLocalInvalidateData() /* - * DiscardInvalid + * DiscardInvalid * Causes the invalidated cache state to be discarded. * * Note: @@ -527,7 +527,7 @@ DiscardInvalid() } /* - * RegisterInvalid + * RegisterInvalid * Causes registration of invalidated state with other backends iff true. * * Note: @@ -559,7 +559,7 @@ RegisterInvalid(bool send) } /* - * RelationIdInvalidateHeapTuple + * RelationIdInvalidateHeapTuple * Causes the given tuple in a relation to be invalidated. * * Note: diff --git a/src/backend/utils/cache/rel.c b/src/backend/utils/cache/rel.c index 0603f675520..f37a97b34f6 100644 --- a/src/backend/utils/cache/rel.c +++ b/src/backend/utils/cache/rel.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/cache/Attic/rel.c,v 1.4 1999/02/13 23:19:43 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/cache/Attic/rel.c,v 1.5 1999/05/25 16:12:23 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -29,7 +29,7 @@ */ /* - * RelationGetIndexStrategy + * RelationGetIndexStrategy * Returns index strategy for a relation. * * Note: @@ -43,7 +43,7 @@ RelationGetIndexStrategy(Relation relation) } /* - * RelationSetIndexSupport + * RelationSetIndexSupport * Sets index strategy and support info for a relation. * * Note: diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c index 4affb0f6aec..f8c73b7b22c 100644 --- a/src/backend/utils/cache/relcache.c +++ b/src/backend/utils/cache/relcache.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.61 1999/05/10 00:46:08 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.62 1999/05/25 16:12:23 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -396,7 +396,7 @@ scan_pg_rel_ind(RelationBuildDescInfo buildinfo) switch (buildinfo.infotype) { case INFO_RELID: - return_tuple = ClassOidIndexScan(pg_class_desc,buildinfo.i.info_id); + return_tuple = ClassOidIndexScan(pg_class_desc, buildinfo.i.info_id); break; case INFO_RELNAME: @@ -707,20 +707,20 @@ RelationBuildRuleLock(Relation relation) rule->event = (int) heap_getattr(pg_rewrite_tuple, Anum_pg_rewrite_ev_type, pg_rewrite_tupdesc, - &isnull) - 48; + &isnull) - 48; rule->attrno = (int) heap_getattr(pg_rewrite_tuple, Anum_pg_rewrite_ev_attr, pg_rewrite_tupdesc, - &isnull); + &isnull); rule->isInstead = !!heap_getattr(pg_rewrite_tuple, - Anum_pg_rewrite_is_instead, pg_rewrite_tupdesc, - &isnull); + Anum_pg_rewrite_is_instead, pg_rewrite_tupdesc, + &isnull); ruleaction = heap_getattr(pg_rewrite_tuple, - Anum_pg_rewrite_ev_action, pg_rewrite_tupdesc, - &isnull); + Anum_pg_rewrite_ev_action, pg_rewrite_tupdesc, + &isnull); rule_evqual_string = heap_getattr(pg_rewrite_tuple, - Anum_pg_rewrite_ev_qual, pg_rewrite_tupdesc, - &isnull); + Anum_pg_rewrite_ev_qual, pg_rewrite_tupdesc, + &isnull); ruleaction = PointerGetDatum(textout((struct varlena *) DatumGetPointer(ruleaction))); rule_evqual_string = PointerGetDatum(textout((struct varlena *) DatumGetPointer(rule_evqual_string))); @@ -851,9 +851,7 @@ RelationBuildDesc(RelationBuildDescInfo buildinfo) * ---------------- */ if (OidIsValid(relam)) - { relation->rd_am = (Form_pg_am) AccessMethodObjectIdGetForm(relam); - } /* ---------------- * initialize the tuple descriptor (relation->rd_att). @@ -1331,13 +1329,13 @@ RelationForgetRelation(Oid rid) MemoryContext oldcxt; List *curr; List *prev = NIL; - + oldcxt = MemoryContextSwitchTo((MemoryContext) CacheCxt); - + foreach(curr, newlyCreatedRelns) { Relation reln = lfirst(curr); - + Assert(reln != NULL && reln->rd_myxactonly); if (RelationGetRelid(reln) == rid) break; @@ -1353,7 +1351,7 @@ RelationForgetRelation(Oid rid) pfree(curr); MemoryContextSwitchTo(oldcxt); } - + RelationFlushRelation(&relation, false); } } @@ -1378,6 +1376,7 @@ RelationIdInvalidateRelationCacheByRelationId(Oid relationId) */ if (PointerIsValid(relation) && !relation->rd_myxactonly) { + /* * The boolean onlyFlushReferenceCountZero in RelationFlushReln() * should be set to true when we are incrementing the command @@ -1484,8 +1483,8 @@ RelationRegisterRelation(Relation relation) /* * we've just created the relation. It is invisible to anyone else - * before the transaction is committed. Setting rd_myxactonly allows us - * to use the local buffer manager for select/insert/etc before the + * before the transaction is committed. Setting rd_myxactonly allows + * us to use the local buffer manager for select/insert/etc before the * end of transaction. (We also need to keep track of relations * created during a transaction and does the necessary clean up at the * end of the transaction.) - ay 3/95 @@ -1634,7 +1633,7 @@ AttrDefaultFetch(Relation relation) Relation adrel; Relation irel; ScanKeyData skey; - HeapTupleData tuple; + HeapTupleData tuple; Form_pg_attrdef adform; IndexScanDesc sd; RetrieveIndexResult indexRes; @@ -1722,7 +1721,7 @@ RelCheckFetch(Relation relation) Relation rcrel; Relation irel; ScanKeyData skey; - HeapTupleData tuple; + HeapTupleData tuple; IndexScanDesc sd; RetrieveIndexResult indexRes; Name rcname; diff --git a/src/backend/utils/cache/syscache.c b/src/backend/utils/cache/syscache.c index bd583ac0ce6..6eb0ed3527d 100644 --- a/src/backend/utils/cache/syscache.c +++ b/src/backend/utils/cache/syscache.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.24 1999/02/13 23:19:45 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.25 1999/05/25 16:12:23 momjian Exp $ * * NOTES * These routines allow the parser/planner/executor to perform @@ -421,11 +421,11 @@ InitCatalogCache() Assert(!PointerIsValid((Pointer) SysCache[cacheId])); SysCache[cacheId] = InitSysCache(cacheinfo[cacheId].name, - cacheinfo[cacheId].indname, - cacheId, - cacheinfo[cacheId].nkeys, - cacheinfo[cacheId].key, - cacheinfo[cacheId].iScanFunc); + cacheinfo[cacheId].indname, + cacheId, + cacheinfo[cacheId].nkeys, + cacheinfo[cacheId].key, + cacheinfo[cacheId].iScanFunc); if (!PointerIsValid((char *) SysCache[cacheId])) { elog(ERROR, @@ -492,11 +492,11 @@ SearchSysCacheTuple(int cacheId,/* cache selection code */ if (!PointerIsValid(SysCache[cacheId])) { SysCache[cacheId] = InitSysCache(cacheinfo[cacheId].name, - cacheinfo[cacheId].indname, - cacheId, - cacheinfo[cacheId].nkeys, - cacheinfo[cacheId].key, - cacheinfo[cacheId].iScanFunc); + cacheinfo[cacheId].indname, + cacheId, + cacheinfo[cacheId].nkeys, + cacheinfo[cacheId].key, + cacheinfo[cacheId].iScanFunc); if (!PointerIsValid(SysCache[cacheId])) elog(ERROR, "InitCatalogCache: Can't init cache %s(%d)", diff --git a/src/backend/utils/cache/temprel.c b/src/backend/utils/cache/temprel.c index 60c949fa434..9e9faaf8ab2 100644 --- a/src/backend/utils/cache/temprel.c +++ b/src/backend/utils/cache/temprel.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/cache/Attic/temprel.c,v 1.2 1999/02/13 23:19:45 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/cache/Attic/temprel.c,v 1.3 1999/05/25 16:12:24 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -47,16 +47,16 @@ static List *temp_rels = NIL; typedef struct TempTable { - char *user_relname; + char *user_relname; HeapTuple pg_class_tuple; -} TempTable; +} TempTable; void create_temp_relation(char *relname, HeapTuple pg_class_tuple) { MemoryContext oldcxt; - TempTable *temp_rel; + TempTable *temp_rel; oldcxt = MemoryContextSwitchTo((MemoryContext) CacheCxt); @@ -65,7 +65,7 @@ create_temp_relation(char *relname, HeapTuple pg_class_tuple) /* save user-supplied name */ strcpy(temp_rel->user_relname, relname); - + temp_rel->pg_class_tuple = heap_copytuple(pg_class_tuple); temp_rels = lcons(temp_rel, temp_rels); @@ -76,24 +76,25 @@ create_temp_relation(char *relname, HeapTuple pg_class_tuple) void remove_all_temp_relations(void) { - List *l, *next; + List *l, + *next; l = temp_rels; while (l != NIL) { - TempTable *temp_rel = lfirst(l); + TempTable *temp_rel = lfirst(l); Form_pg_class classtuple; - classtuple = (Form_pg_class)GETSTRUCT(temp_rel->pg_class_tuple); + classtuple = (Form_pg_class) GETSTRUCT(temp_rel->pg_class_tuple); - next = lnext(l); /* do this first, l is deallocated */ + next = lnext(l); /* do this first, l is deallocated */ if (classtuple->relkind != RELKIND_INDEX) { - char relname[NAMEDATALEN]; + char relname[NAMEDATALEN]; /* safe from deallocation */ - strcpy(relname, temp_rel->user_relname); + strcpy(relname, temp_rel->user_relname); heap_destroy_with_catalog(relname); } else @@ -109,15 +110,16 @@ remove_temp_relation(Oid relid) { MemoryContext oldcxt; - List *l, *prev; - + List *l, + *prev; + oldcxt = MemoryContextSwitchTo((MemoryContext) CacheCxt); prev = NIL; l = temp_rels; while (l != NIL) { - TempTable *temp_rel = lfirst(l); + TempTable *temp_rel = lfirst(l); if (temp_rel->pg_class_tuple->t_data->t_oid == relid) { @@ -152,11 +154,11 @@ remove_temp_relation(Oid relid) HeapTuple get_temp_rel_by_name(char *user_relname) { - List *l; + List *l; foreach(l, temp_rels) { - TempTable *temp_rel = lfirst(l); + TempTable *temp_rel = lfirst(l); if (strcmp(temp_rel->user_relname, user_relname) == 0) return temp_rel->pg_class_tuple; |