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

Commitf36b256

Browse files
committed
Major code cleanups from D'arcy (-Wall -Werror)
1 parent29a0fb8 commitf36b256

Some content is hidden

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

44 files changed

+249
-147
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,11 @@ gistbuild(Relation heap,
145145
Datum*d;
146146
bool*nulls;
147147
intnb,nh,ni;
148+
#ifndefOMIT_PARTIAL_INDEX
148149
ExprContext*econtext;
149150
TupleTabletupleTable;
150151
TupleTableSlot*slot;
152+
#endif
151153
Oidhrelid,irelid;
152154
Node*pred,*oldPred;
153155
GISTSTATEgiststate;
@@ -199,6 +201,12 @@ gistbuild(Relation heap,
199201
econtext=makeNode(ExprContext);
200202
FillDummyExprContext(econtext,slot,hd,buffer);
201203
}
204+
else/* shut the compiler up */
205+
{
206+
tupleTable=NULL;
207+
slot=NULL;
208+
econtext=NULL;
209+
}
202210
#endif/* OMIT_PARTIAL_INDEX */
203211
scan=heap_beginscan(heap,0,NowTimeQual,0, (ScanKey)NULL);
204212
htup=heap_getnext(scan,0,&buffer);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ static StrategyEvaluationData GISTEvaluationData = {
113113
(StrategyTransformMap)GISTNegate,/* how to do (not qual) */
114114
(StrategyTransformMap)GISTCommute,/* how to swap operands */
115115
(StrategyTransformMap)GISTNegateCommute,/* how to do both */
116-
NULL
116+
{NULL }
117117
};
118118

119119
StrategyNumber

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

Lines changed: 9 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/hash.c,v 1.5 1996/10/21 05:45:11 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/access/hash/hash.c,v 1.6 1996/10/23 07:38:29 scrappy Exp $
1111
*
1212
* NOTES
1313
* This file contains only the public interface routines.
@@ -113,9 +113,11 @@ hashbuild(Relation heap,
113113
intnhtups,nitups;
114114
inti;
115115
HashItemhitem;
116+
#ifndefOMIT_PARTIAL_INDEX
116117
ExprContext*econtext;
117118
TupleTabletupleTable;
118119
TupleTableSlot*slot;
120+
#endif
119121
Oidhrelid,irelid;
120122
Node*pred,*oldPred;
121123

@@ -151,6 +153,12 @@ hashbuild(Relation heap,
151153
econtext=makeNode(ExprContext);
152154
FillDummyExprContext(econtext,slot,htupdesc,buffer);
153155
}
156+
else/* quiet the compiler */
157+
{
158+
econtext=NULL;
159+
tupleTable=0;
160+
slot=0;
161+
}
154162
#endif/* OMIT_PARTIAL_INDEX */
155163

156164
/* start a heap scan */

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

Lines changed: 5 additions & 5 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/hashovfl.c,v 1.4 1996/10/21 05:45:14 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashovfl.c,v 1.5 1996/10/23 07:38:32 scrappy Exp $
1111
*
1212
* NOTES
1313
* Overflow pages look like ordinary relation pages.
@@ -132,12 +132,12 @@ static OverflowPageAddress
132132
_hash_getovfladdr(Relationrel,Buffer*metabufp)
133133
{
134134
HashMetaPagemetap;
135-
Buffermapbuf;
135+
Buffermapbuf=0;
136136
BlockNumberblkno;
137137
PageOffsetoffset;
138138
OverflowPageAddressoaddr;
139139
SplitNumbersplitnum;
140-
uint32*freep;
140+
uint32*freep=NULL;
141141
uint32max_free;
142142
uint32bit;
143143
uint32first_page;
@@ -356,7 +356,7 @@ _hash_freeovflpage(Relation rel, Buffer ovflbuf)
356356
* XXX this should look like:
357357
* - lock prev/next
358358
* - modify/write prev/next (how to do write ordering with a
359-
* doubly-linked list???)
359+
* doubly-linked list?)
360360
* - unlock prev/next
361361
*/
362362
if (BlockNumberIsValid(prevblkno)) {
@@ -503,7 +503,7 @@ _hash_squeezebucket(Relation rel,
503503
Bucketbucket)
504504
{
505505
Bufferwbuf;
506-
Bufferrbuf;
506+
Bufferrbuf=0;
507507
BlockNumberwblkno;
508508
BlockNumberrblkno;
509509
Pagewpage;

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/access/index/Attic/istrat.c,v 1.3 1996/10/21 07:38:20 scrappy Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/access/index/Attic/istrat.c,v 1.4 1996/10/23 07:38:43 scrappy Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -233,8 +233,8 @@ StrategyTermEvaluate(StrategyTerm term,
233233
Datumright)
234234
{
235235
Indexindex;
236-
longtmpres;
237-
boolresult;
236+
longtmpres=0;
237+
boolresult=0;
238238
StrategyOperatoroperator;
239239
ScanKeyentry;
240240

‎src/backend/access/nbtree/nbtcompare.c

Lines changed: 4 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/nbtree/nbtcompare.c,v 1.2 1996/10/20 10:53:02 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtcompare.c,v 1.3 1996/10/23 07:38:54 scrappy Exp $
1111
*
1212
* NOTES
1313
*These functions are stored in pg_amproc. For each operator class
@@ -20,8 +20,10 @@
2020
*-------------------------------------------------------------------------
2121
*/
2222

23-
#include"postgres.h"
23+
#include<string.h>
2424
#include<time.h>
25+
26+
#include"postgres.h"
2527
#include"utils/nabstime.h"
2628

2729
int32

‎src/backend/access/nbtree/nbtinsert.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.2 1996/10/20 10:53:03 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.3 1996/10/23 07:39:00 scrappy Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
1414

15+
#include<stdio.h>
16+
#include<time.h>
17+
1518
#include"postgres.h"
1619

1720
#include"catalog/pg_attribute.h"
@@ -37,15 +40,14 @@
3740
#include"storage/itemid.h"
3841
#include"storage/item.h"
3942
#include"storage/bufpage.h"
40-
#include<time.h>
4143
#include"utils/nabstime.h"
44+
#include"utils/palloc.h"
4245
#include"access/htup.h"
4346
#include"utils/tqual.h"
4447
#include"access/relscan.h"
4548
#include"access/sdir.h"
4649
#include"access/nbtree.h"
4750

48-
#include<stdio.h>
4951
#include"storage/ipc.h"
5052
#include"storage/bufmgr.h"
5153

‎src/backend/access/nbtree/nbtpage.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtpage.c,v 1.2 1996/10/20 10:53:06 scrappy Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtpage.c,v 1.3 1996/10/23 07:39:04 scrappy Exp $
1212
*
1313
* NOTES
1414
* Postgres btree pages look like ordinary relation pages. The opaque
@@ -19,6 +19,8 @@
1919
*
2020
*-------------------------------------------------------------------------
2121
*/
22+
#include<stdio.h>
23+
#include<time.h>
2224

2325
#include"postgres.h"
2426

@@ -36,7 +38,6 @@
3638
#include"utils/rel.h"
3739

3840
#include"storage/buf.h"
39-
4041
#include"storage/block.h"
4142
#include"storage/off.h"
4243
#include"storage/itemptr.h"
@@ -45,17 +46,16 @@
4546
#include"storage/itemid.h"
4647
#include"storage/item.h"
4748
#include"storage/bufpage.h"
48-
#include<time.h>
4949
#include"utils/nabstime.h"
5050
#include"access/htup.h"
5151
#include"utils/tqual.h"
5252
#include"access/relscan.h"
5353
#include"access/sdir.h"
5454
#include"access/nbtree.h"
5555

56-
#include<stdio.h>
5756
#include"storage/ipc.h"
5857
#include"storage/bufmgr.h"
58+
#include"storage/lmgr.h"
5959

6060
#defineBTREE_METAPAGE0
6161
#defineBTREE_MAGIC0x053162

‎src/backend/access/nbtree/nbtree.c

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtree.c,v 1.4 1996/10/20 10:53:08 scrappy Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtree.c,v 1.5 1996/10/23 07:39:06 scrappy Exp $
1212
*
1313
* NOTES
1414
* This file contains only the public interface routines.
1515
*
1616
*-------------------------------------------------------------------------
1717
*/
18+
#include<stdio.h>
19+
#include<time.h>
1820

1921
#include"postgres.h"
2022

@@ -25,6 +27,7 @@
2527
#include"storage/fd.h"
2628
#include"catalog/pg_am.h"
2729
#include"catalog/pg_class.h"
30+
#include"catalog/index.h"
2831
#include"nodes/nodes.h"
2932
#include"rewrite/prs2lock.h"
3033
#include"access/skey.h"
@@ -40,10 +43,11 @@
4043
#include"storage/item.h"
4144
#include"storage/buf.h"
4245
#include"storage/bufpage.h"
43-
#include<time.h>
46+
#include"storage/bufmgr.h"
4447
#include"utils/nabstime.h"
4548
#include"access/htup.h"
4649
#include"utils/tqual.h"
50+
#include"utils/palloc.h"
4751
#include"access/relscan.h"
4852
#include"access/sdir.h"
4953
#include"access/nbtree.h"
@@ -59,7 +63,6 @@
5963
#include"nodes/parsenodes.h"
6064
#include"tcop/dest.h"
6165
#include"executor/execdesc.h"
62-
#include<stdio.h>
6366
#include"catalog/pg_index.h"
6467
#include"executor/executor.h"
6568

@@ -96,13 +99,15 @@ btbuild(Relation heap,
9699
TupleDeschtupdesc,itupdesc;
97100
Datum*attdata;
98101
bool*nulls;
99-
InsertIndexResultres;
102+
InsertIndexResultres=0;
100103
intnhtups,nitups;
101104
inti;
102105
BTItembtitem;
106+
#ifndefOMIT_PARTIAL_INDEX
103107
ExprContext*econtext;
104108
TupleTabletupleTable;
105109
TupleTableSlot*slot;
110+
#endif
106111
Oidhrelid,irelid;
107112
Node*pred,*oldPred;
108113
void*spool;
@@ -139,6 +144,12 @@ btbuild(Relation heap,
139144
econtext=makeNode(ExprContext);
140145
FillDummyExprContext(econtext,slot,htupdesc,InvalidBuffer);
141146
}
147+
else
148+
{
149+
econtext=NULL;
150+
tupleTable=NULL;
151+
slot=NULL;
152+
}
142153
#endif/* OMIT_PARTIAL_INDEX */
143154

144155
/* start a heap scan */
@@ -152,6 +163,8 @@ btbuild(Relation heap,
152163
spool=_bt_spoolinit(index,7);
153164
res= (InsertIndexResult)NULL;
154165
}
166+
else
167+
spool=NULL;
155168

156169
for (;HeapTupleIsValid(htup);htup=heap_getnext(hscan,0,&buffer)) {
157170

‎src/backend/access/nbtree/nbtscan.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/Attic/nbtscan.c,v 1.2 1996/10/20 10:53:10 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/Attic/nbtscan.c,v 1.3 1996/10/23 07:39:08 scrappy Exp $
1111
*
1212
*
1313
* NOTES
@@ -55,6 +55,7 @@
5555
#include"utils/nabstime.h"
5656
#include"access/htup.h"
5757
#include"utils/tqual.h"
58+
#include"utils/palloc.h"
5859
#include"access/relscan.h"
5960
#include"access/sdir.h"
6061
#include"access/nbtree.h"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp