Run include-what-you-use.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 13 Apr 2013 20:13:56 +0000 (22:13 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 13 Apr 2013 20:13:56 +0000 (22:13 +0200)
21 files changed:
acceptor.cpp
client.cpp
client.h
config.cpp
config.h
httpinput.cpp
httpinput.h
input.cpp
main.cpp
parse.cpp
parse.h
server.cpp
server.h
serverpool.cpp
serverpool.h
stats.cpp
stream.cpp
stream.h
udpinput.cpp
udpinput.h
util.cpp

index 6f7ffa240a140584afd3ea620bae7c52cbc09893..ecebf7e5b65d74359e6ce6cf857c55fa4920c19b 100644 (file)
@@ -1,13 +1,13 @@
+#include <assert.h>
+#include <errno.h>
+#include <netinet/in.h>
+#include <poll.h>
 #include <stdio.h>
-#include <unistd.h>
-#include <string.h>
 #include <stdlib.h>
-#include <signal.h>
-#include <errno.h>
-#include <arpa/inet.h>
+#include <string.h>
 #include <sys/ioctl.h>
-#include <sys/poll.h>
 #include <sys/socket.h>
+#include <unistd.h>
 
 #include "acceptor.h"
 #include "serverpool.h"
index be47e0e23b2c52a52e4a130528be3451aa9b250b..c74209d8e0f4b22ef9fef07572397a4800dceec7 100644 (file)
@@ -1,13 +1,12 @@
+#include <arpa/inet.h>
+#include <netinet/in.h>
 #include <stdio.h>
-#include <unistd.h>
 #include <sys/socket.h>
-#include <arpa/inet.h>
-#include <errno.h>
 
 #include "client.h"
 #include "markpool.h"
-#include "stream.h"
 #include "state.pb.h"
+#include "stream.h"
 
 using namespace std;
 
index ff07a7b2ebe629efe5951ad9f9b408bad5b669be..e82b48758d677740132498f2ca1049151fd34250 100644 (file)
--- a/client.h
+++ b/client.h
@@ -3,6 +3,7 @@
 
 // A Client represents a single connection from a client (watching a single stream).
 
+#include <stddef.h>
 #include <time.h>
 #include <string>
 
index 32e0e654164142d6dcd6f8dffc419fffc35483dc..bcd86a9c2cb0101aeea3f4cc1141c6d902b8e5d4 100644 (file)
@@ -1,12 +1,12 @@
+#include <assert.h>
+#include <ctype.h>
 #include <stdio.h>
-#include <string.h>
 #include <stdlib.h>
-#include <limits.h>
-#include <ctype.h>
-#include <assert.h>
+#include <string.h>
 #include <map>
-#include <vector>
 #include <string>
+#include <utility>
+#include <vector>
 
 #include "config.h"
 #include "parse.h"
index e7385e2f488904a488adf00d079d67509022df9e..34edaa7c878a2f340733b78aab1e8fd01b7fa9e5 100644 (file)
--- a/config.h
+++ b/config.h
@@ -3,8 +3,9 @@
 
 // Various routines that deal with parsing the configuration file.
 
-#include <vector>
+#include <stddef.h>
 #include <string>
+#include <vector>
 
 struct MarkPoolConfig {
        int from, to;
index 291b17f089578fe54b2a4ac33be06bfafc1742f4..875ee62a29d45ca31858dc0fd142ed197f404d55 100644 (file)
@@ -1,31 +1,26 @@
+#include <assert.h>
+#include <errno.h>
+#include <netdb.h>
+#include <netinet/in.h>
+#include <poll.h>
+#include <stdint.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
-#include <stdint.h>
-#include <unistd.h>
-#include <assert.h>
-#include <arpa/inet.h>
-#include <sys/socket.h>
-#include <pthread.h>
-#include <sys/types.h>
 #include <sys/ioctl.h>
-#include <sys/types.h>
 #include <sys/socket.h>
-#include <netdb.h>
-#include <poll.h>
-#include <signal.h>
-#include <errno.h>
-#include <vector>
-#include <string>
+#include <unistd.h>
 #include <map>
+#include <string>
+#include <utility>
+#include <vector>
 
-#include "metacube.h"
-#include "mutexlock.h"
 #include "httpinput.h"
-#include "server.h"
-#include "serverpool.h"
+#include "metacube.h"
 #include "parse.h"
-#include "version.h"
+#include "serverpool.h"
 #include "state.pb.h"
+#include "version.h"
 
 using namespace std;
 
index 1714b71a8984ddf7a723dccae4ef2b133de6a1b5..f14b0992ce812778d603c3b36c0accc3921b508e 100644 (file)
@@ -1,8 +1,9 @@
 #ifndef _HTTPINPUT_H
 #define _HTTPINPUT_H 1
 
-#include <vector>
+#include <stddef.h>
 #include <string>
+#include <vector>
 
 #include "input.h"
 
index 3f6a9d73ee42095b7462ba32a93088c5a60aadfb..d7c2b774d79fd66cbcb8a41d923c12af33c49029 100644 (file)
--- a/input.cpp
+++ b/input.cpp
@@ -1,10 +1,11 @@
+#include <stddef.h>
 #include <string.h>
 #include <string>
 
 #include "httpinput.h"
-#include "udpinput.h"
 #include "input.h"
 #include "state.pb.h"
+#include "udpinput.h"
 
 using namespace std;
 
index 1369c9faeb8f42394e1afe4b0878f4831592f3a7..8ac7802bb30454f690822e1d7761ed06b8080bf9 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -1,39 +1,30 @@
-#include <stdio.h>
-#include <string.h>
-#include <stdint.h>
-#include <unistd.h>
 #include <assert.h>
+#include <errno.h>
 #include <getopt.h>
-#include <arpa/inet.h>
-#include <sys/socket.h>
-#include <pthread.h>
-#include <sys/types.h>
-#include <sys/ioctl.h>
-#include <sys/poll.h>
+#include <google/protobuf/stubs/common.h>
+#include <signal.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 #include <sys/time.h>
-#include <sys/types.h>
 #include <sys/wait.h>
-#include <signal.h>
-#include <errno.h>
-#include <ctype.h>
-#include <fcntl.h>
-#include <vector>
-#include <string>
+#include <unistd.h>
 #include <map>
 #include <set>
+#include <string>
+#include <utility>
+#include <vector>
 
 #include "acceptor.h"
 #include "config.h"
+#include "input.h"
 #include "markpool.h"
-#include "metacube.h"
-#include "parse.h"
-#include "server.h"
 #include "serverpool.h"
-#include "input.h"
+#include "state.pb.h"
 #include "stats.h"
 #include "util.h"
 #include "version.h"
-#include "state.pb.h"
 
 using namespace std;
 
index eed7d19572a8af588bb4230c4a1b0bee01c6ffa9..f77af4a736a6c6d502a01ea09c3f6d8bde1fb8c2 100644 (file)
--- a/parse.cpp
+++ b/parse.cpp
@@ -1,10 +1,8 @@
+#include <ctype.h>
 #include <stdio.h>
 #include <string.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <assert.h>
-#include <vector>
 #include <string>
+#include <vector>
 
 #include "parse.h"
 
diff --git a/parse.h b/parse.h
index 6912dd9a5c314ca41494aed2a6be41ba5094ab44..de260640f56ebc4a0cbe0f6b06a39ead8d6bcbc0 100644 (file)
--- a/parse.h
+++ b/parse.h
@@ -3,8 +3,9 @@
 
 // Various routines that deal with parsing; both HTTP requests and more generic text.
 
-#include <vector>
+#include <stddef.h>
 #include <string>
+#include <vector>
 
 // Split a line on whitespace, e.g. "foo  bar baz" -> {"foo", "bar", "baz"}.
 std::vector<std::string> split_tokens(const std::string &line);
index 64819f447ffeec0fbf6de8187e2de1d7705c240c..dfd5b97dffb4e67c38c8a585df77269686e873a1 100644 (file)
@@ -1,29 +1,26 @@
-#include <stdio.h>
-#include <string.h>
-#include <stdint.h>
-#include <unistd.h>
 #include <assert.h>
-#include <arpa/inet.h>
-#include <sys/socket.h>
+#include <errno.h>
 #include <pthread.h>
-#include <sys/types.h>
-#include <sys/ioctl.h>
+#include <stdio.h>
+#include <stdlib.h>
 #include <sys/epoll.h>
 #include <sys/sendfile.h>
+#include <sys/socket.h>
+#include <sys/types.h>
 #include <time.h>
-#include <signal.h>
-#include <errno.h>
-#include <vector>
-#include <string>
-#include <map>
+#include <unistd.h>
 #include <algorithm>
+#include <map>
+#include <string>
+#include <utility>
+#include <vector>
 
 #include "markpool.h"
+#include "mutexlock.h"
 #include "parse.h"
 #include "server.h"
-#include "stream.h"
-#include "mutexlock.h"
 #include "state.pb.h"
+#include "stream.h"
 
 using namespace std;
 
index 343adf9bfd28f1513fcd6c9ccbec011919b9e147..e8114cfbdcf516a920cdb1a5690951e0705a1e46 100644 (file)
--- a/server.h
+++ b/server.h
@@ -1,17 +1,22 @@
 #ifndef _SERVER_H
 #define _SERVER_H 1
 
-#include <stdint.h>
 #include <pthread.h>
+#include <stddef.h>
+#include <stdint.h>
 #include <sys/epoll.h>
+#include <sys/types.h>
 #include <time.h>
-#include <string>
 #include <map>
+#include <string>
 #include <vector>
 
 #include "client.h"
 #include "thread.h"
 
+class ClientProto;
+struct Stream;
+
 #define EPOLL_MAX_EVENTS 8192
 #define EPOLL_TIMEOUT_MS 20
 #define MAX_CLIENT_REQUEST 16384
index e47c8d567da2f847b1f7d39301074232480fa7a8..ee3587f79ef7dbf3ffad312229554a849d3725ed 100644 (file)
@@ -1,3 +1,7 @@
+#include <google/protobuf/repeated_field.h>
+
+#include "client.h"
+#include "server.h"
 #include "serverpool.h"
 #include "state.pb.h"
 
index 1369db0e44d2aa600820862d696fd7b256545585..106877a65cfdc48086aeabaf8dc2100059b34f7a 100644 (file)
@@ -1,11 +1,16 @@
 #ifndef _SERVERPOOL_H
 #define _SERVERPOOL_H 1
 
-#include "server.h"
-
+#include <stddef.h>
+#include <string>
 #include <vector>
 
+#include "server.h"
+#include "state.pb.h"
+
 class MarkPool;
+class Server;
+struct ClientStats;
 
 // Provides services such as load-balancing between a number of Server instances.
 class ServerPool {
index 94cd4e71c5c9fa0c7794f1f40e80d26707d6bfb4..49106eed04fbcf7fffc0e2a8f5c8b6de79e1c081 100644 (file)
--- a/stats.cpp
+++ b/stats.cpp
@@ -1,11 +1,13 @@
+#include <fcntl.h>
+#include <stddef.h>
 #include <stdio.h>
-#include <string.h>
 #include <stdlib.h>
+#include <string.h>
+#include <time.h>
 #include <unistd.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <pthread.h>
+#include <vector>
 
+#include "client.h"
 #include "serverpool.h"
 #include "stats.h"
 
index 322391ef5c2158dfc04c440301a11b9cc4e792fb..080d3bf95a5086a20338a6754dad5026babe791e 100644 (file)
@@ -1,13 +1,13 @@
+#include <errno.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <unistd.h>
-#include <errno.h>
-#include <algorithm>
 #include <string>
 #include <vector>
 
+#include "state.pb.h"
 #include "stream.h"
 #include "util.h"
-#include "state.pb.h"
 
 using namespace std;
 
index efedc9b404a7f3c71e90fbb4fdb412e7ac58f5e5..ea13f40bd6258dffe1e9a22619d889688e97fd9e 100644 (file)
--- a/stream.h
+++ b/stream.h
@@ -4,13 +4,14 @@
 // Representation of a single, muxed (we only really care about bytes/blocks) stream.
 // Fed by Input, sent out by Server (to Client).
 
+#include <stddef.h>
 #include <stdint.h>
 #include <string>
 #include <vector>
 
-struct Client;
 class MarkPool;
 class StreamProto;
+struct Client;
 
 struct Stream {
        Stream(const std::string &stream_id, size_t backlog_size);
index 6537035bb842e4e8cc3fe09ac30d9c187e4c6c7d..fc0779cebdf25be2eb115b92ce3da73f543ec9eb 100644 (file)
@@ -1,17 +1,17 @@
+#include <assert.h>
+#include <errno.h>
+#include <poll.h>
 #include <stdio.h>
-#include <unistd.h>
-#include <sys/types.h>
+#include <stdlib.h>
 #include <sys/socket.h>
-#include <sys/poll.h>
-#include <arpa/inet.h>
-#include <errno.h>
+#include <unistd.h>
 #include <string>
 
 #include "acceptor.h"
-#include "udpinput.h"
 #include "serverpool.h"
-#include "version.h"
 #include "state.pb.h"
+#include "udpinput.h"
+#include "version.h"
 
 using namespace std;
 
index 0f89d6828de79b9be3e27db77ed2d7efcf93fb70..a5f71b98209a57f1f719d5a447ec2c8e38914d09 100644 (file)
@@ -1,8 +1,8 @@
 #ifndef _UDPINPUT_H
 #define _UDPINPUT_H 1
 
-#include <vector>
 #include <string>
+#include <vector>
 
 #include "input.h"
 
index c8e26d26aa65e5f36a6fa0b64692e767e176c006..a5d6378fd6817ac5921f7009e7a1b9166794dd43 100644 (file)
--- a/util.cpp
+++ b/util.cpp
@@ -1,7 +1,8 @@
+#include <errno.h>
+#include <stddef.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <errno.h>
 
 #include "util.h"