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

Commit9e3755e

Browse files
committed
Remove useless duplicate inclusions of system header files.
c.h #includes a number of core libc header files, such as <stdio.h>.There's no point in re-including these after having read postgres.h,postgres_fe.h, or c.h; so remove code that did so.While at it, also fix some places that were ignoring our standard patternof "include postgres[_fe].h, then system header files, then other Postgresheader files". While there's not any great magic in doing it that wayrather than system headers last, it's silly to have just a few filesdeviating from the general pattern. (But I didn't attempt to enforce thisglobally, only in files I was touching anyway.)I'd be the first to say that this is mostly compulsive neatnik-ism,but over time it might save enough compile cycles to be useful.
1 parent5639ced commit9e3755e

File tree

77 files changed

+41
-155
lines changed

Some content is hidden

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

77 files changed

+41
-155
lines changed

‎contrib/fuzzystrmatch/dmetaphone.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,6 @@ The remaining code is authored by Andrew Dunstan <amdunstan@ncshp.org> and
9393
***********************************************************************/
9494

9595

96-
97-
98-
9996
/* include these first, according to the docs */
10097
#ifndefDMETAPHONE_MAIN
10198

@@ -105,14 +102,19 @@ The remaining code is authored by Andrew Dunstan <amdunstan@ncshp.org> and
105102

106103
/* turn off assertions for embedded function */
107104
#defineNDEBUG
108-
#endif
109105

106+
#else/* DMETAPHONE_MAIN */
107+
108+
/* we need these if we didn't get them from postgres.h */
110109
#include<stdio.h>
111-
#include<ctype.h>
112110
#include<stdlib.h>
113111
#include<string.h>
114112
#include<stdarg.h>
113+
114+
#endif/* DMETAPHONE_MAIN */
115+
115116
#include<assert.h>
117+
#include<ctype.h>
116118

117119
/* prototype for the main function we got from the perl module */
118120
staticvoidDoubleMetaphone(char*,char**);

‎contrib/ltree/crc32.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@
99

1010
#include"postgres.h"
1111

12-
#include<sys/types.h>
13-
#include<stdio.h>
14-
#include<sys/types.h>
15-
1612
#ifdefLOWER_NODE
1713
#include<ctype.h>
1814
#defineTOLOWER(x)tolower((unsigned char) (x))

‎contrib/pgcrypto/px.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
#ifndef__PX_H
3333
#define__PX_H
3434

35-
#include<sys/types.h>
3635
#include<sys/param.h>
3736

3837
/* keep debug messages? */

‎src/backend/access/transam/timeline.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
#include"postgres.h"
3333

3434
#include<sys/stat.h>
35-
#include<stdio.h>
3635
#include<unistd.h>
3736

3837
#include"access/timeline.h"

‎src/backend/access/transam/twophase.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@
5454

5555
#include<fcntl.h>
5656
#include<sys/stat.h>
57-
#include<sys/types.h>
5857
#include<time.h>
5958
#include<unistd.h>
6059

‎src/backend/access/transam/xlogarchive.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
#include"postgres.h"
1616

17-
#include<sys/types.h>
1817
#include<sys/stat.h>
1918
#include<sys/wait.h>
2019
#include<signal.h>

‎src/backend/commands/dbcommands.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include"postgres.h"
2121

2222
#include<fcntl.h>
23-
#include<locale.h>
2423
#include<unistd.h>
2524
#include<sys/stat.h>
2625

‎src/backend/commands/tablespace.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848

4949
#include<unistd.h>
5050
#include<dirent.h>
51-
#include<sys/types.h>
5251
#include<sys/stat.h>
5352

5453
#include"access/heapam.h"

‎src/backend/libpq/ifaddr.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include"postgres.h"
2121

2222
#include<unistd.h>
23-
#include<sys/types.h>
2423
#include<sys/stat.h>
2524
#include<sys/socket.h>
2625
#include<netdb.h>

‎src/backend/port/atomics.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#ifdefWIN32
2222
#error "barriers are required (and provided) on WIN32 platforms"
2323
#endif
24-
#include<sys/types.h>
2524
#include<signal.h>
2625
#endif
2726

‎src/backend/port/dynloader/freebsd.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#ifndefPORT_PROTOS_H
1414
#definePORT_PROTOS_H
1515

16-
#include<sys/types.h>
1716
#include<nlist.h>
1817
#include<link.h>
1918
#include<dlfcn.h>

‎src/backend/port/dynloader/netbsd.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#ifndefPORT_PROTOS_H
1515
#definePORT_PROTOS_H
1616

