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

Commit27fbfd3

Browse files
committed
Remove a boatload of useless definitions of 'int optreset'. If we
are using our own ports of getopt or getopt_long, those will definethe variable for themselves; and if not, we don't need these, becausewe never touch the variable anyway.
1 parent2227e2f commit27fbfd3

File tree

11 files changed

+13
-47
lines changed

11 files changed

+13
-47
lines changed

‎src/backend/postmaster/postmaster.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
*
3838
*
3939
* IDENTIFICATION
40-
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.576 2009/03/04 13:56:40 heikki Exp $
40+
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.577 2009/04/05 04:19:58 tgl Exp $
4141
*
4242
* NOTES
4343
*
@@ -309,7 +309,7 @@ extern intoptind,
309309
opterr;
310310

311311
#ifdefHAVE_INT_OPTRESET
312-
externintoptreset;
312+
externintoptreset;/* might not be declared by system headers */
313313
#endif
314314

315315
/*

‎src/bin/initdb/initdb.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
* Portions Copyright (c) 1994, Regents of the University of California
4343
* Portions taken from FreeBSD.
4444
*
45-
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.169 2009/03/31 18:58:16 mha Exp $
45+
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.170 2009/04/05 04:19:58 tgl Exp $
4646
*
4747
*-------------------------------------------------------------------------
4848
*/
@@ -62,10 +62,6 @@
6262
#include"getopt_long.h"
6363
#include"miscadmin.h"
6464

65-
#ifndefHAVE_INT_OPTRESET
66-
intoptreset;
67-
#endif
68-
6965

7066
/*
7167
* these values are passed in by makefile defines

‎src/bin/pg_ctl/pg_ctl.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
66
*
7-
* $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.109 2009/02/25 13:03:06 petere Exp $
7+
* $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.110 2009/04/05 04:19:58 tgl Exp $
88
*
99
*-------------------------------------------------------------------------
1010
*/
@@ -42,10 +42,6 @@
4242
#undef WIN32
4343
#endif
4444

45-
#ifndefHAVE_INT_OPTRESET
46-
intoptreset;
47-
#endif
48-
4945
/* PID can be negative for standalone backend */
5046
typedeflongpgpid_t;
5147

‎src/bin/pg_dump/pg_dump.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*by PostgreSQL
1313
*
1414
* IDENTIFICATION
15-
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.532 2009/04/01 18:54:27 tgl Exp $
15+
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.533 2009/04/05 04:19:58 tgl Exp $
1616
*
1717
*-------------------------------------------------------------------------
1818
*/
@@ -30,10 +30,6 @@
3030

3131
#include"getopt_long.h"
3232

33-
#ifndefHAVE_INT_OPTRESET
34-
intoptreset;
35-
#endif
36-
3733
#include"access/attnum.h"
3834
#include"access/sysattr.h"
3935
#include"catalog/pg_cast.h"

‎src/bin/pg_dump/pg_dumpall.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1994, Regents of the University of California
77
*
88
*
9-
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.120 2009/03/22 16:44:26 tgl Exp $
9+
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.121 2009/04/05 04:19:58 tgl Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -22,10 +22,6 @@
2222

2323
#include"getopt_long.h"
2424

25-
#ifndefHAVE_INT_OPTRESET
26-
intoptreset;
27-
#endif
28-
2925
#include"dumputils.h"
3026
#include"pg_backup.h"
3127

‎src/bin/pg_dump/pg_restore.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
*
3535
*
3636
* IDENTIFICATION
37-
*$PostgreSQL: pgsql/src/bin/pg_dump/pg_restore.c,v 1.96 2009/03/20 09:21:09 petere Exp $
37+
*$PostgreSQL: pgsql/src/bin/pg_dump/pg_restore.c,v 1.97 2009/04/05 04:19:58 tgl Exp $
3838
*
3939
*-------------------------------------------------------------------------
4040
*/
@@ -55,10 +55,6 @@
5555
externchar*optarg;
5656
externintoptind;
5757

58-
#ifndefHAVE_INT_OPTRESET
59-
intoptreset;
60-
#endif
61-
6258
#ifdefENABLE_NLS
6359
#include<locale.h>
6460
#endif

‎src/bin/psql/startup.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 2000-2009, PostgreSQL Global Development Group
55
*
6-
* $PostgreSQL: pgsql/src/bin/psql/startup.c,v 1.155 2009/02/26 16:02:38 petere Exp $
6+
* $PostgreSQL: pgsql/src/bin/psql/startup.c,v 1.156 2009/04/05 04:19:58 tgl Exp $
77
*/
88
#include"postgres_fe.h"
99

@@ -18,13 +18,8 @@
1818

1919
#include"getopt_long.h"
2020

21-
#ifndefHAVE_INT_OPTRESET
22-
intoptreset;
23-
#endif
24-
2521
#include<locale.h>
2622

27-
2823
#include"command.h"
2924
#include"common.h"
3025
#include"describe.h"

‎src/bin/scripts/common.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/bin/scripts/common.c,v 1.35 2009/02/26 16:02:38 petere Exp $
10+
* $PostgreSQL: pgsql/src/bin/scripts/common.c,v 1.36 2009/04/05 04:19:59 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -24,10 +24,6 @@
2424
staticvoidSetCancelConn(PGconn*conn);
2525
staticvoidResetCancelConn(void);
2626

27-
#ifndefHAVE_INT_OPTRESET
28-
intoptreset;
29-
#endif
30-
3127
staticPGcancel*volatilecancelConn=NULL;
3228

3329
#ifdefWIN32

‎src/bin/scripts/common.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
*Copyright (c) 2003-2009, PostgreSQL Global Development Group
66
*
7-
*$PostgreSQL: pgsql/src/bin/scripts/common.h,v 1.22 2009/02/26 16:02:39 petere Exp $
7+
*$PostgreSQL: pgsql/src/bin/scripts/common.h,v 1.23 2009/04/05 04:19:59 tgl Exp $
88
*/
99
#ifndefCOMMON_H
1010
#defineCOMMON_H
@@ -13,10 +13,6 @@
1313
#include"getopt_long.h"
1414
#include"pqexpbuffer.h"
1515

16-
#ifndefHAVE_INT_OPTRESET
17-
externintoptreset;
18-
#endif
19-
2016
enumtrivalue
2117
{
2218
TRI_DEFAULT,

‎src/include/getopt_long.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Portions Copyright (c) 2003-2009, PostgreSQL Global Development Group
66
*
7-
* $PostgreSQL: pgsql/src/include/getopt_long.h,v 1.10 2009/01/01 17:23:55 momjian Exp $
7+
* $PostgreSQL: pgsql/src/include/getopt_long.h,v 1.11 2009/04/05 04:19:59 tgl Exp $
88
*/
99
#ifndefGETOPT_LONG_H
1010
#defineGETOPT_LONG_H
@@ -18,8 +18,6 @@ extern intopterr;
1818
externintoptind;
1919
externintoptopt;
2020
externchar*optarg;
21-
22-
/* Some systems have this, otherwise you need to define it somewhere. */
2321
externintoptreset;
2422

2523
#ifndefHAVE_STRUCT_OPTION

‎src/port/getopt_long.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3232
* SUCH DAMAGE.
3333
*
34-
* $PostgreSQL: pgsql/src/port/getopt_long.c,v 1.6 2007/03/26 21:44:11 momjian Exp $
34+
* $PostgreSQL: pgsql/src/port/getopt_long.c,v 1.7 2009/04/05 04:19:59 tgl Exp $
3535
*/
3636

3737
#include"c.h"
@@ -40,6 +40,7 @@
4040

4141
#ifndefHAVE_INT_OPTRESET
4242
intoptreset;
43+
/* else the "extern" was provided by getopt_long.h */
4344
#endif
4445

4546
#defineBADCH'?'

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp