Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit aaeef4d

Browse files
committed
All external function definitions now have prototypes that are checked.
1 parent bf5cbbf commit aaeef4d

Some content is hidden

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

99 files changed

+551
-322
lines changed

src/Makefile.global

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#
88
#
99
# IDENTIFICATION
10-
# $Header: /cvsroot/pgsql/src/Attic/Makefile.global,v 1.57 1996/11/09 10:39:02 scrappy Exp $
10+
# $Header: /cvsroot/pgsql/src/Attic/Makefile.global,v 1.58 1996/11/10 02:56:33 momjian Exp $
1111
#
1212
# NOTES
1313
# This is seen by any Makefiles that include mk/postgres.mk. To
@@ -860,7 +860,7 @@ includedir= $(HEADERDIR)
860860
# Flags for CC and LD. (depend on COPT and PROFILE)
861861
#
862862
# PostgreSQL should *always* compile with -Wall -Werror enabled
863-
CFLAGS+= -Wall #-Werror
863+
CFLAGS+= -Wall -Wmissing-prototypes -Wmissing-declarations #-Werror
864864

865865
# Globally pass debugging/optimization/profiling flags based
866866
# on the options selected above.

src/backend/access/common/heaptuple.c

Lines changed: 2 additions & 1 deletion
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.15 1996/11/05 07:42:40 scrappy Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.16 1996/11/10 02:56:41 momjian Exp $
1212
*
1313
* NOTES
1414
* The old interface functions have been converted to macros
@@ -19,6 +19,7 @@
1919

2020
#include <postgres.h>
2121

22+
#include <access/heapam.h>
2223
#include <access/htup.h>
2324
#include <access/transam.h>
2425
#include <access/tupmacs.h>

src/backend/access/common/heapvalid.c

Lines changed: 2 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/common/Attic/heapvalid.c,v 1.11 1996/11/05 07:42:41 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/access/common/Attic/heapvalid.c,v 1.12 1996/11/10 02:56:47 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -16,6 +16,7 @@
1616

1717
#include <fmgr.h>
1818
#include <access/heaptuple.h>
19+
#include <access/valid.h>
1920
#include <access/xact.h>
2021
#include <storage/bufpage.h>
2122
#include <utils/rel.h>

src/backend/access/common/indexvalid.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/access/common/Attic/indexvalid.c,v 1.11 1996/11/05 07:42:43 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/access/common/Attic/indexvalid.c,v 1.12 1996/11/10 02:56:51 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
1414

1515
#include <postgres.h>
1616

1717
#include <access/htup.h>
18+
#include <access/iqual.h>
1819
#include <access/itup.h>
1920
#include <access/skey.h>
2021
#include <executor/execdebug.h>

src/backend/access/common/printtup.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/access/common/printtup.c,v 1.11 1996/11/05 07:42:44 scrappy Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/access/common/printtup.c,v 1.12 1996/11/10 02:57:00 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -17,6 +17,7 @@
1717

1818
#include <fmgr.h>
1919
#include <access/heaptuple.h>
20+
#include <access/printtup.h>
2021
#include <catalog/pg_type.h>
2122
#include <libpq/libpq.h>
2223
#include <utils/syscache.h>

src/backend/access/gist/gist.c

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,9 +1190,6 @@ gistcentryinit(GISTSTATE *giststate, GISTENTRY *e, char *pr, Relation r,
11901190

11911191
#ifdef GISTDEBUG
11921192

1193-
extern char *text_range_out();
1194-
extern char *int_range_out();
1195-
11961193
/*
11971194
** sloppy debugging support routine, requires recompilation with appropriate
11981195
** "out" method for the index keys. Could be fixed to find that info
@@ -1236,7 +1233,7 @@ _gistdump(Relation r)
12361233
datum = ((char *) itup);
12371234
datum += sizeof(IndexTupleData);
12381235
/* get out function for type of key, and out it! */
1239-
itkey = (char *) int_range_out(datum);
1236+
itkey = (char *) int_range_out((INTRANGE *)datum);
12401237
/* itkey = " unable to print"; */
12411238
printf("\t[%d] size %d heap <%d,%d> key:%s\n",
12421239
offnum, IndexTupleSize(itup), itblkno, itoffno, itkey);
@@ -1247,26 +1244,6 @@ _gistdump(Relation r)
12471244
}
12481245
}
12491246