17-
#include<sys/types.h>
1817
#include<nlist.h>
1918
#include<link.h>
2019
#include<dlfcn.h>

‎src/backend/port/dynloader/openbsd.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#ifndefPORT_PROTOS_H
1414
#definePORT_PROTOS_H
1515

16-
#include<sys/types.h>
1716
#include<nlist.h>
1817
#include<link.h>
1918
#include<dlfcn.h>

‎src/backend/port/win32/crashdump.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@
3939
#include"postgres.h"
4040

4141
#defineWIN32_LEAN_AND_MEAN
42-
#include<windows.h>
43-
#include<string.h>
42+
4443
/*
4544
* Some versions of the MS SDK contain "typedef enum { ... } ;" which the MS
4645
* compiler quite sanely complains about. Well done, Microsoft.

‎src/backend/postmaster/autovacuum.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@
6262
#include"postgres.h"
6363

6464
#include<signal.h>
65-
#include<sys/types.h>
6665
#include<sys/time.h>
6766
#include<unistd.h>
6867

‎src/backend/replication/basebackup.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
*/
1313
#include"postgres.h"
1414

15-
#include<sys/types.h>
1615
#include<sys/stat.h>
1716
#include<unistd.h>
1817
#include<time.h>

‎src/backend/replication/logical/snapbuild.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@
107107
#include"postgres.h"
108108

109109
#include<sys/stat.h>
110-
#include<sys/types.h>
111110
#include<unistd.h>
112111

113112
#include"miscadmin.h"

‎src/backend/replication/walreceiverfuncs.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
*/
1717
#include"postgres.h"
1818

19-
#include<sys/types.h>
2019
#include<sys/stat.h>
2120
#include<sys/time.h>
2221
#include<time.h>

‎src/backend/storage/ipc/dsm.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#include"postgres.h"
2828

2929
#include<fcntl.h>
30-
#include<string.h>
3130
#include<unistd.h>
3231
#ifndefWIN32
3332
#include<sys/mman.h>

‎src/backend/storage/ipc/dsm_impl.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
#include"postgres.h"
5050

5151
#include<fcntl.h>
52-
#include<string.h>
5352
#include<unistd.h>
5453
#ifndefWIN32
5554
#include<sys/mman.h>

‎src/backend/storage/ipc/latch.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
#include<signal.h>
4141
#include<unistd.h>
4242
#include<sys/time.h>
43-
#include<sys/types.h>
4443
#ifdefHAVE_SYS_EPOLL_H
4544
#include<sys/epoll.h>
4645
#endif

‎src/backend/utils/adt/cash.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include<limits.h>
2222
#include<ctype.h>
2323
#include<math.h>
24-
#include<locale.h>
2524

2625
#include"libpq/pqformat.h"
2726
#include"utils/builtins.h"

‎src/backend/utils/adt/dbsize.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
#include"postgres.h"
1313

14-
#include<sys/types.h>
1514
#include<sys/stat.h>
1615

1716
#include"access/heapam.h"

‎src/backend/utils/adt/inet_cidr_ntop.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ static const char rcsid[] = "Id: inet_net_ntop.c,v 1.1.2.2 2004/03/09 09:17:27 m
2323

2424
#include"postgres.h"
2525

26-
#include<sys/types.h>
2726
#include<sys/socket.h>
2827
#include<netinet/in.h>
2928
#include<arpa/inet.h>

‎src/backend/utils/adt/inet_net_pton.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ static const char rcsid[] = "Id: inet_net_pton.c,v 1.4.2.3 2004/03/17 00:40:11 m
2323

2424
#include"postgres.h"
2525

26-
#include<sys/types.h>
2726
#include<sys/socket.h>
2827
#include<netinet/in.h>
2928
#include<arpa/inet.h>

‎src/backend/utils/adt/pg_locale.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151

5252
#include"postgres.h"
5353

54-
#include<locale.h>
5554
#include<time.h>
5655

5756
#include"access/htup_details.h"

‎src/backend/utils/init/miscinit.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include<sys/file.h>
2121
#include<sys/stat.h>
2222
#include<sys/time.h>
23-
#include<sys/types.h>
2423
#include<fcntl.h>
2524
#include<unistd.h>
2625
#include<grp.h>

‎src/bin/initdb/initdb.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
#include<fcntl.h>
5353
#include<sys/stat.h>
5454
#include<unistd.h>
55-
#include<locale.h>
5655
#include<signal.h>
5756
#include<time.h>
5857

