From a3d4939c5e6fdc49e5e160ca042795f6acd55fa4 Mon Sep 17 00:00:00 2001 From: tedbullock Date: Mon, 16 Jul 2007 00:59:58 +0000 Subject: [PATCH] Cleaned many (not all) duplicate and hidden implicit #include directives from header and source files. Header files should generally not include other header files --- httperf/src/call.c | 6 ++---- httperf/src/call.h | 5 ----- httperf/src/conn.c | 3 ++- httperf/src/conn.h | 4 ---- httperf/src/core.c | 6 ++++-- httperf/src/core.h | 3 --- httperf/src/gen/call_seq.c | 4 +++- httperf/src/gen/conn_rate.c | 6 ++++-- httperf/src/gen/misc.c | 1 + httperf/src/gen/rate.c | 2 +- httperf/src/gen/sess_cookie.c | 2 ++ httperf/src/gen/session.c | 2 ++ httperf/src/gen/uri_fixed.c | 1 + httperf/src/gen/uri_wlog.c | 3 +++ httperf/src/gen/uri_wset.c | 1 + httperf/src/gen/wsess.c | 3 ++- httperf/src/gen/wsesslog.c | 4 +++- httperf/src/gen/wsesspage.c | 3 ++- httperf/src/http.c | 8 +++++--- httperf/src/http.h | 5 ----- httperf/src/httperf.c | 7 +++++-- httperf/src/localevent.c | 1 + httperf/src/localevent.h | 3 --- httperf/src/object.c | 3 ++- httperf/src/sess.c | 1 + httperf/src/stat/basic.c | 3 +++ httperf/src/stat/print_reply.c | 2 ++ httperf/src/stat/sess_stat.c | 3 +++ httperf/src/timer.c | 9 ++++----- 29 files changed, 59 insertions(+), 45 deletions(-) diff --git a/httperf/src/call.c b/httperf/src/call.c index c26a740..345ad52 100755 --- a/httperf/src/call.c +++ b/httperf/src/call.c @@ -35,13 +35,11 @@ #include "config.h" #include -#include -#include #include -#include +#include #include -#include +#include static u_long next_id = 0; diff --git a/httperf/src/call.h b/httperf/src/call.h index f73757f..b68f858 100755 --- a/httperf/src/call.h +++ b/httperf/src/call.h @@ -34,13 +34,8 @@ #ifndef call_h #define call_h -#include #include -#include -#include -#include - /* Max. # of additional request header lines we allow: */ #define MAX_EXTRA_HEADERS 4 diff --git a/httperf/src/conn.c b/httperf/src/conn.c index a850e27..a80669a 100755 --- a/httperf/src/conn.c +++ b/httperf/src/conn.c @@ -37,9 +37,10 @@ #include #include #include -#include #include +#include +#include #include #include diff --git a/httperf/src/conn.h b/httperf/src/conn.h index ff1f60b..b14f9e3 100755 --- a/httperf/src/conn.h +++ b/httperf/src/conn.h @@ -38,10 +38,6 @@ #include -#include -#include -#include - #ifdef HAVE_SSL # include # include diff --git a/httperf/src/core.c b/httperf/src/core.c index 8defc9b..03f9cc0 100755 --- a/httperf/src/core.c +++ b/httperf/src/core.c @@ -42,7 +42,6 @@ #include #include #include -#include #include #include @@ -59,12 +58,15 @@ #include #include +#include +#include #include #include +#include #include #include #include -#include + /*if we don't have GNU compatible realloc, fake it*/ #if HAVE_REALLOC == 0 diff --git a/httperf/src/core.h b/httperf/src/core.h index 2cf2618..da2ecf6 100755 --- a/httperf/src/core.h +++ b/httperf/src/core.h @@ -36,9 +36,6 @@ #include -#include -#include - extern void core_init (void); extern struct sockaddr_in *core_intern_addr (const char *hostname, size_t hostname_len, int port); diff --git a/httperf/src/gen/call_seq.c b/httperf/src/gen/call_seq.c index 27dc995..7c0deac 100755 --- a/httperf/src/gen/call_seq.c +++ b/httperf/src/gen/call_seq.c @@ -39,11 +39,13 @@ #include #include +#include +#include #include #include +#include #include #include -#include #define CONN_PRIVATE_DATA(c) \ ((Conn_Private_Data *) ((char *)(c) + conn_private_data_offset)) diff --git a/httperf/src/gen/conn_rate.c b/httperf/src/gen/conn_rate.c index 6f6d9b7..eb2c9eb 100755 --- a/httperf/src/gen/conn_rate.c +++ b/httperf/src/gen/conn_rate.c @@ -41,12 +41,14 @@ #include #include +#include +#include #include -#include #include #include #include -#include +#include +#include static int num_conns_generated; static int num_conns_destroyed; diff --git a/httperf/src/gen/misc.c b/httperf/src/gen/misc.c index f040af5..eb2f5be 100755 --- a/httperf/src/gen/misc.c +++ b/httperf/src/gen/misc.c @@ -51,6 +51,7 @@ #include #include +#include #include #include #include diff --git a/httperf/src/gen/rate.c b/httperf/src/gen/rate.c index 9b3d54b..51973f2 100755 --- a/httperf/src/gen/rate.c +++ b/httperf/src/gen/rate.c @@ -39,9 +39,9 @@ #include #include +#include #include #include -#include #include #include diff --git a/httperf/src/gen/sess_cookie.c b/httperf/src/gen/sess_cookie.c index 9c947b2..d69917b 100755 --- a/httperf/src/gen/sess_cookie.c +++ b/httperf/src/gen/sess_cookie.c @@ -50,6 +50,8 @@ #include #include +#include +#include #include #include #include diff --git a/httperf/src/gen/session.c b/httperf/src/gen/session.c index e3ef87a..e89df42 100755 --- a/httperf/src/gen/session.c +++ b/httperf/src/gen/session.c @@ -68,6 +68,8 @@ #include #include +#include +#include #include #include #include diff --git a/httperf/src/gen/uri_fixed.c b/httperf/src/gen/uri_fixed.c index 3f8206f..b4d6ffb 100755 --- a/httperf/src/gen/uri_fixed.c +++ b/httperf/src/gen/uri_fixed.c @@ -42,6 +42,7 @@ #include #include +#include #include #include #include diff --git a/httperf/src/gen/uri_wlog.c b/httperf/src/gen/uri_wlog.c index ca97345..ab03ae5 100755 --- a/httperf/src/gen/uri_wlog.c +++ b/httperf/src/gen/uri_wlog.c @@ -78,8 +78,11 @@ #include #include +#include +#include #include #include +#include #include #include diff --git a/httperf/src/gen/uri_wset.c b/httperf/src/gen/uri_wset.c index 2a9af52..b77fe32 100755 --- a/httperf/src/gen/uri_wset.c +++ b/httperf/src/gen/uri_wset.c @@ -43,6 +43,7 @@ #include #include +#include #include #include #include diff --git a/httperf/src/gen/wsess.c b/httperf/src/gen/wsess.c index a0fe8df..c1d2ed7 100755 --- a/httperf/src/gen/wsess.c +++ b/httperf/src/gen/wsess.c @@ -44,6 +44,8 @@ #include #include +#include +#include #include #include #include @@ -51,7 +53,6 @@ #include #include #include -#include #define SESS_PRIVATE_DATA(c) \ ((Sess_Private_Data *) ((char *)(c) + sess_private_data_offset)) diff --git a/httperf/src/gen/wsesslog.c b/httperf/src/gen/wsesslog.c index 94a6e9d..760b8ff 100755 --- a/httperf/src/gen/wsesslog.c +++ b/httperf/src/gen/wsesslog.c @@ -83,13 +83,15 @@ #include #include +#include +#include #include #include +#include #include #include #include #include -#include /* Maximum number of sessions that can be defined in the configuration file. */ diff --git a/httperf/src/gen/wsesspage.c b/httperf/src/gen/wsesspage.c index c63047b..d9ad3be 100755 --- a/httperf/src/gen/wsesspage.c +++ b/httperf/src/gen/wsesspage.c @@ -49,6 +49,8 @@ #include #include +#include +#include #include #include #include @@ -56,7 +58,6 @@ #include #include #include -#include #define CALL_PRIVATE_DATA(c) \ ((Call_Private_Data *) ((char *)(c) + call_private_data_offset)) diff --git a/httperf/src/http.c b/httperf/src/http.c index 4dba674..b11700f 100755 --- a/httperf/src/http.c +++ b/httperf/src/http.c @@ -42,11 +42,13 @@ #include #include +#include +#include +#include +#include +#include #include #include -#include -#include -#include /* Read a CRLF terminated line of characters into c->reply.line. Returns 1 when the line is complete, 0 when the line is incomplete diff --git a/httperf/src/http.h b/httperf/src/http.h index 74a7567..ed9614c 100755 --- a/httperf/src/http.h +++ b/httperf/src/http.h @@ -35,11 +35,6 @@ #ifndef http_h #define http_h -#include - -#include -#include - extern void http_process_reply_bytes (Call *c, char **buf, size_t *buf_len); #endif /* http_h */ diff --git a/httperf/src/httperf.c b/httperf/src/httperf.c index c545ef8..8e16d35 100755 --- a/httperf/src/httperf.c +++ b/httperf/src/httperf.c @@ -73,11 +73,14 @@ #include #include +#include +#include +#include +#include #include #include #include -#include -#include + #ifdef HAVE_SSL # include diff --git a/httperf/src/localevent.c b/httperf/src/localevent.c index d8d5868..6732c21 100755 --- a/httperf/src/localevent.c +++ b/httperf/src/localevent.c @@ -38,6 +38,7 @@ #include #include +#include #include #include diff --git a/httperf/src/localevent.h b/httperf/src/localevent.h index 73a6537..f594d0a 100755 --- a/httperf/src/localevent.h +++ b/httperf/src/localevent.h @@ -35,9 +35,6 @@ #ifndef localevent_h #define localevent_h -#include -#include - typedef enum Event_Type { EV_PERF_SAMPLE, diff --git a/httperf/src/object.c b/httperf/src/object.c index d1d7258..0111be8 100755 --- a/httperf/src/object.c +++ b/httperf/src/object.c @@ -41,11 +41,12 @@ #include #include +#include +#include #include #include #include #include -#include #include #define ALIGN(s) (((s) + sizeof (double) - 1) & ~(sizeof (double) - 1)) diff --git a/httperf/src/sess.c b/httperf/src/sess.c index fb75e86..f414c82 100755 --- a/httperf/src/sess.c +++ b/httperf/src/sess.c @@ -35,6 +35,7 @@ #include "config.h" #include +#include #include #include #include diff --git a/httperf/src/stat/basic.c b/httperf/src/stat/basic.c index ee5390f..31fd918 100755 --- a/httperf/src/stat/basic.c +++ b/httperf/src/stat/basic.c @@ -43,8 +43,11 @@ #include #include +#include +#include #include #include +#include #include #include diff --git a/httperf/src/stat/print_reply.c b/httperf/src/stat/print_reply.c index 3151abf..367cbab 100755 --- a/httperf/src/stat/print_reply.c +++ b/httperf/src/stat/print_reply.c @@ -43,6 +43,8 @@ #include #include +#include +#include #include #include #include diff --git a/httperf/src/stat/sess_stat.c b/httperf/src/stat/sess_stat.c index 246764d..50cd4ae 100755 --- a/httperf/src/stat/sess_stat.c +++ b/httperf/src/stat/sess_stat.c @@ -43,8 +43,11 @@ #include #include +#include +#include #include #include +#include #include #include #include diff --git a/httperf/src/timer.c b/httperf/src/timer.c index 7031952..fb1b879 100755 --- a/httperf/src/timer.c +++ b/httperf/src/timer.c @@ -36,9 +36,6 @@ #include #include #include -#include - -#include #include #include @@ -51,11 +48,13 @@ static Time next_tick; static Timer *timer_free_list = 0; static Timer *t_curr = 0; -static struct Timer_List { +typedef struct Timer_List { struct Timer_List *next; struct Timer *this_timer; -} *timer_list_head = NULL; +} Timer_List; + +static Timer_List *timer_list_head = NULL; /* * What a wheel is made of, no?