Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5936055

Browse files
committed
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.
1 parent2982b97 commit5936055

File tree

2 files changed

+34
-17
lines changed

2 files changed

+34
-17
lines changed

‎contrib/dbase/dbf2pg.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,10 @@ char *subarg = NULL;
4949
charescape_buff[8192];
5050

5151
voiddo_substitute(char*subarg,dbhead*dbh);
52-
inlinevoidstrtoupper(char*string);
5352

54-
inlinevoidstrtolower(char*string);
53+
staticinlinevoidstrtoupper(char*string);
54+
staticinlinevoidstrtolower(char*string);
55+
5556
voiddo_create(PGconn*,char*,dbhead*);
5657
voiddo_inserts(PGconn*,char*,dbhead*);
5758
intcheck_table(PGconn*,char*);
@@ -88,7 +89,7 @@ isinteger(char *buff)
8889
return1;
8990
}
9091

91-
inlinevoid
92+
staticinlinevoid
9293
strtoupper(char*string)
9394
{
9495
while (*string!='\0')
@@ -98,7 +99,7 @@ strtoupper(char *string)
9899
}
99100
}
100101

101-
inlinevoid
102+
staticinlinevoid
102103
strtolower(char*string)
103104
{
104105
while (*string!='\0')

‎src/backend/utils/sort/tuplesort.c

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
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/3119: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-
inlineint32
1839-
ApplySortFunction(FmgrInfo*sortFunction,SortFunctionKindkind,
1840-
Datumdatum1,boolisNull1,
1841-
Datumdatum2,boolisNull2)
1838+
staticinlineint32
1839+
inlineApplySortFunction(FmgrInfo*sortFunction,SortFunctionKindkind,
1840+
Datumdatum1,boolisNull1,
1841+
Datumdatum2,boolisNull2)
18421842
{
18431843
switch (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,SortFunctionKindkind,
1912+
Datumdatum1,boolisNull1,
1913+
Datumdatum2,boolisNull2)
1914+
{
1915+
returninlineApplySortFunction(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)
19291943
datum1=heap_getattr(ltup,attno,tupDesc,&isnull1);
19301944
datum2=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);
19351950
if (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

20492065
if (compare!=0)
20502066
return (int)compare;/* done when we find unequal
@@ -2137,9 +2153,9 @@ comparetup_datum(Tuplesortstate *state, const void *a, const void *b)
21372153
DatumTuple*ltup= (DatumTuple*)a;
21382154
DatumTuple*rtup= (DatumTuple*)b;
21392155

2140-
returnApplySortFunction(&state->sortOpFn,state->sortFnKind,
2141-
ltup->val,ltup->isNull,
2142-
rtup->val,rtup->isNull);
2156+
returninlineApplySortFunction(&state->sortOpFn,state->sortFnKind,
2157+
ltup->val,ltup->isNull,
2158+
rtup->val,rtup->isNull);
21432159
}
21442160

21452161
staticvoid*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp