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

Commit5caa347

Browse files
committed
Clean up most -Wunused-but-set-variable warnings from gcc 4.6
This warning is new in gcc 4.6 and part of -Wall. This patch cleansup most of the noise, but there are some still warnings that aretrickier to remove.
1 parent3c381a5 commit5caa347

File tree

34 files changed

+64
-188
lines changed

34 files changed

+64
-188
lines changed

‎contrib/isn/isn.c‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -341,8 +341,7 @@ ean2isn(ean13 ean, bool errorOK, ean13 *result, enum isn_type accept)
341341
enumisn_typetype=INVALID;
342342

343343
charbuf[MAXEAN13LEN+1];
344-
char*firstdig,
345-
*aux;
344+
char*aux;
346345
unsigneddigval;
347346
unsignedsearch;
348347
ean13ret=ean;
@@ -354,7 +353,7 @@ ean2isn(ean13 ean, bool errorOK, ean13 *result, enum isn_type accept)
354353

355354
/* convert the number */
356355
search=0;
357-
firstdig=aux=buf+13;
356+
aux=buf+13;
358357
*aux='\0';/* terminate string; aux points to last digit */
359358
do
360359
{
@@ -528,8 +527,7 @@ ean2string(ean13 ean, bool errorOK, char *result, bool shortType)
528527
constunsigned (*TABLE_index)[2];
529528
enumisn_typetype=INVALID;
530529

531-
char*firstdig,
532-
*aux;
530+
char*aux;
533531
unsigneddigval;
534532
unsignedsearch;
535533
charvalid='\0';/* was the number initially written with a
@@ -546,7 +544,7 @@ ean2string(ean13 ean, bool errorOK, char *result, bool shortType)
546544

547545
/* convert the number */
548546
search=0;
549-
firstdig=aux=result+MAXEAN13LEN;
547+
aux=result+MAXEAN13LEN;
550548
*aux='\0';/* terminate string; aux points to last digit */
551549
*--aux=valid;/* append '!' for numbers with invalid but
552550
* corrected check digit */

‎contrib/pageinspect/fsmfuncs.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ Datum
3535
fsm_page_contents(PG_FUNCTION_ARGS)
3636
{
3737
bytea*raw_page=PG_GETARG_BYTEA_P(0);
38-
intraw_page_size;
3938
StringInfoDatasinfo;
4039
FSMPagefsmpage;
4140
inti;
@@ -45,7 +44,6 @@ fsm_page_contents(PG_FUNCTION_ARGS)
4544
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
4645
(errmsg("must be superuser to use raw page functions"))));
4746

48-
raw_page_size=VARSIZE(raw_page)-VARHDRSZ;
4947
fsmpage= (FSMPage)PageGetContents(VARDATA(raw_page));
5048

5149
initStringInfo(&sinfo);

‎contrib/pgcrypto/pgp-s2k.c‎

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,12 @@ static int
3939
calc_s2k_simple(PGP_S2K*s2k,PX_MD*md,constuint8*key,
4040
unsignedkey_len)
4141
{
42-
unsignedmd_bs,
43-
md_rlen;
42+
unsignedmd_rlen;
4443
uint8buf[PGP_MAX_DIGEST];
4544
unsignedpreload;
4645
unsignedremain;
4746
uint8*dst=s2k->key;
4847

49-
md_bs=px_md_block_size(md);
5048
md_rlen=px_md_result_size(md);
5149

5250
remain=s2k->key_len;
@@ -83,14 +81,12 @@ calc_s2k_simple(PGP_S2K *s2k, PX_MD *md, const uint8 *key,
8381
staticint
8482
calc_s2k_salted(PGP_S2K*s2k,PX_MD*md,constuint8*key,unsignedkey_len)
8583
{
86-
unsignedmd_bs,
87-
md_rlen;
84+
unsignedmd_rlen;
8885
uint8buf[PGP_MAX_DIGEST];
8986
unsignedpreload=0;
9087
uint8*dst;
9188
unsignedremain;
9289

93-
md_bs=px_md_block_size(md);
9490
md_rlen=px_md_result_size(md);
9591

9692
dst=s2k->key;
@@ -129,8 +125,7 @@ static int
129125
calc_s2k_iter_salted(PGP_S2K*s2k,PX_MD*md,constuint8*key,
130126
unsignedkey_len)
131127
{
132-
unsignedmd_bs,
133-
md_rlen;
128+
unsignedmd_rlen;
134129
uint8buf[PGP_MAX_DIGEST];
135130
uint8*dst;
136131
unsignedpreload=0;
@@ -143,7 +138,6 @@ calc_s2k_iter_salted(PGP_S2K *s2k, PX_MD *md, const uint8 *key,
143138
cval=s2k->iter;
144139
count= ((unsigned)16+ (cval&15)) << ((cval >>4)+6);
145140

146-
md_bs=px_md_block_size(md);
147141
md_rlen=px_md_result_size(md);
148142

149143
remain=s2k->key_len;

‎contrib/pgcrypto/px-hmac.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,11 @@ static void
5252
hmac_init(PX_HMAC*h,constuint8*key,unsignedklen)
5353
{
5454
unsignedbs,
55-
hlen,
5655
i;
5756
uint8*keybuf;
5857
PX_MD*md=h->md;
5958

6059
bs=px_md_block_size(md);
61-
hlen=px_md_result_size(md);
6260
keybuf=px_alloc(bs);
6361
memset(keybuf,0,bs);
6462

‎contrib/pgcrypto/px.c‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,14 +162,12 @@ combo_init(PX_Combo *cx, const uint8 *key, unsigned klen,
162162
constuint8*iv,unsignedivlen)
163163
{
164164
interr;
165-
unsignedbs,
166-
ks,
165+
unsignedks,
167166
ivs;
168167
PX_Cipher*c=cx->cipher;
169168
uint8*ivbuf=NULL;
170169
uint8*keybuf;
171170

172-
bs=px_cipher_block_size(c);
173171
ks=px_cipher_key_size(c);
174172

175173
ivs=px_cipher_iv_size(c);
@@ -205,15 +203,13 @@ combo_encrypt(PX_Combo *cx, const uint8 *data, unsigned dlen,
205203
interr=0;
206204
uint8*bbuf;
207205
unsignedbs,
208-
maxlen,
209206
bpos,
210207
i,
211208
pad;
212209

213210
PX_Cipher*c=cx->cipher;
214211

215212
bbuf=NULL;
216-
maxlen=*rlen;
217213
bs=px_cipher_block_size(c);
218214

219215
/* encrypt */

‎contrib/seg/seg.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,6 @@ restore(char *result, float val, int n)
867867
'0','0','0','0','\0'
868868
};
869869
char*p;
870-
char*mant;
871870
intexp;
872871
inti,
873872
dp,
@@ -893,7 +892,7 @@ restore(char *result, float val, int n)
893892
*p='\0';
894893

895894
/* get the exponent */
896-
mant= (char*)strtok(strdup(result),"e");
895+
strtok(strdup(result),"e");
897896
exp=atoi(strtok(NULL,"e"));
898897

899898
if (exp==0)

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ gistvacuumcleanup(PG_FUNCTION_ARGS)
3838
BlockNumbernpages,
3939
blkno;
4040
BlockNumbertotFreePages;
41-
BlockNumberlastBlock=GIST_ROOT_BLKNO,
42-
lastFilledBlock=GIST_ROOT_BLKNO;
4341
boolneedLock;
4442

4543
/* No-op in ANALYZE ONLY mode */
@@ -90,11 +88,8 @@ gistvacuumcleanup(PG_FUNCTION_ARGS)
9088
totFreePages++;
9189
RecordFreeIndexPage(rel,blkno);
9290
}
93-
else
94-
lastFilledBlock=blkno;
9591
UnlockReleaseBuffer(buffer);
9692
}
97-
lastBlock=npages-1;
9893

9994
/* Finally, vacuum the FSM */
10095
IndexFreeSpaceMapVacuum(info->index);

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,6 @@ _bt_log_reuse_page(Relation rel, BlockNumber blkno, TransactionId latestRemovedX
466466

467467
/* XLOG stuff */
468468
{
469-
XLogRecPtrrecptr;
470469
XLogRecDatardata[1];
471470
xl_btree_reuse_pagexlrec_reuse;
472471

@@ -478,7 +477,7 @@ _bt_log_reuse_page(Relation rel, BlockNumber blkno, TransactionId latestRemovedX
478477
rdata[0].buffer=InvalidBuffer;
479478
rdata[0].next=NULL;
480479

481-
recptr=XLogInsert(RM_BTREE_ID,XLOG_BTREE_REUSE_PAGE,rdata);
480+
XLogInsert(RM_BTREE_ID,XLOG_BTREE_REUSE_PAGE,rdata);
482481

483482
/*
484483
* We don't do PageSetLSN or PageSetTLI here because we're about

‎src/backend/catalog/pg_proc.c‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,6 @@ fmgr_internal_validator(PG_FUNCTION_ARGS)
671671
{
672672
Oidfuncoid=PG_GETARG_OID(0);
673673
HeapTupletuple;
674-
Form_pg_procproc;
675674
boolisnull;
676675
Datumtmp;
677676
char*prosrc;
@@ -684,7 +683,6 @@ fmgr_internal_validator(PG_FUNCTION_ARGS)
684683
tuple=SearchSysCache1(PROCOID,ObjectIdGetDatum(funcoid));
685684
if (!HeapTupleIsValid(tuple))
686685
elog(ERROR,"cache lookup failed for function %u",funcoid);
687-
proc= (Form_pg_proc)GETSTRUCT(tuple);
688686

689687
tmp=SysCacheGetAttr(PROCOID,tuple,Anum_pg_proc_prosrc,&isnull);
690688
if (isnull)
@@ -717,7 +715,6 @@ fmgr_c_validator(PG_FUNCTION_ARGS)
717715
Oidfuncoid=PG_GETARG_OID(0);
718716
void*libraryhandle;
719717
HeapTupletuple;
720-
Form_pg_procproc;
721718
boolisnull;
722719
Datumtmp;
723720
char*prosrc;
@@ -732,7 +729,6 @@ fmgr_c_validator(PG_FUNCTION_ARGS)
732729
tuple=SearchSysCache1(PROCOID,ObjectIdGetDatum(funcoid));
733730
if (!HeapTupleIsValid(tuple))
734731
elog(ERROR,"cache lookup failed for function %u",funcoid);
735-
proc= (Form_pg_proc)GETSTRUCT(tuple);
736732

737733
tmp=SysCacheGetAttr(PROCOID,tuple,Anum_pg_proc_prosrc,&isnull);
738734
if (isnull)

‎src/backend/catalog/toasting.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid, Datum reloptio
118118
Relationtoast_rel;
119119
Relationclass_rel;
120120
Oidtoast_relid;
121-
Oidtoast_idxid;
122121
Oidtoast_typid=InvalidOid;
123122
Oidnamespaceid;
124123
chartoast_relname[NAMEDATALEN];
@@ -274,7 +273,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid, Datum reloptio
274273
coloptions[0]=0;
275274
coloptions[1]=0;
276275

277-
toast_idxid=index_create(toast_rel,toast_idxname,toastIndexOid,
276+
index_create(toast_rel,toast_idxname,toastIndexOid,
278277
indexInfo,
279278
list_make2("chunk_id","chunk_seq"),
280279
BTREE_AM_OID,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp