Remove a bunch of other redundant #includes

Folks have found two in the past week or so; we may as well fix the
others.

Found with:

\#!/usr/bin/python3
import re

def findMulti(fname):
    includes = set()
    with open(fname) as f:
        for line in f:
            m = re.match(r'^\s*#\s*include\s+["<](\S+)[>"]', line)
            if m:
                inc = m.group(1)
                if inc in includes:
                    print("{}: {}".format(fname, inc))
                includes.add(m.group(1))

import sys
for fname in sys.argv[1:]:
    findMulti(fname)
This commit is contained in:
Nick Mathewson 2018-02-20 10:14:15 -05:00
parent a4ab273a0d
commit 4438ef3288
17 changed files with 4 additions and 23 deletions

View File

@ -12,7 +12,6 @@
#ifndef TOR_BUFFERS_H
#define TOR_BUFFERS_H
#include "compat.h"
#include "compat.h"
#include "torint.h"
#include "testsupport.h"

View File

@ -100,7 +100,6 @@ SecureZeroMemory(PVOID ptr, SIZE_T cnt)
/* Only use the linux prctl; the IRIX prctl is totally different */
#include <sys/prctl.h>
#elif defined(__APPLE__)
#include <sys/types.h>
#include <sys/ptrace.h>
#endif /* defined(HAVE_SYS_PRCTL_H) && defined(__linux__) || ... */

View File

@ -18,7 +18,6 @@
#include "util.h"
#include "container.h"
#include "torlog.h"
#include <process.h>
/* This value is more or less total cargo-cult */
#define SPIN_COUNT 2000

View File

@ -55,7 +55,6 @@
#include "rephist.h"
#include "router.h"
#include "routerlist.h"
#include "config.h"
static void circuit_expire_old_circuits_clientside(void);
static void circuit_increment_failure_count(void);

View File

@ -17,7 +17,6 @@
#include "hs_descriptor.h"
#include "hs_cache.h"
#include "hs_cell.h"
#include "hs_ident.h"
#include "config.h"
#include "directory.h"
#include "hs_client.h"
@ -29,7 +28,6 @@
#include "connection.h"
#include "nodelist.h"
#include "circpathbias.h"
#include "connection.h"
#include "hs_ntor.h"
#include "circuitbuild.h"
#include "networkstatus.h"

View File

@ -28,7 +28,6 @@
#include "rendservice.h"
#include "routerset.h"
#include "router.h"
#include "routerset.h"
#include "shared_random.h"
#include "shared_random_state.h"

View File

@ -12,7 +12,6 @@
#include "config.h"
#include "circuitlist.h"
#include "circuituse.h"
#include "config.h"
#include "relay.h"
#include "rendmid.h"
#include "rephist.h"

View File

@ -31,7 +31,6 @@
#include "hs_common.h"
#include "hs_config.h"
#include "hs_control.h"
#include "hs_circuit.h"
#include "hs_descriptor.h"
#include "hs_ident.h"
#include "hs_intropoint.h"

View File

@ -86,7 +86,6 @@
#include "ht.h"
#include "channelpadding.h"
#include "channelpadding.h"
#include "connection_or.h"
static void bw_arrays_init(void);

View File

@ -25,7 +25,6 @@
#include "main.h"
#include "rephist.h"
#include "hibernate.h"
#include "rephist.h"
#include "statefile.h"
#include "hs_stats.h"
#include "hs_service.h"

View File

@ -11,8 +11,11 @@
#include <iphlpapi.h>
#endif
#ifdef HAVE_IFADDRS_TO_SMARTLIST
#ifdef HAVE_NET_IF_H
#include <net/if.h>
#endif
#ifdef HAVE_IFADDRS_TO_SMARTLIST
#include <ifaddrs.h>
#endif
@ -20,7 +23,6 @@
#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
#endif
#include <net/if.h>
#endif /* defined(HAVE_IFCONF_TO_SMARTLIST) */
#include "or.h"

View File

@ -20,7 +20,6 @@
#include "connection_edge.h"
#include "test.h"
#include "util.h"
#include "address.h"
#include "connection_or.h"
#include "control.h"
#include "cpuworker.h"
@ -42,9 +41,6 @@
#include "routerlist.h"
#include "routerset.h"
#include "statefile.h"
#include "test.h"
#include "transports.h"
#include "util.h"
#include "test_helpers.h"

View File

@ -16,7 +16,6 @@
#include "directory.h"
#include "test.h"
#include "compress.h"
#include "connection.h"
#include "rendcommon.h"
#include "rendcache.h"
#include "router.h"

View File

@ -33,7 +33,6 @@ DISABLE_GCC_WARNING(overlength-strings)
* at large. */
#endif
#include "test_descriptors.inc"
#include "or.h"
#include "circuitlist.h"
#ifdef HAVE_CFLAG_WOVERLENGTH_STRINGS
ENABLE_GCC_WARNING(overlength-strings)

View File

@ -14,7 +14,6 @@
#include "test.h"
#include "log_test_helpers.h"
#include "crypto.h"
#include "log_test_helpers.h"
#include "or.h"
#include "circuitlist.h"

View File

@ -29,8 +29,6 @@
#include <dirent.h>
#endif /* defined(_WIN32) */
#include "or.h"
#ifdef USE_DMALLOC
#include <dmalloc.h>
#include "main.h"

View File

@ -36,7 +36,6 @@ ENABLE_GCC_WARNING(redundant-decls)
#include <assert.h>
#endif
#include "compat.h"
#include "util.h"
#include "torlog.h"
#include "crypto.h"