From bea4792125389bb68e043ac38b0fed8790d42484 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Fri, 8 Nov 2002 20:23:57 +0000 Subject: [PATCH] This patch removes a bunch of superfluous #include directives: if postgres.h or c.h includes a system header (such as stdio.h or stdlib.h), there's no need to specifically include it in any of the .c files in the backend. Neil Conway --- src/backend/access/transam/xlog.c | 3 +-- src/backend/main/main.c | 3 +-- src/backend/port/beos/sem.c | 1 - src/backend/port/beos/shm.c | 1 - src/backend/port/darwin/system.c | 3 --- src/backend/port/dynloader/aix.c | 1 - src/backend/port/dynloader/freebsd.c | 3 --- src/backend/port/dynloader/netbsd.c | 3 --- src/backend/port/dynloader/nextstep.c | 2 -- src/backend/port/dynloader/openbsd.c | 3 --- src/backend/port/dynloader/qnx4.c | 7 ++++--- src/backend/port/dynloader/ultrix4.c | 4 ++-- src/backend/port/qnx4/sem.c | 3 +-- src/backend/port/qnx4/shm.c | 4 +--- src/backend/port/qnx4/tstrint.c | 4 +--- src/backend/port/qnx4/tstsem.c | 4 +--- src/backend/port/qnx4/tstshm.c | 4 +--- src/backend/regex/regcomp.c | 1 - src/backend/regex/regexec.c | 1 - src/backend/utils/adt/formatting.c | 3 +-- src/backend/utils/adt/selfuncs.c | 3 +-- src/backend/utils/init/miscinit.c | 3 +-- src/backend/utils/misc/database.c | 4 +--- src/backend/utils/misc/guc-file.l | 4 +--- 24 files changed, 18 insertions(+), 54 deletions(-) diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 6152ab88c1..a78533c389 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.109 2002/11/02 15:54:12 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.110 2002/11/08 20:23:56 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -21,7 +21,6 @@ #include #include #include -#include #include "access/clog.h" #include "access/transam.h" diff --git a/src/backend/main/main.c b/src/backend/main/main.c index 163d57d0df..8f69e0a693 100644 --- a/src/backend/main/main.c +++ b/src/backend/main/main.c @@ -13,7 +13,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/main/main.c,v 1.55 2002/10/31 22:37:19 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/main/main.c,v 1.56 2002/11/08 20:23:56 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -22,7 +22,6 @@ #include #include #include -#include #if defined(__alpha) && defined(__osf__) #include diff --git a/src/backend/port/beos/sem.c b/src/backend/port/beos/sem.c index 6609f1dde0..f1d2c1c63f 100644 --- a/src/backend/port/beos/sem.c +++ b/src/backend/port/beos/sem.c @@ -10,7 +10,6 @@ #include "postgres.h" -#include #include #include #include diff --git a/src/backend/port/beos/shm.c b/src/backend/port/beos/shm.c index 7903ce74ad..94da461ea2 100644 --- a/src/backend/port/beos/shm.c +++ b/src/backend/port/beos/shm.c @@ -9,7 +9,6 @@ */ #include "postgres.h" -#include #include #include diff --git a/src/backend/port/darwin/system.c b/src/backend/port/darwin/system.c index f66782eb36..a0c0801f2a 100644 --- a/src/backend/port/darwin/system.c +++ b/src/backend/port/darwin/system.c @@ -37,11 +37,8 @@ static char sccsid[] = "@(#)system.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ -#include #include #include -#include -#include #include #include #include diff --git a/src/backend/port/dynloader/aix.c b/src/backend/port/dynloader/aix.c index 97a916d8a3..a5d355c2cc 100644 --- a/src/backend/port/dynloader/aix.c +++ b/src/backend/port/dynloader/aix.c @@ -6,7 +6,6 @@ #include "postgres.h" -#include #include #include "sys/ldr.h" #include diff --git a/src/backend/port/dynloader/freebsd.c b/src/backend/port/dynloader/freebsd.c index 763749fa45..9ad2cde204 100644 --- a/src/backend/port/dynloader/freebsd.c +++ b/src/backend/port/dynloader/freebsd.c @@ -43,9 +43,6 @@ static char sccsid[] = "@(#)dl.c 5.4 (Berkeley) 2/23/91"; #include #include -#include -#include - static char error_message[BUFSIZ]; char * diff --git a/src/backend/port/dynloader/netbsd.c b/src/backend/port/dynloader/netbsd.c index 2202b6847b..3c950baddc 100644 --- a/src/backend/port/dynloader/netbsd.c +++ b/src/backend/port/dynloader/netbsd.c @@ -42,9 +42,6 @@ static char sccsid[] = "@(#)dl.c 5.4 (Berkeley) 2/23/91"; #include #include -#include -#include - #include "dynloader.h" static char error_message[BUFSIZ]; diff --git a/src/backend/port/dynloader/nextstep.c b/src/backend/port/dynloader/nextstep.c index a96b394cda..09b317daf9 100644 --- a/src/backend/port/dynloader/nextstep.c +++ b/src/backend/port/dynloader/nextstep.c @@ -3,8 +3,6 @@ #include "mach-o/rld.h" #include "streams/streams.h" -#include - static char *lastError = NULL; static NXStream * diff --git a/src/backend/port/dynloader/openbsd.c b/src/backend/port/dynloader/openbsd.c index 2202b6847b..3c950baddc 100644 --- a/src/backend/port/dynloader/openbsd.c +++ b/src/backend/port/dynloader/openbsd.c @@ -42,9 +42,6 @@ static char sccsid[] = "@(#)dl.c 5.4 (Berkeley) 2/23/91"; #include #include -#include -#include - #include "dynloader.h" static char error_message[BUFSIZ]; diff --git a/src/backend/port/dynloader/qnx4.c b/src/backend/port/dynloader/qnx4.c index 6e6ca0437a..7df4554e14 100644 --- a/src/backend/port/dynloader/qnx4.c +++ b/src/backend/port/dynloader/qnx4.c @@ -7,19 +7,20 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/port/dynloader/Attic/qnx4.c,v 1.3 2001/02/10 02:31:26 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/port/dynloader/Attic/qnx4.c,v 1.4 2002/11/08 20:23:56 momjian Exp $ * * NOTES * *------------------------------------------------------------------------- */ /* System includes */ + +#include "postgres.h" + /* -#include #include #include */ -#include "postgres.h" #include "utils/dynamic_loader.h" #include "dynloader.h" diff --git a/src/backend/port/dynloader/ultrix4.c b/src/backend/port/dynloader/ultrix4.c index ca637477a8..770f3306a0 100644 --- a/src/backend/port/dynloader/ultrix4.c +++ b/src/backend/port/dynloader/ultrix4.c @@ -1,6 +1,6 @@ /*------------------------------------------------------------------------- * - * dynloader.c + * ultrix4.c * This dynamic loader uses Andrew Yu's libdl-1.0 package for Ultrix 4.x. * * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/port/dynloader/ultrix4.c,v 1.15 2002/06/20 20:29:33 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/port/dynloader/ultrix4.c,v 1.16 2002/11/08 20:23:56 momjian Exp $ * *------------------------------------------------------------------------- */ diff --git a/src/backend/port/qnx4/sem.c b/src/backend/port/qnx4/sem.c index b3b782be8c..da9aa55103 100644 --- a/src/backend/port/qnx4/sem.c +++ b/src/backend/port/qnx4/sem.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/port/qnx4/Attic/sem.c,v 1.10 2002/09/02 02:47:03 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/port/qnx4/Attic/sem.c,v 1.11 2002/11/08 20:23:56 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -16,7 +16,6 @@ #include #include -#include #include #include #include diff --git a/src/backend/port/qnx4/shm.c b/src/backend/port/qnx4/shm.c index cf42be4d85..f3095f5956 100644 --- a/src/backend/port/qnx4/shm.c +++ b/src/backend/port/qnx4/shm.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/port/qnx4/Attic/shm.c,v 1.7 2001/10/25 05:49:40 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/port/qnx4/Attic/shm.c,v 1.8 2002/11/08 20:23:56 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -16,8 +16,6 @@ #include #include -#include -#include #include #include #include diff --git a/src/backend/port/qnx4/tstrint.c b/src/backend/port/qnx4/tstrint.c index 5586edb678..895817fb6f 100644 --- a/src/backend/port/qnx4/tstrint.c +++ b/src/backend/port/qnx4/tstrint.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/port/qnx4/Attic/tstrint.c,v 1.3 2001/08/24 14:07:49 petere Exp $ + * $Header: /cvsroot/pgsql/src/backend/port/qnx4/Attic/tstrint.c,v 1.4 2002/11/08 20:23:56 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -15,8 +15,6 @@ #include "c.h" #include -#include -#include int diff --git a/src/backend/port/qnx4/tstsem.c b/src/backend/port/qnx4/tstsem.c index ebc6abe7d0..3834174a14 100644 --- a/src/backend/port/qnx4/tstsem.c +++ b/src/backend/port/qnx4/tstsem.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/port/qnx4/Attic/tstsem.c,v 1.8 2002/09/04 20:31:24 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/port/qnx4/Attic/tstsem.c,v 1.9 2002/11/08 20:23:56 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -15,8 +15,6 @@ #include "postgres.h" #include -#include -#include #include #include "storage/ipc.h" #include diff --git a/src/backend/port/qnx4/tstshm.c b/src/backend/port/qnx4/tstshm.c index 0fd8226faa..73ac5ce301 100644 --- a/src/backend/port/qnx4/tstshm.c +++ b/src/backend/port/qnx4/tstshm.c @@ -7,15 +7,13 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/port/qnx4/Attic/tstshm.c,v 1.3 2001/08/24 14:07:49 petere Exp $ + * $Header: /cvsroot/pgsql/src/backend/port/qnx4/Attic/tstshm.c,v 1.4 2002/11/08 20:23:56 momjian Exp $ * *------------------------------------------------------------------------- */ #include "postgres.h" -#include -#include #include #include diff --git a/src/backend/regex/regcomp.c b/src/backend/regex/regcomp.c index 71e69dea61..fdc299bf79 100644 --- a/src/backend/regex/regcomp.c +++ b/src/backend/regex/regcomp.c @@ -47,7 +47,6 @@ #include "regex/utils.h" #include "regex/regex2.h" #include "regex/cname.h" -#include struct cclass { diff --git a/src/backend/regex/regexec.c b/src/backend/regex/regexec.c index 59c9ede9f7..41ff00fa69 100644 --- a/src/backend/regex/regexec.c +++ b/src/backend/regex/regexec.c @@ -46,7 +46,6 @@ * macros that code uses. This lets the same code operate on two different * representations for state sets. */ -#include #include #include #include diff --git a/src/backend/utils/adt/formatting.c b/src/backend/utils/adt/formatting.c index 9c2336e8e2..bebccbdfdc 100644 --- a/src/backend/utils/adt/formatting.c +++ b/src/backend/utils/adt/formatting.c @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------- * formatting.c * - * $Header: /cvsroot/pgsql/src/backend/utils/adt/formatting.c,v 1.56 2002/09/20 03:57:09 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/formatting.c,v 1.57 2002/11/08 20:23:56 momjian Exp $ * * * Portions Copyright (c) 1999-2002, PostgreSQL Global Development Group @@ -72,7 +72,6 @@ #include #include #include -#include #include #include diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c index 211ccbf87b..936b9ad99c 100644 --- a/src/backend/utils/adt/selfuncs.c +++ b/src/backend/utils/adt/selfuncs.c @@ -15,7 +15,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.119 2002/10/19 02:56:16 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.120 2002/11/08 20:23:57 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -70,7 +70,6 @@ #include #include -#include #include "access/heapam.h" #include "access/tuptoaster.h" diff --git a/src/backend/utils/init/miscinit.c b/src/backend/utils/init/miscinit.c index f41706862f..d7d7e8008f 100644 --- a/src/backend/utils/init/miscinit.c +++ b/src/backend/utils/init/miscinit.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.96 2002/09/04 20:31:31 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.97 2002/11/08 20:23:57 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -22,7 +22,6 @@ #include #include #include -#include #include #include #include diff --git a/src/backend/utils/misc/database.c b/src/backend/utils/misc/database.c index 3769f350fd..8cf5879922 100644 --- a/src/backend/utils/misc/database.c +++ b/src/backend/utils/misc/database.c @@ -8,15 +8,13 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/misc/Attic/database.c,v 1.53 2002/09/04 20:31:32 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/misc/Attic/database.c,v 1.54 2002/11/08 20:23:57 momjian Exp $ * *------------------------------------------------------------------------- */ #include "postgres.h" #include -#include -#include #include #include "access/xact.h" diff --git a/src/backend/utils/misc/guc-file.l b/src/backend/utils/misc/guc-file.l index 48658a3cb2..6245fde2d3 100644 --- a/src/backend/utils/misc/guc-file.l +++ b/src/backend/utils/misc/guc-file.l @@ -4,15 +4,13 @@ * * Copyright 2000 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/backend/utils/misc/guc-file.l,v 1.13 2002/07/30 16:33:08 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/misc/guc-file.l,v 1.14 2002/11/08 20:23:57 momjian Exp $ */ %{ #include "postgres.h" -#include -#include #include #include #include