7878 * Portions Copyright (c) 1994, Regents of the University of California
7979 *
8080 * IDENTIFICATION
81- * $Header: /cvsroot/pgsql/src/backend/utils/sort/tuplesort.c,v 1.28 2002/10/04 17: 19:55 tgl Exp $
81+ * $Header: /cvsroot/pgsql/src/backend/utils/sort/tuplesort.c,v 1.29 2002/10/31 19:11:48 tgl Exp $
8282 *
8383 *-------------------------------------------------------------------------
8484 */
@@ -1835,10 +1835,10 @@ myFunctionCall2(FmgrInfo *flinfo, Datum arg1, Datum arg2)
18351835 * and return a 3-way comparison result. This takes care of handling
18361836 * NULLs and sort ordering direction properly.
18371837 */
1838- inline int32
1839- ApplySortFunction (FmgrInfo * sortFunction ,SortFunctionKind kind ,
1840- Datum datum1 ,bool isNull1 ,
1841- Datum datum2 ,bool isNull2 )
1838+ static inline int32
1839+ inlineApplySortFunction (FmgrInfo * sortFunction ,SortFunctionKind kind ,
1840+ Datum datum1 ,bool isNull1 ,
1841+ Datum datum2 ,bool isNull2 )
18421842{
18431843switch (kind )
18441844{
@@ -1903,6 +1903,20 @@ ApplySortFunction(FmgrInfo *sortFunction, SortFunctionKind kind,
19031903}
19041904}
19051905
1906+ /*
1907+ * Non-inline ApplySortFunction() --- this is needed only to conform to
1908+ * C99's brain-dead notions about how to implement inline functions...
1909+ */
1910+ int32
1911+ ApplySortFunction (FmgrInfo * sortFunction ,SortFunctionKind kind ,
1912+ Datum datum1 ,bool isNull1 ,
1913+ Datum datum2 ,bool isNull2 )
1914+ {
1915+ return inlineApplySortFunction (sortFunction ,kind ,
1916+ datum1 ,isNull1 ,
1917+ datum2 ,isNull2 );
1918+ }
1919+
19061920
19071921/*
19081922 * Routines specialized for HeapTuple case
@@ -1929,9 +1943,10 @@ comparetup_heap(Tuplesortstate *state, const void *a, const void *b)
19291943datum1 = heap_getattr (ltup ,attno ,tupDesc ,& isnull1 );
19301944datum2 = heap_getattr (rtup ,attno ,tupDesc ,& isnull2 );
19311945
1932- compare = ApplySortFunction (& scanKey -> sk_func ,
1933- state -> sortFnKinds [nkey ],
1934- datum1 ,isnull1 ,datum2 ,isnull2 );
1946+ compare = inlineApplySortFunction (& scanKey -> sk_func ,
1947+ state -> sortFnKinds [nkey ],
1948+ datum1 ,isnull1 ,
1949+ datum2 ,isnull2 );
19351950if (compare != 0 )
19361951{
19371952/* dead code? SK_COMMUTE can't actually be set here, can it? */
@@ -2043,8 +2058,9 @@ comparetup_index(Tuplesortstate *state, const void *a, const void *b)
20432058/* see comments about NULLs handling in btbuild */
20442059
20452060/* the comparison function is always of CMP type */
2046- compare = ApplySortFunction (& entry -> sk_func ,SORTFUNC_CMP ,
2047- datum1 ,isnull1 ,datum2 ,isnull2 );
2061+ compare = inlineApplySortFunction (& entry -> sk_func ,SORTFUNC_CMP ,
2062+ datum1 ,isnull1 ,
2063+ datum2 ,isnull2 );
20482064
20492065if (compare != 0 )
20502066return (int )compare ;/* done when we find unequal
@@ -2137,9 +2153,9 @@ comparetup_datum(Tuplesortstate *state, const void *a, const void *b)
21372153DatumTuple * ltup = (DatumTuple * )a ;
21382154DatumTuple * rtup = (DatumTuple * )b ;
21392155
2140- return ApplySortFunction (& state -> sortOpFn ,state -> sortFnKind ,
2141- ltup -> val ,ltup -> isNull ,
2142- rtup -> val ,rtup -> isNull );
2156+ return inlineApplySortFunction (& state -> sortOpFn ,state -> sortFnKind ,
2157+ ltup -> val ,ltup -> isNull ,
2158+ rtup -> val ,rtup -> isNull );
21432159}
21442160
21452161static void *