1250-
#define TRLOWER(tr) (((tr)->bytes))
1251-
#define TRUPPER(tr) (&((tr)->bytes[MAXALIGN(VARSIZE(TRLOWER(tr)))]))
1252-
typedef struct txtrange {
1253-
/* flag: NINF means that lower is negative infinity; PINF means that
1254-
** upper is positive infinity. 0 means that both are numbers.
1255-
*/
1256-
int32 vl_len;
1257-
int32 flag;
1258-
char bytes[2];
1259-
} TXTRANGE;
1260-
1261-
typedef struct intrange {
1262-
int lower;
1263-
int upper;
1264-
/* flag: NINF means that lower is negative infinity; PINF means that
1265-
** upper is positive infinity. 0 means that both are numbers.
1266-
*/
1267-
int flag;
1268-
} INTRANGE;
1269-
12701247
char *text_range_out(TXTRANGE *r)
12711248
{
12721249
char *result;

src/backend/access/gist/gistscan.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <postgres.h>
1414

1515
#include <access/gist.h>
16+
#include <access/gistscan.h>
1617
#include <access/genam.h>
1718
#include <access/rtree.h>
1819
#include <storage/bufmgr.h>

src/backend/access/hash/hashfunc.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/hash/hashfunc.c,v 1.2 1996/10/20 06:34:14 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashfunc.c,v 1.3 1996/11/10 02:57:40 momjian Exp $
1111
*
1212
* NOTES
1313
* These functions are stored in pg_amproc. For each operator class
@@ -18,6 +18,8 @@
1818

1919
#include "postgres.h"
2020

21+
#include "access/hash.h"
22+
2123
uint32 hashint2(int16 key)
2224
{
2325
return ((uint32) ~key);

src/backend/access/heap/stats.c

Lines changed: 2 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.8 1996/11/05 11:17:47 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/access/heap/Attic/stats.c,v 1.9 1996/11/10 02:58:11 momjian Exp $
1111
*
1212
* NOTES
1313
* initam should be moved someplace else.
@@ -324,7 +324,7 @@ PrintAndFreeHeapAccessStatistics(HeapAccessStatistics stats)
324324
* ----------------
325325
*/
326326
void
327-
initam()
327+
initam(void)
328328
{
329329
/* ----------------
330330
* initialize heap statistics.

src/backend/access/nbtree/nbtcompare.c

Lines changed: 2 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/nbtree/nbtcompare.c,v 1.5 1996/11/05 10:35:28 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtcompare.c,v 1.6 1996/11/10 02:58:37 momjian Exp $
1111
*
1212
* NOTES
1313
* These functions are stored in pg_amproc. For each operator class
@@ -24,6 +24,7 @@
2424

2525
#include <postgres.h>
2626

27+
#include <utils/builtins.h>
2728
#include <utils/nabstime.h>
2829

2930
int32

src/backend/access/rtree/rtproc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtproc.c,v 1.4 1996/11/05 10:54:17 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtproc.c,v 1.5 1996/11/10 02:58:53 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
1414

1515
#include <postgres.h>
1616

17+
#include <utils/builtins.h>
1718
#include <utils/geo-decls.h>
1819
#ifndef HAVE_MEMMOVE
1920
# include <regex/utils.h>

src/backend/access/transam/transam.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/access/transam/transam.c,v 1.5 1996/11/05 11:12:28 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/access/transam/transam.c,v 1.6 1996/11/10 02:59:11 momjian Exp $
1111
*
1212
* NOTES
1313
* This file contains the high level access-method interface to the
@@ -96,7 +96,7 @@ extern bool BuildingBtree;
9696
* ----------------
9797
*/
9898
int
99-
RecoveryCheckingEnabled()
99+
RecoveryCheckingEnabled(void)
100100
{
101101
return RecoveryCheckingEnableState;
102102
}
@@ -453,7 +453,7 @@ TransRecover(Relation logRelation)
453453
* Initializes transaction logging.
454454
*/
455455
void
456-
InitializeTransactionLog()
456+
InitializeTransactionLog(void)
457457
{
458458
Relation logRelation;
459459
Relation timeRelation;

src/backend/access/transam/xact.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.4 1996/11/05 11:12:32 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.5 1996/11/10 02:59:16 momjian Exp $
1111
*
1212
* NOTES
1313
* Transaction aborts can now occur two ways:
@@ -218,7 +218,7 @@ bool AMI_OVERRIDE = false;
218218
static int TransactionFlushState = 1;
219219

220220
int
221-
TransactionFlushEnabled()
221+
TransactionFlushEnabled(void)
222222
{
223223
return TransactionFlushState;
224224
}
@@ -237,7 +237,7 @@ SetTransactionFlushEnabled(bool state)
237237
* --------------------------------
238238
*/
239239
bool
240-
IsTransactionState()
240+
IsTransactionState(void)
241241
{
242242
TransactionState s = CurrentTransactionState;
243243

@@ -1113,7 +1113,7 @@ AbortCurrentTransaction()
11131113
* --------------------------------
11141114
*/
11151115
void
1116-
BeginTransactionBlock()
1116+
BeginTransactionBlock(void)
11171117
{
11181118
TransactionState s = CurrentTransactionState;
11191119

@@ -1151,7 +1151,7 @@ BeginTransactionBlock()
11511151
* --------------------------------
11521152
*/
11531153
void
1154-
EndTransactionBlock()
1154+
EndTransactionBlock(void)
11551155
{
11561156
TransactionState s = CurrentTransactionState;
11571157

@@ -1205,7 +1205,7 @@ EndTransactionBlock()
12051205
* --------------------------------
12061206
*/
12071207
void
1208-
AbortTransactionBlock()
1208+
AbortTransactionBlock(void)
12091209
{
12101210
TransactionState s = CurrentTransactionState;
12111211

src/backend/access/transam/xid.c

Lines changed: 2 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/transam/Attic/xid.c,v 1.4 1996/11/05 11:12:33 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/access/transam/Attic/xid.c,v 1.5 1996/11/10 02:59:19 momjian Exp $
1111
*
1212
* OLD COMMENTS
1313
* XXX WARNING
@@ -23,6 +23,7 @@
2323
#include <stdio.h>
2424

2525
#include <postgres.h>
26+
#include <access/xact.h>
2627

2728
extern TransactionId NullTransactionId;
2829
extern TransactionId DisabledTransactionId;

src/backend/catalog/catalog.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/catalog/catalog.c,v 1.4 1996/11/06 06:47:01 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/catalog/catalog.c,v 1.5 1996/11/10 02:59:21 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -37,6 +37,7 @@ relpath(char relname[])
3737
return(relname);
3838
}
3939

40+
#ifdef NOT_USED
4041
/*
4142
* issystem - returns non-zero iff relname is a system catalog
4243
*
@@ -56,6 +57,7 @@ issystem(char relname[])
5657
else
5758
return FALSE;
5859
}
60+
#endif
5961

6062
/*
6163
* IsSystemRelationName --

src/backend/catalog/heap.c

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.7 1996/11/08 00:59:10 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.8 1996/11/10 02:59:25 momjian Exp $
1111
*
1212
* INTERFACE ROUTINES
1313
* heap_creatr() - Create an uncataloged heap relation
@@ -26,27 +26,27 @@
2626
*/
2727
#include <postgres.h>
2828

29-
#include <catalog/pg_ipl.h>
30-
#include <catalog/pg_inherits.h>
31-
#include <catalog/pg_proc.h>
3229
#include <miscadmin.h>
33-
#include <catalog/indexing.h>
34-
#include <catalog/catalog.h>
35-
#include <utils/builtins.h>
30+
#include <fmgr.h>
3631
#include <access/heapam.h>
37-
#include <utils/mcxt.h>
38-
#include <parser/catalog_utils.h>
32+
#include <catalog/catalog.h>
33+
#include <catalog/catname.h>
34+
#include <catalog/heap.h>
3935
#include <catalog/index.h>
40-
#include <fmgr.h>
36+
#include <catalog/indexing.h>
37+
#include <catalog/pg_ipl.h>
38+
#include <catalog/pg_inherits.h>
39+
#include <catalog/pg_proc.h>
4140
#include <catalog/pg_index.h>
4241
#include <catalog/pg_type.h>
43-
#include <catalog/catname.h>
44-
#include <utils/relcache.h>
4542
#include <storage/bufmgr.h>
46-
#include <catalog/heap.h>
47-
#include <rewrite/rewriteRemove.h>
4843
#include <storage/lmgr.h>
4944
#include <storage/smgr.h>
45+
#include <parser/catalog_utils.h>
46+
#include <rewrite/rewriteRemove.h>
47+
#include <utils/builtins.h>
48+
#include <utils/mcxt.h>
49+
#include <utils/relcache.h>
5050
#ifndef HAVE_MEMMOVE
5151
# include <regex/utils.h>
5252
#else
@@ -1342,7 +1342,7 @@ heap_destroyr(Relation rdesc)
13421342
13431343
*/
13441344
void
1345-
InitTempRelList()
1345+
InitTempRelList(void)
13461346
{
13471347
if (tempRels) {
13481348
free(tempRels->rels);
@@ -1402,7 +1402,7 @@ AddToTempRelList(Relation r)
14021402
go through the tempRels list and destroy each of the relations
14031403
*/
14041404
void
1405-
DestroyTempRels()
1405+
DestroyTempRels(void)
14061406
{
14071407
int i;
14081408
Relation rdesc;

0 commit comments

Comments
 (0)