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
This commit is contained in:
Bruce Momjian 2002-11-08 20:23:57 +00:00
parent a5715eecb6
commit bea4792125
24 changed files with 18 additions and 54 deletions

View File

@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * 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 <sys/stat.h> #include <sys/stat.h>
#include <sys/time.h> #include <sys/time.h>
#include <dirent.h> #include <dirent.h>
#include <locale.h>
#include "access/clog.h" #include "access/clog.h"
#include "access/transam.h" #include "access/transam.h"

View File

@ -13,7 +13,7 @@
* *
* *
* IDENTIFICATION * 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 <errno.h> #include <errno.h>
#include <pwd.h> #include <pwd.h>
#include <unistd.h> #include <unistd.h>
#include <locale.h>
#if defined(__alpha) && defined(__osf__) #if defined(__alpha) && defined(__osf__)
#include <sys/sysinfo.h> #include <sys/sysinfo.h>

View File

@ -10,7 +10,6 @@
#include "postgres.h" #include "postgres.h"
#include <stdio.h>
#include <errno.h> #include <errno.h>
#include <unistd.h> #include <unistd.h>
#include <OS.h> #include <OS.h>

View File

@ -9,7 +9,6 @@
*/ */
#include "postgres.h" #include "postgres.h"
#include <stdio.h>
#include <OS.h> #include <OS.h>
#include <errno.h> #include <errno.h>

View File

@ -37,11 +37,8 @@
static char sccsid[] = "@(#)system.c 8.1 (Berkeley) 6/4/93"; static char sccsid[] = "@(#)system.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
#include <sys/wait.h> #include <sys/wait.h>
#include <signal.h> #include <signal.h>
#include <stdlib.h>
#include <stddef.h>
#include <unistd.h> #include <unistd.h>
#include <paths.h> #include <paths.h>
#include <errno.h> #include <errno.h>

View File

@ -6,7 +6,6 @@
#include "postgres.h" #include "postgres.h"
#include <stdio.h>
#include <errno.h> #include <errno.h>
#include "sys/ldr.h" #include "sys/ldr.h"
#include <a.out.h> #include <a.out.h>

View File

@ -43,9 +43,6 @@ static char sccsid[] = "@(#)dl.c 5.4 (Berkeley) 2/23/91";
#include <link.h> #include <link.h>
#include <dlfcn.h> #include <dlfcn.h>
#include <stdio.h>
#include <stdlib.h>
static char error_message[BUFSIZ]; static char error_message[BUFSIZ];
char * char *

View File

@ -42,9 +42,6 @@ static char sccsid[] = "@(#)dl.c 5.4 (Berkeley) 2/23/91";
#include <link.h> #include <link.h>
#include <dlfcn.h> #include <dlfcn.h>
#include <stdio.h>
#include <stdlib.h>
#include "dynloader.h" #include "dynloader.h"
static char error_message[BUFSIZ]; static char error_message[BUFSIZ];

View File

@ -3,8 +3,6 @@
#include "mach-o/rld.h" #include "mach-o/rld.h"
#include "streams/streams.h" #include "streams/streams.h"
#include <stdlib.h>
static char *lastError = NULL; static char *lastError = NULL;
static NXStream * static NXStream *

View File

@ -42,9 +42,6 @@ static char sccsid[] = "@(#)dl.c 5.4 (Berkeley) 2/23/91";
#include <link.h> #include <link.h>
#include <dlfcn.h> #include <dlfcn.h>
#include <stdio.h>
#include <stdlib.h>
#include "dynloader.h" #include "dynloader.h"
static char error_message[BUFSIZ]; static char error_message[BUFSIZ];

View File

@ -7,19 +7,20 @@
* *
* *
* IDENTIFICATION * 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 * NOTES
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
/* System includes */ /* System includes */
#include "postgres.h"
/* /*
#include <stdio.h>
#include <a.out.h> #include <a.out.h>
#include <dl.h> #include <dl.h>
*/ */
#include "postgres.h"
#include "utils/dynamic_loader.h" #include "utils/dynamic_loader.h"
#include "dynloader.h" #include "dynloader.h"

