aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/hash
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/access/hash')
-rw-r--r--src/backend/access/hash/hash.c16
-rw-r--r--src/backend/access/hash/hashfunc.c20
-rw-r--r--src/backend/access/hash/hashinsert.c8
-rw-r--r--src/backend/access/hash/hashovfl.c18
-rw-r--r--src/backend/access/hash/hashpage.c8
-rw-r--r--src/backend/access/hash/hashscan.c8
-rw-r--r--src/backend/access/hash/hashsearch.c16
-rw-r--r--src/backend/access/hash/hashstrat.c4
-rw-r--r--src/backend/access/hash/hashutil.c16
9 files changed, 57 insertions, 57 deletions
diff --git a/src/backend/access/hash/hash.c b/src/backend/access/hash/hash.c
index 4bcc7eab524..2a12171d0bc 100644
--- a/src/backend/access/hash/hash.c
+++ b/src/backend/access/hash/hash.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/hash/hash.c,v 1.20 1998/08/19 02:01:00 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/hash/hash.c,v 1.21 1998/09/01 03:20:53 momjian Exp $
*
* NOTES
* This file contains only the public interface routines.
@@ -88,8 +88,8 @@ hashbuild(Relation heap,
_hash_metapinit(index);
/* get tuple descriptors for heap and index relations */
- htupdesc = RelationGetTupleDescriptor(heap);
- itupdesc = RelationGetTupleDescriptor(index);
+ htupdesc = RelationGetDescr(heap);
+ itupdesc = RelationGetDescr(index);
/* get space for data items that'll appear in the index tuple */
attdata = (Datum *) palloc(natts * sizeof(Datum));
@@ -284,11 +284,11 @@ hashinsert(Relation rel, Datum *datum, char *nulls, ItemPointer ht_ctid, Relatio
/* generate an index tuple */
- itup = index_formtuple(RelationGetTupleDescriptor(rel), datum, nulls);
+ itup = index_formtuple(RelationGetDescr(rel), datum, nulls);
itup->t_tid = *ht_ctid;
if (itup->t_info & INDEX_NULL_MASK)
- return ((InsertIndexResult) NULL);
+ return (InsertIndexResult) NULL;
hitem = _hash_formitem(itup);
@@ -297,7 +297,7 @@ hashinsert(Relation rel, Datum *datum, char *nulls, ItemPointer ht_ctid, Relatio
pfree(hitem);
pfree(itup);
- return (res);
+ return res;
}
@@ -320,7 +320,7 @@ hashgettuple(IndexScanDesc scan, ScanDirection dir)
else
res = _hash_first(scan, dir);
- return ((char *) res);
+ return (char *) res;
}
@@ -345,7 +345,7 @@ hashbeginscan(Relation rel,
/* register scan in case we change pages it's using */
_hash_regscan(scan);
- return ((char *) scan);
+ return (char *) scan;
}
/*
diff --git a/src/backend/access/hash/hashfunc.c b/src/backend/access/hash/hashfunc.c
index d57c65e4e07..9376ad2e57f 100644
--- a/src/backend/access/hash/hashfunc.c
+++ b/src/backend/access/hash/hashfunc.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/hash/hashfunc.c,v 1.10 1998/08/19 02:01:02 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/hash/hashfunc.c,v 1.11 1998/09/01 03:20:54 momjian Exp $
*
* NOTES
* These functions are stored in pg_amproc. For each operator class
@@ -23,13 +23,13 @@
uint32
hashint2(int16 key)
{
- return ((uint32) ~key);
+ return (uint32) ~key;
}
uint32
hashint4(uint32 key)
{
- return (~key);
+ return ~key;
}
/* Hash function from Chris Torek. */
@@ -76,7 +76,7 @@ hashfloat4(float32 keyp)
} while (--loop);
}
}
- return (h);
+ return h;
}
@@ -123,18 +123,18 @@ hashfloat8(float64 keyp)
} while (--loop);
}
}
- return (h);
+ return h;
}
uint32
hashoid(Oid key)
{
- return ((uint32) ~key);
+ return (uint32) ~key;
}
uint32
-hashoid8(Oid key[])
+hashoid8(Oid *key)
{
int i;
uint32 result = 0;
@@ -160,7 +160,7 @@ hashchar(char key)
h = h * PRIME1 ^ (key - ' ');
h %= PRIME2;
- return (h);
+ return h;
}
@@ -180,7 +180,7 @@ hashname(NameData *n)
h = h * PRIME1 ^ (*key++ - ' ');
h %= PRIME2;
- return (h);
+ return h;
}
@@ -240,5 +240,5 @@ hashtext(struct varlena * key)
} while (--loop);
}
}
- return (n);
+ return n;
}
diff --git a/src/backend/access/hash/hashinsert.c b/src/backend/access/hash/hashinsert.c
index 8e70e456637..df52938979c 100644
--- a/src/backend/access/hash/hashinsert.c
+++ b/src/backend/access/hash/hashinsert.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/hash/hashinsert.c,v 1.13 1998/06/15 19:27:48 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/hash/hashinsert.c,v 1.14 1998/09/01 03:20:56 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -85,7 +85,7 @@ _hash_doinsert(Relation rel, HashItem hitem)
/* be tidy */
_hash_freeskey(itup_scankey);
- return (res);
+ return res;
}
/*
@@ -206,7 +206,7 @@ _hash_insertonpg(Relation rel,
> metap->hashm_ffactor)
_hash_expandtable(rel, metabuf);
_hash_relbuf(rel, metabuf, HASH_READ);
- return (res);
+ return res;
}
/*
@@ -236,5 +236,5 @@ _hash_pgaddtup(Relation rel,
/* write the buffer, but hold our lock */
_hash_wrtnorelbuf(rel, buf);
- return (itup_off);
+ return itup_off;
}
diff --git a/src/backend/access/hash/hashovfl.c b/src/backend/access/hash/hashovfl.c
index 54178179162..8809091cc63 100644
--- a/src/backend/access/hash/hashovfl.c
+++ b/src/backend/access/hash/hashovfl.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/hash/hashovfl.c,v 1.16 1998/06/15 19:27:49 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/hash/hashovfl.c,v 1.17 1998/09/01 03:20:57 momjian Exp $
*
* NOTES
* Overflow pages look like ordinary relation pages.
@@ -84,7 +84,7 @@ _hash_addovflpage(Relation rel, Buffer *metabufp, Buffer buf)
/* logically chain overflow page to previous page */
pageopaque->hasho_nextblkno = ovflblkno;
_hash_wrtnorelbuf(rel, buf);
- return (ovflbuf);
+ return ovflbuf;
}
/*
@@ -227,7 +227,7 @@ _hash_getovfladdr(Relation rel, Buffer *metabufp)
/* Calculate address of the new overflow page */
oaddr = OADDR_OF(splitnum, offset);
_hash_chgbufaccess(rel, metabufp, HASH_WRITE, HASH_READ);
- return (oaddr);
+ return oaddr;
found:
bit = bit + _hash_firstfreebit(freep[j]);
@@ -254,7 +254,7 @@ found:
/* initialize this page */
oaddr = OADDR_OF(i, offset);
_hash_chgbufaccess(rel, metabufp, HASH_WRITE, HASH_READ);
- return (oaddr);
+ return oaddr;
}
/*
@@ -275,10 +275,10 @@ _hash_firstfreebit(uint32 map)
for (i = 0; i < BITS_PER_MAP; i++)
{
if (!(mask & map))
- return (i);
+ return i;
mask = mask << 1;
}
- return (i);
+ return i;
}
/*
@@ -387,9 +387,9 @@ _hash_freeovflpage(Relation rel, Buffer ovflbuf)
* return that buffer with a write lock.
*/
if (BlockNumberIsValid(nextblkno))
- return (_hash_getbuf(rel, nextblkno, HASH_WRITE));
+ return _hash_getbuf(rel, nextblkno, HASH_WRITE);
else
- return (InvalidBuffer);
+ return InvalidBuffer;
}
@@ -455,7 +455,7 @@ _hash_initbitmap(Relation rel,
/* write out the new bitmap page (releasing its locks) */
_hash_wrtbuf(rel, buf);
- return (0);
+ return 0;
}
diff --git a/src/backend/access/hash/hashpage.c b/src/backend/access/hash/hashpage.c
index ebac11ed12e..dc3ad3727aa 100644
--- a/src/backend/access/hash/hashpage.c
+++ b/src/backend/access/hash/hashpage.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/hash/hashpage.c,v 1.16 1998/06/15 19:27:49 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/hash/hashpage.c,v 1.17 1998/09/01 03:20:58 momjian Exp $
*
* NOTES
* Postgres hash pages look like ordinary relation pages. The opaque
@@ -204,7 +204,7 @@ _hash_getbuf(Relation rel, BlockNumber blkno, int access)
buf = ReadBuffer(rel, blkno);
/* ref count and lock type are correct */
- return (buf);
+ return buf;
}
/*
@@ -288,7 +288,7 @@ _hash_chgbufaccess(Relation rel,
break;
}
*bufp = _hash_getbuf(rel, blkno, to_access);
- return (BufferGetPage(*bufp));
+ return BufferGetPage(*bufp);
}
/*
@@ -604,7 +604,7 @@ _hash_splitpage(Relation rel,
/* hash on the tuple */
hitem = (HashItem) PageGetItem(opage, PageGetItemId(opage, ooffnum));
itup = &(hitem->hash_itup);
- itupdesc = RelationGetTupleDescriptor(rel);
+ itupdesc = RelationGetDescr(rel);
datum = index_getattr(itup, 1, itupdesc, &null);
bucket = _hash_call(rel, metap, datum);
diff --git a/src/backend/access/hash/hashscan.c b/src/backend/access/hash/hashscan.c
index ebc41220352..add3971ac27 100644
--- a/src/backend/access/hash/hashscan.c
+++ b/src/backend/access/hash/hashscan.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/hash/hashscan.c,v 1.15 1998/08/19 02:01:04 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/hash/hashscan.c,v 1.16 1998/09/01 03:20:59 momjian Exp $
*
* NOTES
* Because we can be doing an index scan on a relation while we
@@ -153,13 +153,13 @@ _hash_scantouched(IndexScanDesc scan,
if (ItemPointerIsValid(current)
&& ItemPointerGetBlockNumber(current) == blkno
&& ItemPointerGetOffsetNumber(current) >= offno)
- return (true);
+ return true;
current = &(scan->currentMarkData);
if (ItemPointerIsValid(current)
&& ItemPointerGetBlockNumber(current) == blkno
&& ItemPointerGetOffsetNumber(current) >= offno)
- return (true);
+ return true;
- return (false);
+ return false;
}
diff --git a/src/backend/access/hash/hashsearch.c b/src/backend/access/hash/hashsearch.c
index a3d56190605..adb20353906 100644
--- a/src/backend/access/hash/hashsearch.c
+++ b/src/backend/access/hash/hashsearch.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/hash/hashsearch.c,v 1.15 1998/06/15 19:27:50 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/hash/hashsearch.c,v 1.16 1998/09/01 03:21:01 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -107,7 +107,7 @@ _hash_next(IndexScanDesc scan, ScanDirection dir)
* next tuple, we come back with a lock on that buffer.
*/
if (!_hash_step(scan, &buf, dir, metabuf))
- return ((RetrieveIndexResult) NULL);
+ return (RetrieveIndexResult) NULL;
/* if we're here, _hash_step found a valid tuple */
current = &(scan->currentItemData);
@@ -118,7 +118,7 @@ _hash_next(IndexScanDesc scan, ScanDirection dir)
itup = &hitem->hash_itup;
res = FormRetrieveIndexResult(current, &(itup->t_tid));
- return (res);
+ return res;
}
static void
@@ -236,7 +236,7 @@ _hash_first(IndexScanDesc scan, ScanDirection dir)
{
_hash_relbuf(rel, buf, HASH_READ);
_hash_relbuf(rel, metabuf, HASH_READ);
- return ((RetrieveIndexResult) NULL);
+ return (RetrieveIndexResult) NULL;
}
}
}
@@ -247,7 +247,7 @@ _hash_first(IndexScanDesc scan, ScanDirection dir)
}
if (!_hash_step(scan, &buf, dir, metabuf))
- return ((RetrieveIndexResult) NULL);
+ return (RetrieveIndexResult) NULL;
/* if we're here, _hash_step found a valid tuple */
current = &(scan->currentItemData);
@@ -258,7 +258,7 @@ _hash_first(IndexScanDesc scan, ScanDirection dir)
itup = &hitem->hash_itup;
res = FormRetrieveIndexResult(current, &(itup->t_tid));
- return (res);
+ return res;
}
/*
@@ -432,7 +432,7 @@ _hash_step(IndexScanDesc scan, Buffer *bufP, ScanDirection dir, Buffer metabuf)
_hash_relbuf(rel, metabuf, HASH_READ);
*bufP = so->hashso_curbuf = InvalidBuffer;
ItemPointerSetInvalid(current);
- return (false);
+ return false;
}
/* get ready to check this tuple */
@@ -445,5 +445,5 @@ _hash_step(IndexScanDesc scan, Buffer *bufP, ScanDirection dir, Buffer metabuf)
blkno = BufferGetBlockNumber(buf);
*bufP = so->hashso_curbuf = buf;
ItemPointerSet(current, blkno, offnum);
- return (true);
+ return true;
}
diff --git a/src/backend/access/hash/hashstrat.c b/src/backend/access/hash/hashstrat.c
index a3a3656d76f..8244184b949 100644
--- a/src/backend/access/hash/hashstrat.c
+++ b/src/backend/access/hash/hashstrat.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/hash/Attic/hashstrat.c,v 1.11 1997/09/08 02:20:21 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/hash/Attic/hashstrat.c,v 1.12 1998/09/01 03:21:02 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -63,7 +63,7 @@ _hash_getstrat(Relation rel,
Assert(StrategyNumberIsValid(strat));
- return (strat);
+ return strat;
}
#endif
diff --git a/src/backend/access/hash/hashutil.c b/src/backend/access/hash/hashutil.c
index 64c7233533b..fc6641f7a6a 100644
--- a/src/backend/access/hash/hashutil.c
+++ b/src/backend/access/hash/hashutil.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/hash/hashutil.c,v 1.13 1998/01/07 21:01:16 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/hash/hashutil.c,v 1.14 1998/09/01 03:21:03 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -37,7 +37,7 @@ _hash_mkscankey(Relation rel, IndexTuple itup, HashMetaPage metap)
bool null;
natts = rel->rd_rel->relnatts;
- itupdesc = RelationGetTupleDescriptor(rel);
+ itupdesc = RelationGetDescr(rel);
skey = (ScanKey) palloc(natts * sizeof(ScanKeyData));
@@ -49,7 +49,7 @@ _hash_mkscankey(Relation rel, IndexTuple itup, HashMetaPage metap)
0x0, (AttrNumber) (i + 1), proc, arg);
}
- return (skey);
+ return skey;
}
void
@@ -64,10 +64,10 @@ _hash_checkqual(IndexScanDesc scan, IndexTuple itup)
{
if (scan->numberOfKeys > 0)
return (index_keytest(itup,
- RelationGetTupleDescriptor(scan->relation),
+ RelationGetDescr(scan->relation),
scan->numberOfKeys, scan->keyData));
else
- return (true);
+ return true;
}
HashItem
@@ -89,7 +89,7 @@ _hash_formitem(IndexTuple itup)
hitem = (HashItem) palloc(nbytes_hitem);
memmove((char *) &(hitem->hash_itup), (char *) itup, tuplen);
- return (hitem);
+ return hitem;
}
Bucket
@@ -104,7 +104,7 @@ _hash_call(Relation rel, HashMetaPage metap, Datum key)
bucket = n & metap->hashm_highmask;
if (bucket > metap->hashm_maxbucket)
bucket = bucket & metap->hashm_lowmask;
- return (bucket);
+ return bucket;
}
/*
@@ -119,7 +119,7 @@ _hash_log2(uint32 num)
limit = 1;
for (i = 0; limit < num; limit = limit << 1, i++)
;
- return (i);
+ return i;
}
/*