‎src/bin/pg_basebackup/pg_basebackup.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#include<unistd.h>
1717
#include<dirent.h>
1818
#include<sys/stat.h>
19-
#include<sys/types.h>
2019
#include<sys/wait.h>
2120
#include<signal.h>
2221
#include<time.h>

‎src/bin/pg_basebackup/pg_receivewal.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#include<dirent.h>
1818
#include<signal.h>
1919
#include<sys/stat.h>
20-
#include<sys/types.h>
2120
#include<unistd.h>
2221

2322
#include"libpq-fe.h"

‎src/bin/pg_basebackup/streamutil.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@
1313

1414
#include"postgres_fe.h"
1515

16-
#include<stdio.h>
17-
#include<string.h>
1816
#include<sys/time.h>
19-
#include<sys/types.h>
2017
#include<unistd.h>
2118

2219
/* for ntohl/htonl */

‎src/bin/pg_ctl/pg_ctl.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,9 @@
1919

2020
#include"postgres_fe.h"
2121

22-
#include"catalog/pg_control.h"
23-
#include"common/controldata_utils.h"
24-
#include"libpq-fe.h"
25-
#include"pqexpbuffer.h"
26-
2722
#include<fcntl.h>
28-
#include<locale.h>
2923
#include<signal.h>
3024
#include<time.h>
31-
#include<sys/types.h>
3225
#include<sys/stat.h>
3326
#include<sys/wait.h>
3427
#include<unistd.h>
@@ -38,8 +31,12 @@
3831
#include<sys/resource.h>
3932
#endif
4033

34+
#include"catalog/pg_control.h"
35+
#include"common/controldata_utils.h"
4136
#include"getopt_long.h"
37+
#include"libpq-fe.h"
4238
#include"miscadmin.h"
39+
#include"pqexpbuffer.h"
4340

4441
/* PID can be negative for standalone backend */
4542
typedeflongpgpid_t;

‎src/bin/pg_dump/parallel.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@
5151

5252
#include"postgres_fe.h"
5353

54+
#ifndefWIN32
55+
#include<sys/wait.h>
56+
#include<signal.h>
57+
#include<unistd.h>
58+
#include<fcntl.h>
59+
#endif
5460
#ifdefHAVE_SYS_SELECT_H
5561
#include<sys/select.h>
5662
#endif
@@ -59,14 +65,6 @@
5965
#include"pg_backup_utils.h"
6066
#include"fe_utils/string_utils.h"
6167

62-
#ifndefWIN32
63-
#include<sys/types.h>
64-
#include<sys/wait.h>
65-
#include"signal.h"
66-
#include<unistd.h>
67-
#include<fcntl.h>
68-
#endif
69-
7068
/* Mnemonic macros for indexing the fd array returned by pipe(2) */
7169
#definePIPE_READ0
7270
#definePIPE_WRITE1

‎src/bin/pg_dump/pg_backup_archiver.c

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,22 @@
2121
*/
2222
#include"postgres_fe.h"
2323

24-
#include"parallel.h"
25-
#include"pg_backup_archiver.h"
26-
#include"pg_backup_db.h"
27-
#include"pg_backup_utils.h"
28-
#include"dumputils.h"
29-
#include"fe_utils/string_utils.h"
30-
3124
#include<ctype.h>
3225
#include<fcntl.h>
3326
#include<unistd.h>
3427
#include<sys/stat.h>
35-
#include<sys/types.h>
3628
#include<sys/wait.h>
37-
3829
#ifdefWIN32
3930
#include<io.h>
4031
#endif
4132

33+
#include"parallel.h"
34+
#include"pg_backup_archiver.h"
35+
#include"pg_backup_db.h"
36+
#include"pg_backup_utils.h"
37+
#include"dumputils.h"
38+
#include"fe_utils/string_utils.h"
39+
4240
#include"libpq/libpq-fs.h"
4341

4442
#defineTEXT_DUMP_HEADER "--\n-- PostgreSQL database dump\n--\n\n"

‎src/bin/pg_dump/pg_dump.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@
3333

3434
#include <unistd.h>
3535
#include <ctype.h>
36-
#ifdef ENABLE_NLS
37-
#include <locale.h>
38-
#endif
3936
#ifdef HAVE_TERMIOS_H
4037
#include <termios.h>
4138
#endif

‎src/bin/pg_dump/pg_dumpall.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@
1818
#include<time.h>
1919
#include<unistd.h>
2020

21-
#ifdefENABLE_NLS
22-
#include<locale.h>
23-
#endif
24-
2521
#include"getopt_long.h"
2622

2723
#include"dumputils.h"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp