Skip to content

Commit 27fbfd3

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 define the variable for themselves; and if not, we don't need these, because we never touch the variable anyway.
1 parent 2227e2f commit 27fbfd3

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 int optind,
309309
opterr;
310310

311311
#ifdef HAVE_INT_OPTRESET
312-
extern int optreset;
312+
extern int optreset; /* 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-
#ifndef HAVE_INT_OPTRESET
66-
int optreset;
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-
#ifndef HAVE_INT_OPTRESET
46-
int optreset;
47-
#endif
48-
4945
/* PID can be negative for standalone backend */
5046
typedef long pgpid_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-
#ifndef HAVE_INT_OPTRESET
34-
int optreset;
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-
#ifndef HAVE_INT_OPTRESET
26-
int optreset;
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
extern char *optarg;
5656
extern int optind;
5757

58-
#ifndef HAVE_INT_OPTRESET
59-
int optreset;
60-
#endif
61-
6258
#ifdef ENABLE_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-
#ifndef HAVE_INT_OPTRESET
22-
int optreset;
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
static void SetCancelConn(PGconn *conn);
2525
static void ResetCancelConn(void);
2626

27-
#ifndef HAVE_INT_OPTRESET
28-
int optreset;
29-
#endif
30-
3127
static PGcancel *volatile cancelConn = NULL;
3228

3329
#ifdef WIN32

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
#ifndef COMMON_H
1010
#define COMMON_H
@@ -13,10 +13,6 @@
1313
#include "getopt_long.h"
1414
#include "pqexpbuffer.h"
1515

16-
#ifndef HAVE_INT_OPTRESET
17-
extern int optreset;
18-
#endif
19-
2016
enum trivalue
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
#ifndef GETOPT_LONG_H
1010
#define GETOPT_LONG_H
@@ -18,8 +18,6 @@ extern int opterr;
1818
extern int optind;
1919
extern int optopt;
2020
extern char *optarg;
21-
22-
/* Some systems have this, otherwise you need to define it somewhere. */
2321
extern int optreset;
2422

2523
#ifndef HAVE_STRUCT_OPTION

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy