Skip to content

Commit 1d8bbfd

Browse files
committed
Make functions static where possible, enclose unused functions in #ifdef NOT_USED.
1 parent b992e20 commit 1d8bbfd

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
#define register
4040
#endif /* !NO_ASSERT_CHECKING && sparc && sunos4 */
4141

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

745+
#ifdef NOT_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
static Size IndexInfoFindDataOffset(unsigned short t_info);
30+
static char *fastgetiattr(IndexTuple tup, int attnum,
31+
TupleDesc att, 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+
static char *
129131
fastgetiattr(IndexTuple tup,
130132
int attnum,
131133
TupleDesc tupleDesc,

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
static int gistnospace(Page p, IndexTuple it);
5858
void gistdelete(Relation r, ItemPointer tid);
5959
static IndexTuple gist_tuple_replacekey(Relation r, GISTENTRY entry, IndexTuple t);
60-
60+
static void gistcentryinit(GISTSTATE *giststate, GISTENTRY *e, char *pr,
61+
Relation r, Page pg, OffsetNumber o, int b, bool l) ;
62+
static char *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+
static void
11761178
gistcentryinit(GISTSTATE *giststate, GISTENTRY *e, char *pr, Relation r,
11771179
Page pg, OffsetNumber o, int b, bool l)
11781180
{
@@ -1244,7 +1246,8 @@ _gistdump(Relation r)
12441246
}
12451247
}
12461248

1247-
char *text_range_out(TXTRANGE *r)
1249+
#ifdef NOT_USED
1250+
static char *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+
static char *
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
static RetrieveIndexResult gistfirst(IndexScanDesc s, ScanDirection dir);
3535
static RetrieveIndexResult gistnext(IndexScanDesc s, ScanDirection dir);
3636
static ItemPointer gistheapptr(Relation r, ItemPointer itemp);
37+
static bool gistindex_keytest(IndexTuple tuple, TupleDesc tupdesc,
38+
int scanKeySize, ScanKey key, GISTSTATE *giststate,
39+
Relation r, Page p, OffsetNumber offset);
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+
static bool
221224
gistindex_keytest(IndexTuple tuple,
222225
TupleDesc tupdesc,
223226
int scanKeySize,

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+
#ifdef NOT_USED
105106
bool
106107
RelationInvokeGISTStrategy(Relation r,
107108
AttrNumber attnum,
@@ -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 StrategyNumber HTNegateCommute[1] = {
3333
InvalidStrategy
3434
};
3535

36+
#ifdef NOT_USED
3637
static StrategyEvaluationData HTEvaluationData = {
3738
/* XXX static for simplicity */
3839

@@ -42,13 +43,15 @@ static StrategyEvaluationData HTEvaluationData = {
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+
#ifdef NOT_USED
54+
static StrategyNumber
5255
_hash_getstrat(Relation rel,
5356
AttrNumber attno,
5457
RegProcedure proc)
@@ -61,8 +64,10 @@ _hash_getstrat(Relation rel,
6164

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

65-
bool
69+
#ifdef NOT_USED
70+
static bool
6671
_hash_invokestrat(Relation rel,
6772
AttrNumber attno,
6873
StrategyNumber strat,
@@ -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+
#ifdef NOT_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+
static void InitHeapAccessStatistics(void);
32+
3133
/* ----------------
3234
* InitHeapAccessStatistics
3335
* ----------------
3436
*/
3537
HeapAccessStatistics heap_access_stats = (HeapAccessStatistics) NULL;
3638

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

126+
#ifdef NOT_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+
#ifdef NOT_USED
175180
/* ----------------
176181
* GetHeapAccessStatistics
177182
* ----------------
@@ -206,7 +211,9 @@ HeapAccessStatistics GetHeapAccessStatistics()
206211

207212
return stats;
208213
}
214+
#endif
209215

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

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

314+
#ifdef NOT_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+
#ifdef NOT_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+
#ifdef NOT_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+
#ifdef NOT_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+
#ifdef NOT_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)