1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

Renaming cleanup, no pgindent yet.

This commit is contained in:
Bruce Momjian
1998-09-01 03:29:17 +00:00
parent 2aa080fc93
commit af74855a60
329 changed files with 4380 additions and 4388 deletions

View File

@ -141,8 +141,8 @@ gistbuild(Relation heap,
}
/* init the tuple descriptors and get set for a heap scan */
hd = RelationGetTupleDescriptor(heap);
id = RelationGetTupleDescriptor(index);
hd = RelationGetDescr(heap);
id = RelationGetDescr(index);
d = (Datum *) palloc(natts * sizeof(*d));
nulls = (bool *) palloc(natts * sizeof(*nulls));
@ -350,7 +350,7 @@ gistinsert(Relation r, Datum *datum, char *nulls, ItemPointer ht_ctid, Relation
compvec[i] = FALSE;
datum[i] = (Datum) tmpentry.pred;
}
itup = index_formtuple(RelationGetTupleDescriptor(r), datum, nulls);
itup = index_formtuple(RelationGetDescr(r), datum, nulls);
itup->t_tid = *ht_ctid;
RelationSetLockForWrite(r);
@ -362,7 +362,7 @@ gistinsert(Relation r, Datum *datum, char *nulls, ItemPointer ht_ctid, Relation
pfree(compvec);
/* XXX two-phase locking -- don't unlock the relation until EOT */
return (res);
return res;
}
/*
@ -431,7 +431,7 @@ gistdoinsert(Relation r,
res = gistSplit(r, buffer, stack, itup, giststate);
gistfreestack(stack);
WriteBuffer(buffer); /* don't forget to release buffer! */
return (res);
return res;
}
if (PageIsEmpty(page))
@ -458,7 +458,7 @@ gistdoinsert(Relation r,
res = (InsertIndexResult) palloc(sizeof(InsertIndexResultData));
ItemPointerSet(&(res->pointerData), blk, l);
return (res);
return res;
}
@ -512,7 +512,7 @@ gistChooseSubtree(Relation r, IndexTuple itup, /* itup has compressed
*retstack = stack;
*leafbuf = buffer;
return (blk);
return blk;
}
@ -568,7 +568,7 @@ gistAdjustKeys(Relation r,
(*fmgr_faddr(&giststate->equalFn)) (ev0p->pred, datum, &result);
if (!result)
{
TupleDesc td = RelationGetTupleDescriptor(r);
TupleDesc td = RelationGetDescr(r);
/* compress datum for storage on page */
gistcentryinit(giststate, &centry, datum, ev0p->rel, ev0p->page,
@ -869,7 +869,7 @@ gistSplit(Relation r,
pfree(ltup);
pfree(rtup);
return (res);
return res;
}
/*
@ -962,7 +962,7 @@ gistentryinsert(Relation r, GISTSTACK *stk, IndexTuple tup,
res = gistSplit(r, b, stk->gs_parent, tup, giststate);
WriteBuffer(b); /* don't forget to release buffer! -
* 01/31/94 */
return (res);
return res;
}
else
{
@ -978,7 +978,7 @@ gistentryinsert(Relation r, GISTSTACK *stk, IndexTuple tup,
pfree(tmpentry.pred);
if (tup != newtup)
pfree(newtup);
return (res);
return res;
}
}
@ -1079,13 +1079,13 @@ gistchoose(Relation r, Page p, IndexTuple it, /* it has compressed entry */
if (identry.pred != id)
pfree(identry.pred);
return (which);
return which;
}
static int
gistnospace(Page p, IndexTuple it)
{
return (PageGetFreeSpace(p) < IndexTupleSize(it));
return PageGetFreeSpace(p) < IndexTupleSize(it);
}
void
@ -1144,7 +1144,7 @@ initGISTstate(GISTSTATE *giststate, Relation index)
picksplit_proc,
equal_proc;
HeapTuple htup;
IndexTupleForm itupform;
Form_pg_index itupform;
consistent_proc = index_getprocid(index, 1, GIST_CONSISTENT_PROC);
union_proc = index_getprocid(index, 1, GIST_UNION_PROC);
@ -1165,7 +1165,7 @@ initGISTstate(GISTSTATE *giststate, Relation index)
htup = SearchSysCacheTuple(INDEXRELID,
ObjectIdGetDatum(RelationGetRelid(index)),
0, 0, 0);
itupform = (IndexTupleForm) GETSTRUCT(htup);
itupform = (Form_pg_index) GETSTRUCT(htup);
if (!HeapTupleIsValid(htup))
elog(ERROR, "initGISTstate: index %d not found",
RelationGetRelid(index));
@ -1183,7 +1183,7 @@ initGISTstate(GISTSTATE *giststate, Relation index)
itupform->indexrelid, FirstOffsetNumber);
return;
}
giststate->keytypbyval = (((AttributeTupleForm) htup)->attbyval);
giststate->keytypbyval = (((Form_pg_attribute) htup)->attbyval);
}
else
giststate->keytypbyval = FALSE;
@ -1210,7 +1210,7 @@ gist_tuple_replacekey(Relation r, GISTENTRY entry, IndexTuple t)
/* or in new size */
t->t_info |= MAXALIGN(entry.bytes + sizeof(IndexTupleData));
return (t);
return t;
}
else
{
@ -1228,7 +1228,7 @@ gist_tuple_replacekey(Relation r, GISTENTRY entry, IndexTuple t)
isnull);
newtup->t_tid = t->t_tid;
pfree(isnull);
return (newtup);
return newtup;
}
}
@ -1345,7 +1345,7 @@ text_range_out(TXTRANGE *r)
*upper;
if (r == NULL)
return (NULL);
return NULL;
result = (char *) palloc(NAMEDATALEN + VARSIZE(TRLOWER(r)) + VARSIZE(TRUPPER(r))
- 2 * VARHDRSZ);
@ -1359,7 +1359,7 @@ text_range_out(TXTRANGE *r)
sprintf(result, "[%s,%s): %d", lower, upper, r->flag);
pfree(lower);
pfree(upper);
return (result);
return result;
}
#endif
@ -1370,11 +1370,11 @@ int_range_out(INTRANGE *r)
char *result;
if (r == NULL)
return (NULL);
return NULL;
result = (char *) palloc(80);
sprintf(result, "[%d,%d): %d", r->lower, r->upper, r->flag);
return (result);
return result;
}
#endif /* defined GISTDEBUG */

View File

@ -48,14 +48,14 @@ gistgettuple(IndexScanDesc s, ScanDirection dir)
/* if we have it cached in the scan desc, just return the value */
if ((res = gistscancache(s, dir)) != (RetrieveIndexResult) NULL)
return (res);
return res;
/* not cached, so we'll have to do some work */
if (ItemPointerIsValid(&(s->currentItemData)))
res = gistnext(s, dir);
else
res = gistfirst(s, dir);
return (res);
return res;
}
static RetrieveIndexResult
@ -90,7 +90,7 @@ gistfirst(IndexScanDesc s, ScanDirection dir)
ReleaseBuffer(b);
if (so->s_stack == (GISTSTACK *) NULL)
return ((RetrieveIndexResult) NULL);
return (RetrieveIndexResult) NULL;
stk = so->s_stack;
b = ReadBuffer(s->relation, stk->gs_blk);
@ -116,7 +116,7 @@ gistfirst(IndexScanDesc s, ScanDirection dir)
res = FormRetrieveIndexResult(&(s->currentItemData), &(it->t_tid));
ReleaseBuffer(b);
return (res);
return res;
}
else
{
@ -174,7 +174,7 @@ gistnext(IndexScanDesc s, ScanDirection dir)
ReleaseBuffer(b);
if (so->s_stack == (GISTSTACK *) NULL)
return ((RetrieveIndexResult) NULL);
return (RetrieveIndexResult) NULL;
stk = so->s_stack;
b = ReadBuffer(s->relation, stk->gs_blk);
@ -200,7 +200,7 @@ gistnext(IndexScanDesc s, ScanDirection dir)
res = FormRetrieveIndexResult(&(s->currentItemData), &(it->t_tid));
ReleaseBuffer(b);
return (res);
return res;
}
else
{
@ -258,7 +258,7 @@ gistindex_keytest(IndexTuple tuple,
if (isNull)
{
/* XXX eventually should check if SK_ISNULL */
return (false);
return false;
}
if (key[0].sk_flags & SK_COMMUTE)
@ -276,13 +276,13 @@ gistindex_keytest(IndexTuple tuple,
}
if (!test == !(key[0].sk_flags & SK_NEGATE))
return (false);
return false;
scanKeySize -= 1;
key++;
}
return (true);
return true;
}
@ -315,7 +315,7 @@ gistfindnext(IndexScanDesc s, Page p, OffsetNumber n, ScanDirection dir)
{
it = (char *) PageGetItem(p, PageGetItemId(p, n));
if (gistindex_keytest((IndexTuple) it,
RelationGetTupleDescriptor(s->relation),
RelationGetDescr(s->relation),
s->numberOfKeys, s->keyData, giststate,
s->relation, p, n))
break;
@ -326,7 +326,7 @@ gistfindnext(IndexScanDesc s, Page p, OffsetNumber n, ScanDirection dir)
n = OffsetNumberNext(n);
}
return (n);
return n;
}
static RetrieveIndexResult
@ -339,7 +339,7 @@ gistscancache(IndexScanDesc s, ScanDirection dir)
&& ItemPointerIsValid(&(s->currentItemData))))
{
return ((RetrieveIndexResult) NULL);
return (RetrieveIndexResult) NULL;
}
ip = gistheapptr(s->relation, &(s->currentItemData));
@ -351,7 +351,7 @@ gistscancache(IndexScanDesc s, ScanDirection dir)
pfree(ip);
return (res);
return res;
}
/*
@ -381,5 +381,5 @@ gistheapptr(Relation r, ItemPointer itemp)
else
ItemPointerSetInvalid(ip);
return (ip);
return ip;
}

View File

@ -72,7 +72,7 @@ gistbeginscan(Relation r,
s = RelationGetIndexScan(r, fromEnd, nkeys, key);
gistregscan(s);
return (s);
return s;
}
void

View File

@ -99,7 +99,7 @@ RelationGetGISTStrategy(Relation r,
AttrNumber attnum,
RegProcedure proc)
{
return (RelationGetStrategy(r, attnum, &GISTEvaluationData, proc));
return RelationGetStrategy(r, attnum, &GISTEvaluationData, proc);
}
#ifdef NOT_USED