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

Commiteb0d00a

Browse files
author
Neil Conway
committed
Various style cleanups for GiST; no changes to functionality.
1 parentc9a382b commiteb0d00a

File tree

1 file changed

+31
-35
lines changed

1 file changed

+31
-35
lines changed

‎src/backend/access/gist/gist.c

Lines changed: 31 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/access/gist/gist.c,v 1.114 2005/05/11 06:24:50 neilc Exp $
11+
* $PostgreSQL: pgsql/src/backend/access/gist/gist.c,v 1.115 2005/05/15 04:08:29 neilc Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -25,9 +25,9 @@
2525

2626
#undef GIST_PAGEADDITEM
2727

28-
#defineATTSIZE(datum,TupDesc,i,isnull) \
28+
#defineATTSIZE(datum,TupDesc,i,isnull) \
2929
( \
30-
(isnull) ? 0 : \
30+
(isnull) ? 0 : \
3131
att_addlength(0, (TupDesc)->attrs[(i)-1]->attlen, (datum)) \
3232
)
3333

@@ -45,12 +45,12 @@
4545
* and gistadjsubkey only
4646
*/
4747
#defineFILLITEM(evp,isnullkey,okey,okeyb,rkey,rkeyb) do { \
48-
if (isnullkey) { \
49-
gistentryinit((evp), rkey, r, NULL, \
50-
(OffsetNumber) 0, rkeyb, FALSE); \
48+
if (isnullkey) { \
49+
gistentryinit((evp), rkey, r, NULL, \
50+
(OffsetNumber) 0, rkeyb, FALSE); \
5151
} else { \
52-
gistentryinit((evp), okey, r, NULL, \
53-
(OffsetNumber) 0, okeyb, FALSE); \
52+
gistentryinit((evp), okey, r, NULL, \
53+
(OffsetNumber) 0, okeyb, FALSE); \
5454
} \
5555
} while(0)
5656