View File

@ -1,6 +1,6 @@
/*------------------------------------------------------------------------- /*-------------------------------------------------------------------------
* *
* dynloader.c * ultrix4.c
* This dynamic loader uses Andrew Yu's libdl-1.0 package for Ultrix 4.x. * This dynamic loader uses Andrew Yu's libdl-1.0 package for Ultrix 4.x.
* *
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * 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 $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 <errno.h> #include <errno.h>
#include <semaphore.h> #include <semaphore.h>
#include <string.h>
#include <unistd.h> #include <unistd.h>
#include <fcntl.h> #include <fcntl.h>
#include <sys/mman.h> #include <sys/mman.h>

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 <errno.h> #include <errno.h>
#include <fcntl.h> #include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h> #include <unistd.h>
#include <sys/mman.h> #include <sys/mman.h>
#include <sys/shm.h> #include <sys/shm.h>

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 "c.h"
#include <errno.h> #include <errno.h>
#include <stdio.h>
#include <stdlib.h>
int int

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 "postgres.h"
#include <signal.h> #include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include "storage/ipc.h" #include "storage/ipc.h"
#include <sys/mman.h> #include <sys/mman.h>

View File

@ -7,15 +7,13 @@
* *
* *
* IDENTIFICATION * 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 "postgres.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include <sys/shm.h> #include <sys/shm.h>

View File

@ -47,7 +47,6 @@
#include "regex/utils.h" #include "regex/utils.h"
#include "regex/regex2.h" #include "regex/regex2.h"
#include "regex/cname.h" #include "regex/cname.h"
#include <locale.h>
struct cclass struct cclass
{ {

View File

@ -46,7 +46,6 @@
* macros that code uses. This lets the same code operate on two different * macros that code uses. This lets the same code operate on two different
* representations for state sets. * representations for state sets.
*/ */
#include <sys/types.h>
#include <limits.h> #include <limits.h>
#include <ctype.h> #include <ctype.h>
#include <assert.h> #include <assert.h>

View File

@ -1,7 +1,7 @@
/* ----------------------------------------------------------------------- /* -----------------------------------------------------------------------
* formatting.c * 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 * Portions Copyright (c) 1999-2002, PostgreSQL Global Development Group
@ -72,7 +72,6 @@
#include <ctype.h> #include <ctype.h>
#include <sys/time.h> #include <sys/time.h>
#include <unistd.h> #include <unistd.h>
#include <locale.h>
#include <math.h> #include <math.h>
#include <float.h> #include <float.h>

View File

@ -15,7 +15,7 @@
* *
* *
* IDENTIFICATION * 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 <ctype.h> #include <ctype.h>
#include <math.h> #include <math.h>
#include <locale.h>
#include "access/heapam.h" #include "access/heapam.h"
#include "access/tuptoaster.h" #include "access/tuptoaster.h"

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * 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 <unistd.h> #include <unistd.h>
#include <grp.h> #include <grp.h>
#include <pwd.h> #include <pwd.h>
#include <stdlib.h>
#include <errno.h> #include <errno.h>
#include <netinet/in.h> #include <netinet/in.h>
#include <arpa/inet.h> #include <arpa/inet.h>

View File

@ -8,15 +8,13 @@
* *
* *
* IDENTIFICATION * 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 "postgres.h"
#include <fcntl.h> #include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h> #include <unistd.h>
#include "access/xact.h" #include "access/xact.h"

View File

@ -4,15 +4,13 @@
* *
* Copyright 2000 by PostgreSQL Global Development Group * 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 "postgres.h"
#include <string.h>
#include <stdarg.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <unistd.h> #include <unistd.h>
#include <errno.h> #include <errno.h>