aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2002-10-31 19:11:48 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2002-10-31 19:11:48 +0000
commit5936055d46c29aecb8a74db316a9421c1c62cf8b (patch)
tree725817616b4db0eec52e3a1983e706489334a454
parent2982b97f7198987f0f7f0da5c62136d3572c81d9 (diff)
downloadpostgresql-5936055d46c29aecb8a74db316a9421c1c62cf8b.tar.gz
postgresql-5936055d46c29aecb8a74db316a9421c1c62cf8b.zip
Avoid use of inline functions that are not declared static. Needed to
conform to C99's brain-dead notion of how inline functions should work.
-rw-r--r--contrib/dbase/dbf2pg.c9
-rw-r--r--src/backend/utils/sort/tuplesort.c42
2 files changed, 34 insertions, 17 deletions
diff --git a/contrib/dbase/dbf2pg.c b/contrib/dbase/dbf2pg.c
index f8e6bafcd1b..abf04dfa28a 100644
--- a/contrib/dbase/dbf2pg.c
+++ b/contrib/dbase/dbf2pg.c
@@ -49,9 +49,10 @@ char *subarg = NULL;
char escape_buff[8192];
void do_substitute(char *subarg, dbhead * dbh);
-inline void strtoupper(char *string);
-inline void strtolower(char *string);
+static inline void strtoupper(char *string);
+static inline void strtolower(char *string);
+
void do_create(PGconn *, char *, dbhead *);
void do_inserts(PGconn *, char *, dbhead *);
int check_table(PGconn *, char *);
@@ -88,7 +89,7 @@ isinteger(char *buff)
return 1;
}
-inline void
+static inline void
strtoupper(char *string)
{
while (*string != '\0')
@@ -98,7 +99,7 @@ strtoupper(char *string)
}
}
-inline void
+static inline void
strtolower(char *string)
{
while (*string != '\0')
diff --git a/src/backend/utils/sort/tuplesort.c b/src/backend/utils/sort/tuplesort.c
index 38e73f8a63e..164e16b1dda 100644
--- a/src/backend/utils/sort/tuplesort.c
+++ b/src/backend/utils/sort/tuplesort.c
@@ -78,7 +78,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/sort/tuplesort.c,v 1.28 2002/10/04 17:19:55 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/sort/tuplesort.c,v 1.29 2002/10/31 19:11:48 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1835,10 +1835,10 @@ myFunctionCall2(FmgrInfo *flinfo, Datum arg1, Datum arg2)
* and return a 3-way comparison result. This takes care of handling
* NULLs and sort ordering direction properly.
*/
-inline int32
-ApplySortFunction(FmgrInfo *sortFunction, SortFunctionKind kind,
- Datum datum1, bool isNull1,
- Datum datum2, bool isNull2)
+static inline int32
+inlineApplySortFunction(FmgrInfo *sortFunction, SortFunctionKind kind,
+ Datum datum1, bool isNull1,
+ Datum datum2, bool isNull2)
{
switch (kind)
{
@@ -1903,6 +1903,20 @@ ApplySortFunction(FmgrInfo *sortFunction, SortFunctionKind kind,
}
}
+/*
+ * Non-inline ApplySortFunction() --- this is needed only to conform to
+ * C99's brain-dead notions about how to implement inline functions...
+ */
+int32
+ApplySortFunction(FmgrInfo *sortFunction, SortFunctionKind kind,
+ Datum datum1, bool isNull1,
+ Datum datum2, bool isNull2)
+{
+ return inlineApplySortFunction(sortFunction, kind,
+ datum1, isNull1,
+ datum2, isNull2);
+}
+
/*
* Routines specialized for HeapTuple case
@@ -1929,9 +1943,10 @@ comparetup_heap(Tuplesortstate *state, const void *a, const void *b)
datum1 = heap_getattr(ltup, attno, tupDesc, &isnull1);
datum2 = heap_getattr(rtup, attno, tupDesc, &isnull2);
- compare = ApplySortFunction(&scanKey->sk_func,
- state->sortFnKinds[nkey],
- datum1, isnull1, datum2, isnull2);
+ compare = inlineApplySortFunction(&scanKey->sk_func,
+ state->sortFnKinds[nkey],
+ datum1, isnull1,
+ datum2, isnull2);
if (compare != 0)
{
/* 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)
/* see comments about NULLs handling in btbuild */
/* the comparison function is always of CMP type */
- compare = ApplySortFunction(&entry->sk_func, SORTFUNC_CMP,
- datum1, isnull1, datum2, isnull2);
+ compare = inlineApplySortFunction(&entry->sk_func, SORTFUNC_CMP,
+ datum1, isnull1,
+ datum2, isnull2);
if (compare != 0)
return (int) compare; /* done when we find unequal
@@ -2137,9 +2153,9 @@ comparetup_datum(Tuplesortstate *state, const void *a, const void *b)
DatumTuple *ltup = (DatumTuple *) a;
DatumTuple *rtup = (DatumTuple *) b;
- return ApplySortFunction(&state->sortOpFn, state->sortFnKind,
- ltup->val, ltup->isNull,
- rtup->val, rtup->isNull);
+ return inlineApplySortFunction(&state->sortOpFn, state->sortFnKind,
+ ltup->val, ltup->isNull,
+ rtup->val, rtup->isNull);
}
static void *