@@ -87,8 +87,7 @@ static OffsetNumber gistwritebuffer(Relation r,
8787
IndexTuple*itup,
8888
intlen,
8989
OffsetNumberoff);
90-
staticintgistnospace(Pagepage,
91-
IndexTuple*itvec,intlen);
90+
staticboolgistnospace(Pagepage,IndexTuple*itvec,intlen);
9291
staticIndexTuple*gistreadbuffer(Bufferbuffer,int*len);
9392
staticIndexTuple*gistjoinvector(
9493
IndexTuple*itvec,int*len,
@@ -107,14 +106,13 @@ static void gistadjsubkey(Relation r,
107106
GIST_SPLITVEC*v,
108107
GISTSTATE*giststate);
109108
staticIndexTuplegistFormTuple(GISTSTATE*giststate,
110-
Relationr,Datumattdata[],intdatumsize[],boolisnull[]);
109+
Relationr,Datum*attdata,int*datumsize,bool*isnull);
111110
staticIndexTuple*gistSplit(Relationr,
112111
Bufferbuffer,
113112
IndexTuple*itup,
114113
int*len,
115114
GISTSTATE*giststate);
116-
staticvoidgistnewroot(Relationr,
117-
IndexTuple*itup,intlen);
115+
staticvoidgistnewroot(Relationr,IndexTuple*itup,intlen);
118116
staticvoidGISTInitBuffer(Bufferb,uint32f);
119117
staticOffsetNumbergistchoose(Relationr,Pagep,
120118
IndexTupleit,
@@ -131,8 +129,8 @@ static void gistcentryinit(GISTSTATE *giststate, int nkey,
131129
OffsetNumbero,intb,booll,boolisNull);
132130
staticvoidgistDeCompressAtt(GISTSTATE*giststate,Relationr,
133131
IndexTupletuple,Pagep,OffsetNumbero,
134-
GISTENTRYattdata[],booldecompvec[],boolisnull[]);
135-
staticvoidgistFreeAtt(Relationr,GISTENTRYattdata[],booldecompvec[]);
132+
GISTENTRY*attdata,bool*decompvec,bool*isnull);
133+
staticvoidgistFreeAtt(Relationr,GISTENTRY*attdata,bool*decompvec);
136134
staticvoidgistpenalty(GISTSTATE*giststate,intattno,
137135
GISTENTRY*key1,boolisNull1,
138136
GISTENTRY*key2,boolisNull2,
@@ -503,7 +501,7 @@ gistlayerinsert(Relation r, BlockNumber blkno,
503501
}
504502
else
505503
{
506-
/*enogth space */
504+
/*enough space */
507505
OffsetNumberoff,
508506
l;
509507

@@ -577,7 +575,7 @@ gistwritebuffer(Relation r, Page page, IndexTuple *itup,
577575
/*
578576
* Check space for itup vector on page
579577
*/
580-
staticint
578+
staticbool
581579
gistnospace(Pagepage,IndexTuple*itvec,intlen)
582580
{
583581
unsignedintsize=0;
@@ -934,7 +932,7 @@ gistunionsubkey(Relation r, GISTSTATE *giststate, IndexTuple *itvec, GIST_SPLITV
934932
}
935933

936934
/*
937-
* find group in vector withequial value
935+
* find group in vector withequal value
938936
*/
939937
staticint
940938
gistfindgroup(GISTSTATE*giststate,GISTENTRY*valvec,GIST_SPLITVEC*spl)
@@ -949,7 +947,6 @@ gistfindgroup(GISTSTATE *giststate, GISTENTRY *valvec, GIST_SPLITVEC *spl)
949947
* first key is always not null (see gistinsert), so we may not check
950948
* for nulls
951949
*/
952-
953950
for (i=0;i<spl->spl_nleft;i++)
954951
{
955952
if (spl->spl_idgrp[spl->spl_left[i]])
@@ -1007,8 +1004,7 @@ gistadjsubkey(Relation r,
10071004
IndexTuple*itup,/* contains compressed entry */
10081005
int*len,
10091006
GIST_SPLITVEC*v,
1010-
GISTSTATE*giststate
1011-
)
1007+
GISTSTATE*giststate)
10121008
{
10131009
intcurlen;
10141010
OffsetNumber*curwpos;
@@ -1400,8 +1396,8 @@ GISTInitBuffer(Buffer b, uint32 f)
14001396

14011397

14021398
/*
1403-
** find entry with lowest penalty
1404-
*/
1399+
* find entry with lowest penalty
1400+
*/
14051401
staticOffsetNumber
14061402
gistchoose(Relationr,Pagep,IndexTupleit,/* it has compressed entry */
14071403
GISTSTATE*giststate)
@@ -1643,12 +1639,12 @@ freeGISTstate(GISTSTATE *giststate)
16431639

16441640
#ifdefGIST_PAGEADDITEM
16451641
/*
1646-
** Given an IndexTuple to be inserted on a page, this routine replaces
1647-
** the key with another key, which may involve generating a new IndexTuple
1648-
** if the sizes don't match or if the null status changes.
1649-
**
1650-
** XXX this only works for a single-column index tuple!
1651-
*/
1642+
* Given an IndexTuple to be inserted on a page, this routine replaces
1643+
* the key with another key, which may involve generating a new IndexTuple
1644+
* if the sizes don't match or if the null status changes.
1645+
*
1646+
* XXX this only works for a single-column index tuple!
1647+
*/
16521648
staticIndexTuple
16531649
gist_tuple_replacekey(Relationr,GISTENTRYentry,IndexTuplet)
16541650
{
@@ -1690,8 +1686,8 @@ gist_tuple_replacekey(Relation r, GISTENTRY entry, IndexTuple t)
16901686
#endif
16911687

16921688
/*
1693-
** initialize a GiST entry with a decompressed version of key
1694-
*/
1689+
* initialize a GiST entry with a decompressed version of key
1690+
*/
16951691
void
16961692
gistdentryinit(GISTSTATE*giststate,intnkey,GISTENTRY*e,
16971693
Datumk,Relationr,Pagepg,OffsetNumbero,
@@ -1719,8 +1715,8 @@ gistdentryinit(GISTSTATE *giststate, int nkey, GISTENTRY *e,
17191715

17201716

17211717
/*
1722-
** initialize a GiST entry with a compressed version of key
1723-
*/
1718+
* initialize a GiST entry with a compressed version of key
1719+
*/
17241720
staticvoid
17251721
gistcentryinit(GISTSTATE*giststate,intnkey,
17261722
GISTENTRY*e,Datumk,Relationr,
@@ -1790,7 +1786,7 @@ gistFormTuple(GISTSTATE *giststate, Relation r,
17901786

17911787
staticvoid
17921788
gistDeCompressAtt(GISTSTATE*giststate,Relationr,IndexTupletuple,Pagep,
1793-
OffsetNumbero,GISTENTRYattdata[],booldecompvec[],boolisnull[])
1789+
OffsetNumbero,GISTENTRY*attdata,bool*decompvec,bool*isnull)
17941790
{
17951791
inti;
17961792
Datumdatum;
@@ -1814,7 +1810,7 @@ gistDeCompressAtt(GISTSTATE *giststate, Relation r, IndexTuple tuple, Page p,
18141810
}
18151811

18161812
staticvoid
1817-
gistFreeAtt(Relationr,GISTENTRYattdata[],booldecompvec[])
1813+
gistFreeAtt(Relationr,GISTENTRY*attdata,bool*decompvec)
18181814
{
18191815
inti;
18201816

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp