From 1545909dcb3ac618754486f4ccd4d8f237d64bb7 Mon Sep 17 00:00:00 2001 From: Kirill Isakov Date: Thu, 29 Jul 2021 23:02:09 +0600 Subject: [PATCH] Remove unused '#include's. --- src/bsd/device.c | 3 --- src/chacha-poly1305/chacha-poly1305.c | 2 -- src/conf.c | 1 - src/connection.c | 2 -- src/control.c | 2 -- src/dropin.c | 2 -- src/edge.c | 1 - src/event.c | 4 ---- src/fd_device.c | 1 - src/graph.c | 4 ---- src/info.c | 2 -- src/linux/device.c | 3 --- src/meta.c | 1 - src/multicast_device.c | 1 - src/net.c | 3 --- src/net_packet.c | 2 -- src/net_setup.c | 1 - src/net_socket.c | 2 -- src/netutl.c | 1 - src/node.c | 1 - src/openssl/digest.c | 1 - src/openssl/rsagen.c | 3 --- src/process.c | 15 ++++----------- src/process.h | 2 ++ src/protocol.c | 1 - src/protocol_auth.c | 2 -- src/protocol_edge.c | 1 - src/protocol_key.c | 2 -- src/protocol_misc.c | 2 -- src/protocol_subnet.c | 2 -- src/raw_socket_device.c | 2 -- src/route.c | 1 - src/sptps_keypair.c | 1 - src/subnet.c | 3 --- src/subnet_parse.c | 3 --- src/tincd.c | 3 --- 36 files changed, 6 insertions(+), 77 deletions(-) diff --git a/src/bsd/device.c b/src/bsd/device.c index 235f4ec6..efe17d1a 100644 --- a/src/bsd/device.c +++ b/src/bsd/device.c @@ -24,10 +24,7 @@ #include "../conf.h" #include "../device.h" #include "../logger.h" -#include "../names.h" -#include "../net.h" #include "../route.h" -#include "../utils.h" #include "../xalloc.h" #ifdef ENABLE_TUNEMU diff --git a/src/chacha-poly1305/chacha-poly1305.c b/src/chacha-poly1305/chacha-poly1305.c index a74c5024..d13fec41 100644 --- a/src/chacha-poly1305/chacha-poly1305.c +++ b/src/chacha-poly1305/chacha-poly1305.c @@ -1,6 +1,4 @@ #include "../system.h" - -#include "../cipher.h" #include "../xalloc.h" #include "chacha.h" diff --git a/src/conf.c b/src/conf.c index cbf3bea0..de632af3 100644 --- a/src/conf.c +++ b/src/conf.c @@ -32,7 +32,6 @@ #include "names.h" #include "netutl.h" /* for str2address */ #include "protocol.h" -#include "utils.h" /* for cp */ #include "xalloc.h" splay_tree_t *config_tree = NULL; diff --git a/src/connection.c b/src/connection.c index 2f35124e..5a7c43b8 100644 --- a/src/connection.c +++ b/src/connection.c @@ -25,11 +25,9 @@ #include "cipher.h" #include "conf.h" #include "control_common.h" -#include "list.h" #include "logger.h" #include "net.h" #include "rsa.h" -#include "subnet.h" #include "utils.h" #include "xalloc.h" diff --git a/src/control.c b/src/control.c index fc713c8b..6e2a7f32 100644 --- a/src/control.c +++ b/src/control.c @@ -22,9 +22,7 @@ #include "conf.h" #include "control.h" #include "control_common.h" -#include "graph.h" #include "logger.h" -#include "meta.h" #include "names.h" #include "net.h" #include "netutl.h" diff --git a/src/dropin.c b/src/dropin.c index 0cde7a03..2d08dc46 100644 --- a/src/dropin.c +++ b/src/dropin.c @@ -20,8 +20,6 @@ #include "system.h" -#include "xalloc.h" - #ifndef HAVE_DAEMON /* Replacement for the daemon() function. diff --git a/src/edge.c b/src/edge.c index 86970ce6..a19b9d33 100644 --- a/src/edge.c +++ b/src/edge.c @@ -26,7 +26,6 @@ #include "logger.h" #include "netutl.h" #include "node.h" -#include "utils.h" #include "xalloc.h" splay_tree_t *edge_weight_tree; diff --git a/src/event.c b/src/event.c index 6603ebf0..a1801723 100644 --- a/src/event.c +++ b/src/event.c @@ -18,12 +18,8 @@ */ #include "system.h" - -#include "dropin.h" #include "event.h" -#include "net.h" #include "utils.h" -#include "xalloc.h" struct timeval now; diff --git a/src/fd_device.c b/src/fd_device.c index 1325ee5a..205b628b 100644 --- a/src/fd_device.c +++ b/src/fd_device.c @@ -31,7 +31,6 @@ #include "logger.h" #include "net.h" #include "route.h" -#include "utils.h" struct unix_socket_addr { size_t size; diff --git a/src/graph.c b/src/graph.c index a774eacc..4de9181c 100644 --- a/src/graph.c +++ b/src/graph.c @@ -45,20 +45,16 @@ #include "system.h" #include "connection.h" -#include "device.h" #include "edge.h" #include "graph.h" #include "list.h" #include "logger.h" -#include "names.h" #include "netutl.h" #include "node.h" #include "protocol.h" #include "script.h" #include "subnet.h" -#include "utils.h" #include "xalloc.h" -#include "graph.h" /* Implementation of Kruskal's algorithm. Running time: O(EN) diff --git a/src/info.c b/src/info.c index 758c0d1f..bae3125a 100644 --- a/src/info.c +++ b/src/info.c @@ -20,12 +20,10 @@ #include "system.h" #include "control_common.h" -#include "list.h" #include "subnet.h" #include "tincctl.h" #include "info.h" #include "utils.h" -#include "xalloc.h" void logger(int level, int priority, const char *format, ...) { (void)level; diff --git a/src/linux/device.c b/src/linux/device.c index 94e223f7..d782c764 100644 --- a/src/linux/device.c +++ b/src/linux/device.c @@ -27,11 +27,8 @@ #include "../device.h" #include "../logger.h" #include "../names.h" -#include "../net.h" #include "../route.h" -#include "../utils.h" #include "../xalloc.h" -#include "../device.h" typedef enum device_type_t { DEVICE_TYPE_TUN, diff --git a/src/meta.c b/src/meta.c index 4282a4e6..084c6a7f 100644 --- a/src/meta.c +++ b/src/meta.c @@ -28,7 +28,6 @@ #include "net.h" #include "protocol.h" #include "utils.h" -#include "xalloc.h" #ifndef MIN static ssize_t MIN(ssize_t x, ssize_t y) { diff --git a/src/multicast_device.c b/src/multicast_device.c index e9607f0d..fbb9aeab 100644 --- a/src/multicast_device.c +++ b/src/multicast_device.c @@ -26,7 +26,6 @@ #include "logger.h" #include "netutl.h" #include "utils.h" -#include "route.h" #include "xalloc.h" static const char *device_info = "multicast socket"; diff --git a/src/net.c b/src/net.c index de79b5e8..33870f1e 100644 --- a/src/net.c +++ b/src/net.c @@ -26,17 +26,14 @@ #include "conf_net.h" #include "conf.h" #include "connection.h" -#include "device.h" #include "graph.h" #include "logger.h" #include "meta.h" #include "names.h" #include "net.h" -#include "netutl.h" #include "protocol.h" #include "subnet.h" #include "utils.h" -#include "xalloc.h" int contradicting_add_edge = 0; int contradicting_del_edge = 0; diff --git a/src/net_packet.c b/src/net_packet.c index 417c74ec..f9907ee7 100644 --- a/src/net_packet.c +++ b/src/net_packet.c @@ -47,14 +47,12 @@ #include "ethernet.h" #include "ipv4.h" #include "ipv6.h" -#include "graph.h" #include "logger.h" #include "net.h" #include "netutl.h" #include "protocol.h" #include "route.h" #include "utils.h" -#include "xalloc.h" #ifndef MAX #define MAX(a, b) ((a) > (b) ? (a) : (b)) diff --git a/src/net_setup.c b/src/net_setup.c index f253ccd2..f3a4bcca 100644 --- a/src/net_setup.c +++ b/src/net_setup.c @@ -38,7 +38,6 @@ #include "process.h" #include "protocol.h" #include "route.h" -#include "rsa.h" #include "script.h" #include "subnet.h" #include "utils.h" diff --git a/src/net_socket.c b/src/net_socket.c index 91f0bbb7..24a9804e 100644 --- a/src/net_socket.c +++ b/src/net_socket.c @@ -25,10 +25,8 @@ #include "address_cache.h" #include "conf.h" #include "connection.h" -#include "control_common.h" #include "list.h" #include "logger.h" -#include "meta.h" #include "names.h" #include "net.h" #include "netutl.h" diff --git a/src/netutl.c b/src/netutl.c index 2916e9ae..e2ee7719 100644 --- a/src/netutl.c +++ b/src/netutl.c @@ -23,7 +23,6 @@ #include "net.h" #include "netutl.h" #include "logger.h" -#include "utils.h" #include "xalloc.h" bool hostnames = false; diff --git a/src/node.c b/src/node.c index 8f4b6eee..78c9a9fa 100644 --- a/src/node.c +++ b/src/node.c @@ -22,7 +22,6 @@ #include "address_cache.h" #include "control_common.h" -#include "hash.h" #include "logger.h" #include "net.h" #include "netutl.h" diff --git a/src/openssl/digest.c b/src/openssl/digest.c index d51dcaa9..20e45b64 100644 --- a/src/openssl/digest.c +++ b/src/openssl/digest.c @@ -18,7 +18,6 @@ */ #include "../system.h" -#include "../utils.h" #include "../xalloc.h" #include diff --git a/src/openssl/rsagen.c b/src/openssl/rsagen.c index 5c42ac5d..3dd34e23 100644 --- a/src/openssl/rsagen.c +++ b/src/openssl/rsagen.c @@ -17,8 +17,6 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "../system.h" - #include #include @@ -27,7 +25,6 @@ typedef RSA rsa_t; #include "../logger.h" #include "../rsagen.h" -#include "../xalloc.h" /* This function prettyprints the key generation process */ diff --git a/src/process.c b/src/process.c index b6d4e124..f596eb6c 100644 --- a/src/process.c +++ b/src/process.c @@ -20,22 +20,15 @@ #include "system.h" -#include "conf.h" -#include "connection.h" -#include "control.h" -#include "device.h" -#include "edge.h" -#include "event.h" #include "logger.h" #include "names.h" -#include "net.h" -#include "node.h" #include "process.h" -#include "subnet.h" -#include "utils.h" -#include "xalloc.h" #include "version.h" +#ifdef HAVE_MINGW +#include "utils.h" +#endif + /* If zero, don't detach from the terminal. */ bool do_detach = true; bool sigalrm = false; diff --git a/src/process.h b/src/process.h index 93ef5e9c..26a9cab6 100644 --- a/src/process.h +++ b/src/process.h @@ -29,6 +29,8 @@ extern bool detach(void); extern bool kill_other(int); #ifdef HAVE_MINGW +#include "event.h" + extern io_t stop_io; extern bool init_service(void); #endif diff --git a/src/protocol.c b/src/protocol.c index d8b88673..3a0ae1d7 100644 --- a/src/protocol.c +++ b/src/protocol.c @@ -25,7 +25,6 @@ #include "logger.h" #include "meta.h" #include "protocol.h" -#include "utils.h" #include "xalloc.h" bool tunnelserver = false; diff --git a/src/protocol_auth.c b/src/protocol_auth.c index fc39b64e..a40c87f3 100644 --- a/src/protocol_auth.c +++ b/src/protocol_auth.c @@ -26,7 +26,6 @@ #include "control_common.h" #include "cipher.h" #include "crypto.h" -#include "device.h" #include "digest.h" #include "ecdsa.h" #include "edge.h" @@ -37,7 +36,6 @@ #include "net.h" #include "netutl.h" #include "node.h" -#include "prf.h" #include "protocol.h" #include "rsa.h" #include "script.h" diff --git a/src/protocol_edge.c b/src/protocol_edge.c index d650c36f..daceb2e0 100644 --- a/src/protocol_edge.c +++ b/src/protocol_edge.c @@ -26,7 +26,6 @@ #include "edge.h" #include "graph.h" #include "logger.h" -#include "meta.h" #include "net.h" #include "netutl.h" #include "node.h" diff --git a/src/protocol_key.c b/src/protocol_key.c index a9d719bb..3036d124 100644 --- a/src/protocol_key.c +++ b/src/protocol_key.c @@ -27,12 +27,10 @@ #include "net.h" #include "netutl.h" #include "node.h" -#include "prf.h" #include "protocol.h" #include "route.h" #include "sptps.h" #include "utils.h" -#include "xalloc.h" #ifndef DISABLE_LEGACY static bool mykeyused = false; diff --git a/src/protocol_misc.c b/src/protocol_misc.c index 050e30a0..27125da8 100644 --- a/src/protocol_misc.c +++ b/src/protocol_misc.c @@ -21,7 +21,6 @@ #include "system.h" #include "address_cache.h" -#include "conf.h" #include "connection.h" #include "logger.h" #include "meta.h" @@ -29,7 +28,6 @@ #include "netutl.h" #include "protocol.h" #include "utils.h" -#include "xalloc.h" #ifndef MIN #define MIN(x, y) (((x)<(y))?(x):(y)) diff --git a/src/protocol_subnet.c b/src/protocol_subnet.c index 53afb8a4..af31d064 100644 --- a/src/protocol_subnet.c +++ b/src/protocol_subnet.c @@ -24,8 +24,6 @@ #include "conf.h" #include "connection.h" #include "logger.h" -#include "net.h" -#include "netutl.h" #include "node.h" #include "protocol.h" #include "subnet.h" diff --git a/src/raw_socket_device.c b/src/raw_socket_device.c index 02f6afaf..30f8b3cc 100644 --- a/src/raw_socket_device.c +++ b/src/raw_socket_device.c @@ -28,8 +28,6 @@ #include "device.h" #include "net.h" #include "logger.h" -#include "utils.h" -#include "route.h" #include "xalloc.h" #if defined(PF_PACKET) && defined(ETH_P_ALL) && defined(AF_PACKET) && defined(SIOCGIFINDEX) diff --git a/src/route.c b/src/route.c index 3fe6edb2..aa5634c0 100644 --- a/src/route.c +++ b/src/route.c @@ -31,7 +31,6 @@ #include "protocol.h" #include "route.h" #include "subnet.h" -#include "utils.h" rmode_t routing_mode = RMODE_ROUTER; fmode_t forwarding_mode = FMODE_INTERNAL; diff --git a/src/sptps_keypair.c b/src/sptps_keypair.c index 51540aa5..4dbd2ba1 100644 --- a/src/sptps_keypair.c +++ b/src/sptps_keypair.c @@ -23,7 +23,6 @@ #include "crypto.h" #include "ecdsagen.h" -#include "utils.h" static char *program_name; diff --git a/src/subnet.c b/src/subnet.c index 4fefda6f..13c46030 100644 --- a/src/subnet.c +++ b/src/subnet.c @@ -22,16 +22,13 @@ #include "splay_tree.h" #include "control_common.h" -#include "device.h" #include "hash.h" #include "logger.h" -#include "names.h" #include "net.h" #include "netutl.h" #include "node.h" #include "script.h" #include "subnet.h" -#include "utils.h" #include "xalloc.h" /* lists type of subnet */ diff --git a/src/subnet_parse.c b/src/subnet_parse.c index 3273b0b8..9e651458 100644 --- a/src/subnet_parse.c +++ b/src/subnet_parse.c @@ -22,10 +22,7 @@ #include "logger.h" #include "net.h" -#include "netutl.h" #include "subnet.h" -#include "utils.h" -#include "xalloc.h" /* Changing this default will affect ADD_SUBNET messages - beware of inconsistencies between versions */ static const int DEFAULT_WEIGHT = 10; diff --git a/src/tincd.c b/src/tincd.c index d8ab0ac0..35a84be1 100644 --- a/src/tincd.c +++ b/src/tincd.c @@ -48,14 +48,11 @@ #endif #include "conf.h" -#include "control.h" #include "crypto.h" -#include "device.h" #include "event.h" #include "logger.h" #include "names.h" #include "net.h" -#include "netutl.h" #include "process.h" #include "protocol.h" #include "utils.h" -- 2.20.1