[master] 0e63559 First sweep to remove needless #includes.
Poul-Henning Kamp
phk at varnish-cache.org
Sat Oct 8 12:46:28 CEST 2011
commit 0e63559a6cf53997d4dfa3ec601c472eb6889a23
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Sat Oct 8 10:45:26 2011 +0000
First sweep to remove needless #includes.
This is based on output from some scripts and basic sanity testing.
diff --git a/bin/varnishd/cache_acceptor.c b/bin/varnishd/cache_acceptor.c
index e2be560..c02e170 100644
--- a/bin/varnishd/cache_acceptor.c
+++ b/bin/varnishd/cache_acceptor.c
@@ -31,12 +31,6 @@
#include "config.h"
#include <errno.h>
-#include <poll.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-#include <sys/types.h>
-#include <sys/socket.h>
#include "vcli.h"
#include "cli_priv.h"
diff --git a/bin/varnishd/cache_backend_cfg.c b/bin/varnishd/cache_backend_cfg.c
index 0582f72..e08e09e 100644
--- a/bin/varnishd/cache_backend_cfg.c
+++ b/bin/varnishd/cache_backend_cfg.c
@@ -34,11 +34,6 @@
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <poll.h>
-
-#include <sys/socket.h>
#include "cache.h"
#include "vrt.h"
diff --git a/bin/varnishd/cache_backend_poll.c b/bin/varnishd/cache_backend_poll.c
index 0854dfd..5fae557 100644
--- a/bin/varnishd/cache_backend_poll.c
+++ b/bin/varnishd/cache_backend_poll.c
@@ -40,12 +40,8 @@
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
#include <poll.h>
-#include <sys/socket.h>
-
#include "cli_priv.h"
#include "cache.h"
#include "vrt.h"
diff --git a/bin/varnishd/cache_cli.c b/bin/varnishd/cache_cli.c
index 79ac6f6..bfc1cbc 100644
--- a/bin/varnishd/cache_cli.c
+++ b/bin/varnishd/cache_cli.c
@@ -37,19 +37,14 @@
#include "config.h"
#include <stdio.h>
-#include <errno.h>
-#include <stddef.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <poll.h>
+#include <stddef.h> // offsetof
#include "vcli.h"
#include "cli_priv.h"
#include "cli_common.h"
#include "cli_serve.h"
#include "cache.h"
-#include "hash_slinger.h"
+#include "hash_slinger.h" // objhead
pthread_t cli_thread;
static struct lock cli_mtx;
diff --git a/bin/varnishd/cache_dir_random.c b/bin/varnishd/cache_dir_random.c
index c2b74dd..f05d8f4 100644
--- a/bin/varnishd/cache_dir_random.c
+++ b/bin/varnishd/cache_dir_random.c
@@ -46,15 +46,8 @@
#include "config.h"
-#include <sys/types.h>
-#include <sys/socket.h>
-
-#include <stdio.h>
-#include <errno.h>
#include <math.h>
#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
#include "cache.h"
#include "cache_backend.h"
diff --git a/bin/varnishd/cache_dir_round_robin.c b/bin/varnishd/cache_dir_round_robin.c
index 8e47198..9d0a257 100644
--- a/bin/varnishd/cache_dir_round_robin.c
+++ b/bin/varnishd/cache_dir_round_robin.c
@@ -29,13 +29,7 @@
#include "config.h"
-#include <sys/types.h>
-#include <sys/socket.h>
-
-#include <errno.h>
#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
#include "cache.h"
#include "cache_backend.h"
diff --git a/bin/varnishd/cache_esi_deliver.c b/bin/varnishd/cache_esi_deliver.c
index 5bfa654..063464a 100644
--- a/bin/varnishd/cache_esi_deliver.c
+++ b/bin/varnishd/cache_esi_deliver.c
@@ -36,9 +36,7 @@
#include "cache.h"
#include "cache_esi.h"
#include "vend.h"
-#include "vct.h"
#include "vgz.h"
-#include "stevedore.h"
/*--------------------------------------------------------------------*/
diff --git a/bin/varnishd/cache_esi_fetch.c b/bin/varnishd/cache_esi_fetch.c
index c8df1b1..cac2eb6 100644
--- a/bin/varnishd/cache_esi_fetch.c
+++ b/bin/varnishd/cache_esi_fetch.c
@@ -30,7 +30,6 @@
#include "config.h"
-#include <stdio.h>
#include <stdlib.h>
#include "cache.h"
diff --git a/bin/varnishd/cache_esi_parse.c b/bin/varnishd/cache_esi_parse.c
index afef1fb..c659dd5 100644
--- a/bin/varnishd/cache_esi_parse.c
+++ b/bin/varnishd/cache_esi_parse.c
@@ -38,7 +38,6 @@
#include "vend.h"
#include "vct.h"
#include "vgz.h"
-#include "stevedore.h"
//#define Debug(fmt, ...) printf(fmt, __VA_ARGS__)
#define Debug(fmt, ...) /**/
diff --git a/bin/varnishd/cache_expire.c b/bin/varnishd/cache_expire.c
index a07ab6d..35d0a1e 100644
--- a/bin/varnishd/cache_expire.c
+++ b/bin/varnishd/cache_expire.c
@@ -51,10 +51,6 @@
#include "config.h"
-#include <unistd.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
#include <math.h>
#include "binary_heap.h"
diff --git a/bin/varnishd/cache_gzip.c b/bin/varnishd/cache_gzip.c
index b32b5cf..28d61d9 100644
--- a/bin/varnishd/cache_gzip.c
+++ b/bin/varnishd/cache_gzip.c
@@ -68,9 +68,7 @@
#include <stdio.h>
#include <stdlib.h>
-#include "vsl.h"
#include "cache.h"
-#include "stevedore.h"
#include "vgz.h"
diff --git a/bin/varnishd/cache_hash.c b/bin/varnishd/cache_hash.c
index 58c3b6a..7e45b8a 100644
--- a/bin/varnishd/cache_hash.c
+++ b/bin/varnishd/cache_hash.c
@@ -56,9 +56,6 @@
#include <stdlib.h>
#include <math.h>
#include <string.h>
-#include <limits.h>
-#include <sys/types.h>
-#include <fcntl.h>
#include "cache.h"
#include "stevedore.h"
diff --git a/bin/varnishd/cache_http.c b/bin/varnishd/cache_http.c
index c8a5415..25a6627 100644
--- a/bin/varnishd/cache_http.c
+++ b/bin/varnishd/cache_http.c
@@ -31,7 +31,6 @@
#include "config.h"
-#include <errno.h>
#include <unistd.h>
#include <stdarg.h>
#include <stdio.h>
diff --git a/bin/varnishd/cache_pipe.c b/bin/varnishd/cache_pipe.c
index ea5189d..e02da80 100644
--- a/bin/varnishd/cache_pipe.c
+++ b/bin/varnishd/cache_pipe.c
@@ -32,11 +32,7 @@
#include "config.h"
#include <stdio.h>
-#include <unistd.h>
-#include <string.h>
#include <poll.h>
-#include <stdlib.h>
-#include <sys/socket.h>
#include "cache.h"
diff --git a/bin/varnishd/cache_pool.c b/bin/varnishd/cache_pool.c
index 6be7613..1aaa2ac 100644
--- a/bin/varnishd/cache_pool.c
+++ b/bin/varnishd/cache_pool.c
@@ -49,11 +49,7 @@
#include <math.h>
#include <stdlib.h>
#include <string.h>
-#include <time.h>
-#include <unistd.h>
-#include "vcl.h"
-#include "cli_priv.h"
#include "cache.h"
#include "cache_waiter.h"
#include "stevedore.h"
diff --git a/bin/varnishd/cache_session.c b/bin/varnishd/cache_session.c
index 4956154..1f500ba 100644
--- a/bin/varnishd/cache_session.c
+++ b/bin/varnishd/cache_session.c
@@ -36,10 +36,7 @@
#include "config.h"
#include <stdlib.h>
-#include <string.h>
#include <math.h>
-#include <sys/uio.h>
-#include <sys/socket.h>
#include "cache.h"
#include "cache_waiter.h"
diff --git a/bin/varnishd/cache_vrt_re.c b/bin/varnishd/cache_vrt_re.c
index b2afaa5..ef2376f 100644
--- a/bin/varnishd/cache_vrt_re.c
+++ b/bin/varnishd/cache_vrt_re.c
@@ -31,10 +31,6 @@
#include "config.h"
-#include <sys/types.h>
-
-#include <stdio.h>
-#include <string.h>
#include <ctype.h>
#include <stdlib.h>
diff --git a/bin/varnishd/cache_wrk.c b/bin/varnishd/cache_wrk.c
index 0c3b18e..ba2e41a 100644
--- a/bin/varnishd/cache_wrk.c
+++ b/bin/varnishd/cache_wrk.c
@@ -31,17 +31,11 @@
#include "config.h"
-#include <sys/types.h>
-
-#include <errno.h>
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
#include "vcl.h"
-#include "cli_priv.h"
#include "cache.h"
#include "hash_slinger.h"
#include "vsha256.h"
diff --git a/bin/varnishd/cache_ws.c b/bin/varnishd/cache_ws.c
index a803797..9fca215 100644
--- a/bin/varnishd/cache_ws.c
+++ b/bin/varnishd/cache_ws.c
@@ -30,17 +30,6 @@
#include "config.h"
-#include <sys/types.h>
-#include <sys/uio.h>
-
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "vcl.h"
-#include "cli_priv.h"
#include "cache.h"
void
diff --git a/bin/varnishd/hash_critbit.c b/bin/varnishd/hash_critbit.c
index 0a1ccca..7428097 100644
--- a/bin/varnishd/hash_critbit.c
+++ b/bin/varnishd/hash_critbit.c
@@ -32,7 +32,6 @@
#include "config.h"
-#include <stdio.h>
#include <stdlib.h>
#include "cache.h"
diff --git a/bin/varnishd/hash_simple_list.c b/bin/varnishd/hash_simple_list.c
index 5cb1fc1..13cf0ee 100644
--- a/bin/varnishd/hash_simple_list.c
+++ b/bin/varnishd/hash_simple_list.c
@@ -31,10 +31,6 @@
#include "config.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
#include "cache.h"
#include "hash_slinger.h"
diff --git a/bin/varnishd/mgt_cli.c b/bin/varnishd/mgt_cli.c
index 45f08af..eccf268 100644
--- a/bin/varnishd/mgt_cli.c
+++ b/bin/varnishd/mgt_cli.c
@@ -31,8 +31,6 @@
#include "config.h"
-#include <sys/types.h>
-
#include <stdarg.h>
#include <stdio.h>
#include <fcntl.h>
@@ -51,7 +49,6 @@
#include "cli_common.h"
#include "cli_serve.h"
#include "vev.h"
-#include "vsc.h"
#include "vlu.h"
#include "vss.h"
diff --git a/bin/varnishd/rfc2616.c b/bin/varnishd/rfc2616.c
index 84e95f4..51d4c74 100644
--- a/bin/varnishd/rfc2616.c
+++ b/bin/varnishd/rfc2616.c
@@ -29,8 +29,6 @@
#include "config.h"
-#include <sys/types.h>
-
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
diff --git a/bin/varnishd/stevedore.c b/bin/varnishd/stevedore.c
index 624d2b1..c1e52cb 100644
--- a/bin/varnishd/stevedore.c
+++ b/bin/varnishd/stevedore.c
@@ -35,11 +35,9 @@
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include "cache.h"
#include "stevedore.h"
-#include "hash_slinger.h"
#include "cli_priv.h"
#include "vrt_obj.h"
diff --git a/bin/varnishd/stevedore_utils.c b/bin/varnishd/stevedore_utils.c
index bd4e368..1dcfd63 100644
--- a/bin/varnishd/stevedore_utils.c
+++ b/bin/varnishd/stevedore_utils.c
@@ -37,7 +37,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <sys/param.h>
+#include <sys/types.h>
#include <sys/stat.h>
#ifdef HAVE_SYS_MOUNT_H
diff --git a/bin/varnishd/storage_file.c b/bin/varnishd/storage_file.c
index 30203f8..7388878 100644
--- a/bin/varnishd/storage_file.c
+++ b/bin/varnishd/storage_file.c
@@ -35,9 +35,6 @@
#include <sys/mman.h>
#include <sys/stat.h>
-#include <errno.h>
-#include <limits.h>
-#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/bin/varnishd/storage_persistent.c b/bin/varnishd/storage_persistent.c
index a4ba598..3ba7061 100644
--- a/bin/varnishd/storage_persistent.c
+++ b/bin/varnishd/storage_persistent.c
@@ -35,8 +35,6 @@
#include "config.h"
-#include <errno.h>
-#include <math.h>
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
diff --git a/bin/varnishd/storage_persistent_silo.c b/bin/varnishd/storage_persistent_silo.c
index a1eb98b..ba84b79 100644
--- a/bin/varnishd/storage_persistent_silo.c
+++ b/bin/varnishd/storage_persistent_silo.c
@@ -34,11 +34,8 @@
#include "config.h"
-#include <math.h>
#include <stdio.h>
-#include <stdint.h>
#include <stdlib.h>
-#include <sys/mman.h>
#include "cache.h"
#include "stevedore.h"
diff --git a/bin/varnishd/varnishd.c b/bin/varnishd/varnishd.c
index 2962e74..8b35970 100644
--- a/bin/varnishd/varnishd.c
+++ b/bin/varnishd/varnishd.c
@@ -36,9 +36,6 @@
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
-#include <poll.h>
-#include <signal.h>
-#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -64,11 +61,6 @@
#include "hash_slinger.h"
#include "stevedore.h"
-/* INFTIM indicates an infinite timeout for poll(2) */
-#ifndef INFTIM
-#define INFTIM -1
-#endif
-
struct heritage heritage;
volatile struct params *params;
unsigned d_flag = 0;
More information about the varnish-commit
mailing list