summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-06-29 11:35:49 -0400
committerNick Mathewson <nickm@torproject.org>2018-06-29 12:21:52 -0400
commit4212a135e1c092a16fc1c4d783495e44d48bbaf9 (patch)
tree5be975b2bf77325a9386fd930e66d35183472190
parent35e1c497aa54a22818552c9f3757067e381bb6bb (diff)
downloadtor-4212a135e1c092a16fc1c4d783495e44d48bbaf9.tar.gz
tor-4212a135e1c092a16fc1c4d783495e44d48bbaf9.zip
Remove util.h and compat.h includes from src/common
-rw-r--r--src/common/address_set.c2
-rw-r--r--src/common/compat.h11
-rw-r--r--src/common/compat_libevent.c7
-rw-r--r--src/common/compat_libevent.h3
-rw-r--r--src/common/handles.h6
-rw-r--r--src/common/procmon.h1
-rw-r--r--src/common/timers.c7
-rw-r--r--src/common/token_bucket.c5
-rw-r--r--src/common/workqueue.c16
-rw-r--r--src/common/workqueue.h3
10 files changed, 26 insertions, 35 deletions
diff --git a/src/common/address_set.c b/src/common/address_set.c
index 4e14021ebc..1bd1462387 100644
--- a/src/common/address_set.c
+++ b/src/common/address_set.c
@@ -13,10 +13,8 @@
#include "orconfig.h"
#include "common/address_set.h"
#include "lib/net/address.h"
-#include "common/compat.h"
#include "lib/container/bloomfilt.h"
#include "lib/crypt_ops/crypto_rand.h"
-#include "common/util.h"
#include "siphash.h"
/* Wrap our hash function to have the signature that the bloom filter
diff --git a/src/common/compat.h b/src/common/compat.h
deleted file mode 100644
index b9e4af855d..0000000000
--- a/src/common/compat.h
+++ /dev/null
@@ -1,11 +0,0 @@
-/* Copyright (c) 2003-2004, Roger Dingledine
- * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
- * Copyright (c) 2007-2018, The Tor Project, Inc. */
-/* See LICENSE for licensing information */
-
-#ifndef TOR_COMPAT_H
-#define TOR_COMPAT_H
-
-#include "common/util.h"
-
-#endif /* !defined(TOR_COMPAT_H) */
diff --git a/src/common/compat_libevent.c b/src/common/compat_libevent.c
index a0b9bc535f..9d21cf20bd 100644
--- a/src/common/compat_libevent.c
+++ b/src/common/compat_libevent.c
@@ -7,17 +7,17 @@
*/
#include "orconfig.h"
-#include "common/compat.h"
#define COMPAT_LIBEVENT_PRIVATE
#include "common/compat_libevent.h"
#include "lib/crypt_ops/crypto_rand.h"
-
-#include "common/util.h"
#include "lib/log/torlog.h"
+#include "lib/log/util_bug.h"
+#include "lib/string/compat_string.h"
#include <event2/event.h>
#include <event2/thread.h>
+#include <string.h>
/** A string which, if it appears in a libevent log, should be ignored. */
static const char *suppress_msg = NULL;
@@ -533,4 +533,3 @@ tor_libevent_postfork(void)
tor_assert(r == 0);
}
#endif /* defined(TOR_UNIT_TESTS) */
-
diff --git a/src/common/compat_libevent.h b/src/common/compat_libevent.h
index 4b2672b7b5..0a50cfa667 100644
--- a/src/common/compat_libevent.h
+++ b/src/common/compat_libevent.h
@@ -6,6 +6,7 @@
#include "orconfig.h"
#include "lib/testsupport/testsupport.h"
+#include "lib/malloc/util_malloc.h"
void configure_libevent_logging(void);
void suppress_libevent_log_msg(const char *msg);
@@ -19,6 +20,7 @@ void suppress_libevent_log_msg(const char *msg);
struct event;
struct event_base;
+struct timeval;
void tor_event_free_(struct event *ev);
#define tor_event_free(ev) \
@@ -95,4 +97,3 @@ libevent_logging_callback(int severity, const char *msg);
#endif /* defined(COMPAT_LIBEVENT_PRIVATE) */
#endif /* !defined(TOR_COMPAT_LIBEVENT_H) */
-
diff --git a/src/common/handles.h b/src/common/handles.h
index ca345b0bcb..21ec0dfeec 100644
--- a/src/common/handles.h
+++ b/src/common/handles.h
@@ -50,8 +50,9 @@
#define TOR_HANDLE_H
#include "orconfig.h"
-#include "tor_queue.h"
-#include "common/util.h"
+
+#include "lib/log/util_bug.h"
+#include "lib/malloc/util_malloc.h"
#define HANDLE_ENTRY(name, structname) \
struct name ## _handle_head_t *handle_head
@@ -150,4 +151,3 @@
}
#endif /* !defined(TOR_HANDLE_H) */
-
diff --git a/src/common/procmon.h b/src/common/procmon.h
index 246ddd71d0..b8daeed0db 100644
--- a/src/common/procmon.h
+++ b/src/common/procmon.h
@@ -9,7 +9,6 @@
#ifndef TOR_PROCMON_H
#define TOR_PROCMON_H
-#include "common/compat.h"
#include "common/compat_libevent.h"
#include "lib/log/torlog.h"
diff --git a/src/common/timers.c b/src/common/timers.c
index 72562f4cf5..57b7d7265d 100644
--- a/src/common/timers.c
+++ b/src/common/timers.c
@@ -31,11 +31,13 @@
#define TOR_TIMERS_PRIVATE
-#include "common/compat.h"
#include "common/compat_libevent.h"
#include "common/timers.h"
+#include "lib/intmath/muldiv.h"
#include "lib/log/torlog.h"
-#include "common/util.h"
+#include "lib/log/util_bug.h"
+#include "lib/malloc/util_malloc.h"
+#include "lib/time/compat_time.h"
struct timeout_cb {
timer_cb_fn_t cb;
@@ -315,4 +317,3 @@ timer_disable(tor_timer_t *t)
/* We don't reschedule the libevent timer here, since it's okay if it fires
* early. */
}
-
diff --git a/src/common/token_bucket.c b/src/common/token_bucket.c
index 3a16720d7f..f7b092f612 100644
--- a/src/common/token_bucket.c
+++ b/src/common/token_bucket.c
@@ -19,8 +19,11 @@
#define TOKEN_BUCKET_PRIVATE
#include "common/token_bucket.h"
-#include "common/compat.h"
#include "lib/log/util_bug.h"
+#include "lib/intmath/cmp.h"
+#include "lib/time/compat_time.h"
+
+#include <string.h>
/**
* Set the <b>rate</b> and <b>burst</b> value in a token_bucket_cfg.
diff --git a/src/common/workqueue.c b/src/common/workqueue.c
index 7b030052cf..e5254396f9 100644
--- a/src/common/workqueue.c
+++ b/src/common/workqueue.c
@@ -24,17 +24,19 @@
*/
#include "orconfig.h"
-#include "common/compat.h"
#include "common/compat_libevent.h"
-#include "lib/thread/threads.h"
-#include "lib/crypt_ops/crypto_rand.h"
-#include "common/util.h"
#include "common/workqueue.h"
-#include "tor_queue.h"
-#include "lib/net/alertsock.h"
-#include "lib/log/torlog.h"
+
+#include "lib/crypt_ops/crypto_rand.h"
#include "lib/intmath/weakrng.h"
+#include "lib/log/ratelim.h"
+#include "lib/log/torlog.h"
+#include "lib/log/util_bug.h"
+#include "lib/net/alertsock.h"
+#include "lib/net/socket.h"
+#include "lib/thread/threads.h"
+#include "tor_queue.h"
#include <event2/event.h>
#include <string.h>
diff --git a/src/common/workqueue.h b/src/common/workqueue.h
index 1e0efcb1a2..4e5c424be6 100644
--- a/src/common/workqueue.h
+++ b/src/common/workqueue.h
@@ -4,7 +4,7 @@
#ifndef TOR_WORKQUEUE_H
#define TOR_WORKQUEUE_H
-#include "common/compat.h"
+#include "lib/cc/torint.h"
/** A replyqueue is used to tell the main thread about the outcome of
* work that we queued for the workers. */
@@ -63,4 +63,3 @@ int threadpool_register_reply_event(threadpool_t *tp,
void (*cb)(threadpool_t *tp));
#endif /* !defined(TOR_WORKQUEUE_H) */
-