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

Commit1d8bbfd

Browse files
committed
Make functions static where possible, enclose unused functions in #ifdef NOT_USED.
1 parentb992e20 commit1d8bbfd

File tree

186 files changed

+1114
-1048
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

186 files changed

+1114
-1048
lines changed

‎src/backend/access/common/heaptuple.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.18 1996/12/09 01:22:17 bryanh Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.19 1997/08/19 21:28:49 momjian Exp $
1212
*
1313
* NOTES
1414
* The old interface functions have been converted to macros
@@ -39,6 +39,8 @@
3939
#defineregister
4040
#endif/* !NO_ASSERT_CHECKING && sparc && sunos4 */
4141

42+
staticchar*heap_getsysattr(HeapTupletup,Bufferb,intattnum);
43+
4244
/* ----------------------------------------------------------------
4345
*misc support routines
4446
* ----------------------------------------------------------------
@@ -335,7 +337,7 @@ heap_sysattrbyval(AttrNumber attno)
335337
*heap_getsysattr
336338
* ----------------
337339
*/
338-
char*
340+
staticchar*
339341
heap_getsysattr(HeapTupletup,Bufferb,intattnum)
340342
{
341343
switch (attnum) {
@@ -740,6 +742,7 @@ heap_copytuple(HeapTuple tuple)
740742
return(newTuple);
741743
}
742744

745+
#ifdefNOT_USED
743746
/* ----------------
744747
*heap_deformtuple
745748
*
@@ -772,6 +775,7 @@ heap_deformtuple(HeapTuple tuple,
772775
nulls[i]=' ';
773776
}
774777
}
778+
#endif
775779

776780
/* ----------------
777781
*heap_formtuple

‎src/backend/access/common/indextuple.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/access/common/indextuple.c,v 1.14 1997/06/12 15:41:52 vadim Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/access/common/indextuple.c,v 1.15 1997/08/19 21:28:50 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -27,6 +27,8 @@
2727
#endif
2828

2929
staticSizeIndexInfoFindDataOffset(unsigned shortt_info);
30+
staticchar*fastgetiattr(IndexTupletup,intattnum,
31+
TupleDescatt,bool*isnull);
3032

3133
/* ----------------------------------------------------------------
3234
* index_ tuple interface routines
@@ -125,7 +127,7 @@ index_formtuple(TupleDesc tupleDescriptor,
125127
*the same attribute descriptor will go much quicker. -cim 5/4/91
126128
* ----------------
127129
*/
128-
char*
130+
staticchar*
129131
fastgetiattr(IndexTupletup,
130132
intattnum,
131133
TupleDesctupleDesc,

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ static OffsetNumber gistchoose(Relation r, Page p, IndexTuple it,
5757
staticintgistnospace(Pagep,IndexTupleit);
5858
voidgistdelete(Relationr,ItemPointertid);
5959
staticIndexTuplegist_tuple_replacekey(Relationr,GISTENTRYentry,IndexTuplet);
60-
60+
staticvoidgistcentryinit(GISTSTATE*giststate,GISTENTRY*e,char*pr,
61+
Relationr,Pagepg,OffsetNumbero,intb,booll) ;
62+
staticchar*int_range_out(INTRANGE*r);
6163

6264
/*
6365
** routine to build an index. Basically calls insert over and over
@@ -1172,7 +1174,7 @@ gistdentryinit(GISTSTATE *giststate, GISTENTRY *e, char *pr, Relation r,
11721174
/*
11731175
** initialize a GiST entry with a compressed version of pred
11741176
*/
1175-
void
1177+
staticvoid
11761178
gistcentryinit(GISTSTATE*giststate,GISTENTRY*e,char*pr,Relationr,
11771179
Pagepg,OffsetNumbero,intb,booll)
11781180
{
@@ -1244,7 +1246,8 @@ _gistdump(Relation r)
12441246
}
12451247
}
12461248

1247-
char*text_range_out(TXTRANGE*r)
1249+
#ifdefNOT_USED
1250+
staticchar*text_range_out(TXTRANGE*r)
12481251
{
12491252
char*result;
12501253
char*lower,*upper;
@@ -1266,8 +1269,9 @@ char *text_range_out(TXTRANGE *r)
12661269
pfree(upper);
12671270
return(result);
12681271
}
1272+
#endif
12691273

1270-
char*
1274+
staticchar*
12711275
int_range_out(INTRANGE*r)
12721276
{
12731277
char*result;

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ static RetrieveIndexResult gistscancache(IndexScanDesc s, ScanDirection dir);
3434
staticRetrieveIndexResultgistfirst(IndexScanDescs,ScanDirectiondir);
3535
staticRetrieveIndexResultgistnext(IndexScanDescs,ScanDirectiondir);
3636
staticItemPointergistheapptr(Relationr,ItemPointeritemp);
37+
staticboolgistindex_keytest(IndexTupletuple,TupleDesctupdesc,
38+
intscanKeySize,ScanKeykey,GISTSTATE*giststate,
39+
Relationr,Pagep,OffsetNumberoffset);
3740

3841

3942
RetrieveIndexResult
@@ -217,7 +220,7 @@ gistnext(IndexScanDesc s, ScanDirection dir)
217220
}
218221

219222
/* Similar to index_keytest, but decompresses the key in the IndexTuple */
220-
bool
223+
staticbool
221224
gistindex_keytest(IndexTupletuple,
222225
TupleDesctupdesc,
223226
intscanKeySize,

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ RelationGetGISTStrategy(Relation r,
102102
return (RelationGetStrategy(r,attnum,&GISTEvaluationData,proc));
103103
}
104104

105+
#ifdefNOT_USED
105106
bool
106107
RelationInvokeGISTStrategy(Relationr,
107108
AttrNumberattnum,
@@ -112,4 +113,4 @@ RelationInvokeGISTStrategy(Relation r,
112113
return (RelationInvokeStrategy(r,&GISTEvaluationData,attnum,s,
113114
left,right));
114115
}
115-
116+
#endif

‎src/backend/access/hash/hashstrat.c

Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/access/hash/Attic/hashstrat.c,v 1.7 1996/11/05 09:40:24 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/access/hash/Attic/hashstrat.c,v 1.8 1997/08/19 21:29:07 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -33,6 +33,7 @@ static StrategyNumberHTNegateCommute[1] = {
3333
InvalidStrategy
3434
};
3535

36+
#ifdefNOT_USED
3637
staticStrategyEvaluationDataHTEvaluationData= {
3738
/* XXX static for simplicity */
3839

@@ -42,13 +43,15 @@ static StrategyEvaluationDataHTEvaluationData = {
4243
(StrategyTransformMap)HTNegateCommute,
4344
{NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}
4445
};
46+
#endif
4547

4648
/* ----------------------------------------------------------------
4749
*RelationGetHashStrategy
4850
* ----------------------------------------------------------------
4951
*/
5052

51-
StrategyNumber
53+
#ifdefNOT_USED
54+
staticStrategyNumber
5255
_hash_getstrat(Relationrel,
5356
AttrNumberattno,
5457
RegProcedureproc)
@@ -61,8 +64,10 @@ _hash_getstrat(Relation rel,
6164

6265
return (strat);
6366
}
67+
#endif
6468

65-
bool
69+
#ifdefNOT_USED
70+
staticbool
6671
_hash_invokestrat(Relationrel,
6772
AttrNumberattno,
6873
StrategyNumberstrat,
@@ -72,28 +77,4 @@ _hash_invokestrat(Relation rel,
7277
return (RelationInvokeStrategy(rel,&HTEvaluationData,attno,strat,
7378
left,right));
7479
}
75-
76-
77-
78-
79-
80-
81-
82-
83-
84-
85-
86-
87-
88-
89-
90-
91-
92-
93-
94-
95-
96-
97-
98-
99-
80+
#endif

‎src/backend/access/heap/heapam.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.13 1997/08/12 22:51:40 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.14 1997/08/19 21:29:17 momjian Exp $
1111
*
1212
*
1313
* INTERFACE ROUTINES
@@ -461,6 +461,7 @@ doinsert(Relation relation, HeapTuple tup)
461461
*HeapScanIsValid is now a macro in relscan.h -cim 4/27/91
462462
*/
463463

464+
#ifdefNOT_USED
464465
/* ----------------
465466
*SetHeapAccessMethodImmediateInvalidation
466467
* ----------------
@@ -470,6 +471,7 @@ SetHeapAccessMethodImmediateInvalidation(bool on)
470471
{
471472
ImmediateInvalidation=on;
472473
}
474+
#endif
473475

474476
/* ----------------------------------------------------------------
475477
* heap access method interface

‎src/backend/access/heap/stats.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/access/heap/Attic/stats.c,v 1.10 1997/08/12 22:51:44 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/access/heap/Attic/stats.c,v 1.11 1997/08/19 21:29:21 momjian Exp $
1111
*
1212
* NOTES
1313
* initam should be moved someplace else.
@@ -28,13 +28,15 @@
2828
# include<string.h>
2929
#endif
3030

31+
staticvoidInitHeapAccessStatistics(void);
32+
3133
/* ----------------
3234
* InitHeapAccessStatistics
3335
* ----------------
3436
*/
3537
HeapAccessStatisticsheap_access_stats= (HeapAccessStatistics)NULL;
3638

37-
void
39+
staticvoid
3840
InitHeapAccessStatistics()
3941
{
4042
MemoryContextoldContext;
@@ -121,6 +123,7 @@ InitHeapAccessStatistics()
121123
heap_access_stats=stats;
122124
}
123125

126+
#ifdefNOT_USED
124127
/* ----------------
125128
* ResetHeapAccessStatistics
126129
* ----------------
@@ -171,7 +174,9 @@ ResetHeapAccessStatistics()
171174
time(&stats->local_reset_timestamp);
172175
time(&stats->last_request_timestamp);
173176
}
177+
#endif
174178

179+
#ifdefNOT_USED
175180
/* ----------------
176181
* GetHeapAccessStatistics
177182
* ----------------
@@ -206,7 +211,9 @@ HeapAccessStatistics GetHeapAccessStatistics()
206211

207212
returnstats;
208213
}
214+
#endif
209215

216+
#ifdefNOT_USED
210217
/* ----------------
211218
* PrintHeapAccessStatistics
212219
* ----------------
@@ -302,7 +309,9 @@ PrintHeapAccessStatistics(HeapAccessStatistics stats)
302309

303310
printf("\n");
304311
}
312+
#endif
305313

314+
#ifdefNOT_USED
306315
/* ----------------
307316
* PrintAndFreeHeapAccessStatistics
308317
* ----------------
@@ -314,6 +323,7 @@ PrintAndFreeHeapAccessStatistics(HeapAccessStatistics stats)
314323
if (stats!=NULL)
315324
pfree(stats);
316325
}
326+
#endif
317327

318328
/* ----------------------------------------------------------------
319329
* access method initialization

‎src/backend/access/index/genam.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/access/index/genam.c,v 1.6 1996/11/05 10:02:02 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/access/index/genam.c,v 1.7 1997/08/19 21:29:26 momjian Exp $
1111
*
1212
* NOTES
1313
* many of the old access method routines have been turned into
@@ -127,6 +127,7 @@ RelationGetIndexScan(Relation relation,
127127
return (scan);
128128
}
129129

130+
#ifdefNOT_USED
130131
/* ----------------
131132
* IndexScanRestart -- Restart an index scan.
132133
*
@@ -166,7 +167,9 @@ IndexScanRestart(IndexScanDesc scan,
166167
key,
167168
scan->numberOfKeys*sizeof(ScanKeyData));
168169
}
170+
#endif
169171

172+
#ifdefNOT_USED
170173
/* ----------------
171174
* IndexScanEnd -- End and index scan.
172175
*
@@ -188,6 +191,7 @@ IndexScanEnd(IndexScanDesc scan)
188191

189192
pfree(scan);
190193
}
194+
#endif
191195

192196
/* ----------------
193197
* IndexScanMarkPosition -- Mark current position in a scan.

‎src/backend/access/index/indexam.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/access/index/indexam.c,v 1.11 1997/08/12 22:51:48 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/access/index/indexam.c,v 1.12 1997/08/19 21:29:30 momjian Exp $
1111
*
1212
* INTERFACE ROUTINES
1313
*index_open - open an index relation by relationId
@@ -271,6 +271,7 @@ index_endscan(IndexScanDesc scan)
271271
RelationUnsetRIntentLock(scan->relation);
272272
}
273273

274+
#ifdefNOT_USED
274275
/* ----------------
275276
*index_markpos - mark a scan position
276277
* ----------------
@@ -285,7 +286,9 @@ index_markpos(IndexScanDesc scan)
285286

286287
fmgr(procedure,scan);
287288
}
289+
#endif
288290

291+
#ifdefNOT_USED
289292
/* ----------------
290293
*index_restrpos - restore a scan position
291294
* ----------------
@@ -300,6 +303,7 @@ index_restrpos(IndexScanDesc scan)
300303

301304
fmgr(procedure,scan);
302305
}
306+
#endif
303307

304308
/* ----------------
305309
*index_getnext - get the next tuple from a scan

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp