1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-10 17:42:29 +03:00

Third round of fmgr updates: eliminate calls using fmgr() and

fmgr_faddr() in favor of new-style calls.  Lots of cleanup of
sloppy casts to use XXXGetDatum and DatumGetXXX ...
This commit is contained in:
Tom Lane
2000-05-30 04:25:00 +00:00
parent a12a23f0d0
commit 0f1e39643d
35 changed files with 570 additions and 443 deletions

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/common/Attic/indexvalid.c,v 1.24 2000/01/26 05:55:53 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/common/Attic/indexvalid.c,v 1.25 2000/05/30 04:24:27 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -40,7 +40,7 @@ index_keytest(IndexTuple tuple,
{
bool isNull;
Datum datum;
int test;
Datum test;
IncrIndexProcessed();
@@ -62,18 +62,16 @@ index_keytest(IndexTuple tuple,
if (key[0].sk_flags & SK_COMMUTE)
{
test = (*(fmgr_faddr(&key[0].sk_func)))
(DatumGetPointer(key[0].sk_argument),
datum) ? 1 : 0;
test = FunctionCall2(&key[0].sk_func,
key[0].sk_argument, datum);
}
else
{
test = (*(fmgr_faddr(&key[0].sk_func)))
(datum,
DatumGetPointer(key[0].sk_argument)) ? 1 : 0;
test = FunctionCall2(&key[0].sk_func,
datum, key[0].sk_argument);
}
if (!test == !(key[0].sk_flags & SK_NEGATE))
if (DatumGetBool(test) == !!(key[0].sk_flags & SK_NEGATE))
return false;
scanKeySize -= 1;

View File

@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/common/printtup.c,v 1.52 2000/01/26 05:55:53 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/common/printtup.c,v 1.53 2000/05/30 04:24:27 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -206,8 +206,10 @@ printtup(HeapTuple tuple, TupleDesc typeinfo, DestReceiver *self)
continue;
if (OidIsValid(thisState->typoutput))
{
outputstr = (char *) (*fmgr_faddr(&thisState->finfo))
(attr, thisState->typelem, typeinfo->attrs[i]->atttypmod);
outputstr = DatumGetCString(FunctionCall3(&thisState->finfo,
attr,
ObjectIdGetDatum(thisState->typelem),
Int32GetDatum(typeinfo->attrs[i]->atttypmod)));
pq_sendcountedtext(&buf, outputstr, strlen(outputstr));
pfree(outputstr);
}
@@ -295,8 +297,10 @@ debugtup(HeapTuple tuple, TupleDesc typeinfo, DestReceiver *self)
if (getTypeOutAndElem((Oid) typeinfo->attrs[i]->atttypid,
&typoutput, &typelem))
{
value = fmgr(typoutput, attr, typelem,
typeinfo->attrs[i]->atttypmod);
value = DatumGetCString(OidFunctionCall3(typoutput,
attr,
ObjectIdGetDatum(typelem),
Int32GetDatum(typeinfo->attrs[i]->atttypmod)));
printatt((unsigned) i + 1, typeinfo->attrs[i], value);
pfree(value);
}