diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-06-22 10:50:12 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-06-22 10:50:14 -0400 |
commit | b2d4e786b7ed2563461513e36c7e75bea1f70be8 (patch) | |
tree | f5580d1c69ee16e5ce9bbbc4129b1e3751ef601c /src/lib | |
parent | da4ae8a6b6bc45f301c1493bb55b09e2f1209ac2 (diff) | |
download | tor-b2d4e786b7ed2563461513e36c7e75bea1f70be8.tar.gz tor-b2d4e786b7ed2563461513e36c7e75bea1f70be8.zip |
Remove the util_bug.h include from smartlist.h.
This change makes a whole bunch of things in torlog.c break, since
apparently I did not find all the fd dependencies.
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/compress/.may_include | 1 | ||||
-rw-r--r-- | src/lib/container/smartlist.c | 3 | ||||
-rw-r--r-- | src/lib/container/smartlist.h | 18 | ||||
-rw-r--r-- | src/lib/crypt_ops/.may_include | 1 | ||||
-rw-r--r-- | src/lib/ctime/.may_include | 5 | ||||
-rw-r--r-- | src/lib/ctime/di_ops.c | 17 | ||||
-rw-r--r-- | src/lib/log/.may_include | 10 | ||||
-rw-r--r-- | src/lib/log/ratelim.c | 1 | ||||
-rw-r--r-- | src/lib/log/ratelim.h | 2 | ||||
-rw-r--r-- | src/lib/log/torlog.c | 4 | ||||
-rw-r--r-- | src/lib/tls/.may_include | 1 | ||||
-rw-r--r-- | src/lib/trace/.may_include | 4 |
12 files changed, 45 insertions, 22 deletions
diff --git a/src/lib/compress/.may_include b/src/lib/compress/.may_include index 70528a7df0..3f69dd1333 100644 --- a/src/lib/compress/.may_include +++ b/src/lib/compress/.may_include @@ -1,6 +1,7 @@ orconfig.h lib/cc/*.h lib/compress/*.h +lib/log/*.h # XXX I'd like to remove this. common/*.h diff --git a/src/lib/container/smartlist.c b/src/lib/container/smartlist.c index 57b88415a3..9d405085be 100644 --- a/src/lib/container/smartlist.c +++ b/src/lib/container/smartlist.c @@ -17,9 +17,12 @@ #include "lib/malloc/util_malloc.h" #include "lib/defs/digest_sizes.h" #include "lib/ctime/di_ops.h" +#include "lib/string/compat_ctype.h" #include "lib/string/util_string.h" #include "lib/string/printf.h" +#include "common/util_bug.h" + #include <stdlib.h> #include <string.h> diff --git a/src/lib/container/smartlist.h b/src/lib/container/smartlist.h index 53a4948cf6..dd455390eb 100644 --- a/src/lib/container/smartlist.h +++ b/src/lib/container/smartlist.h @@ -7,8 +7,10 @@ #define TOR_SMARTLIST_H #include <stddef.h> +#include <stdarg.h> + #include "lib/cc/compat_compiler.h" -#include "common/util_bug.h" +#include "lib/cc/torint.h" #include "lib/testsupport/testsupport.h" /** A resizeable list of pointers, with associated helpful functionality. @@ -66,22 +68,22 @@ void smartlist_subtract(smartlist_t *sl1, const smartlist_t *sl2); */ static inline int smartlist_len(const smartlist_t *sl); static inline int smartlist_len(const smartlist_t *sl) { - tor_assert(sl); + raw_assert(sl); return (sl)->num_used; } /** Return the <b>idx</b>th element of sl. */ static inline void *smartlist_get(const smartlist_t *sl, int idx); static inline void *smartlist_get(const smartlist_t *sl, int idx) { - tor_assert(sl); - tor_assert(idx>=0); - tor_assert(sl->num_used > idx); + raw_assert(sl); + raw_assert(idx>=0); + raw_assert(sl->num_used > idx); return sl->list[idx]; } static inline void smartlist_set(smartlist_t *sl, int idx, void *val) { - tor_assert(sl); - tor_assert(idx>=0); - tor_assert(sl->num_used > idx); + raw_assert(sl); + raw_assert(idx>=0); + raw_assert(sl->num_used > idx); sl->list[idx] = val; } #else /* !(defined(DEBUG_SMARTLIST)) */ diff --git a/src/lib/crypt_ops/.may_include b/src/lib/crypt_ops/.may_include index 1b9289b2f1..8031bb9bcc 100644 --- a/src/lib/crypt_ops/.may_include +++ b/src/lib/crypt_ops/.may_include @@ -9,6 +9,7 @@ lib/err/*.h lib/intmath/*.h lib/string/*.h lib/testsupport/testsupport.h +lib/log/*.h trunnel/pwbox.h diff --git a/src/lib/ctime/.may_include b/src/lib/ctime/.may_include index 72d854c374..e74669bce1 100644 --- a/src/lib/ctime/.may_include +++ b/src/lib/ctime/.may_include @@ -1,6 +1,5 @@ orconfig.h lib/cc/*.h lib/ctime/*.h - -# XXXX I'd like to remove this -common/util.h +lib/err/*.h +lib/malloc/*.h diff --git a/src/lib/ctime/di_ops.c b/src/lib/ctime/di_ops.c index 407131c448..287ff6080a 100644 --- a/src/lib/ctime/di_ops.c +++ b/src/lib/ctime/di_ops.c @@ -8,7 +8,10 @@ #include "orconfig.h" #include "lib/ctime/di_ops.h" -#include "common/util.h" +#include "lib/err/torerr.h" +#include "lib/malloc/util_malloc.h" + +#include <string.h> /** * Timing-safe version of memcmp. As memcmp, compare the <b>sz</b> bytes at @@ -170,8 +173,8 @@ dimap_add_entry(di_digest256_map_t **map, di_digest256_map_t *new_ent; { void *old_val = dimap_search(*map, key, NULL); - tor_assert(! old_val); - tor_assert(val); + raw_assert(! old_val); + raw_assert(val); } new_ent = tor_malloc_zero(sizeof(di_digest256_map_t)); new_ent->next = *map; @@ -263,10 +266,10 @@ select_array_member_cumulative_timei(const uint64_t *entries, int n_entries, rand_val = INT64_MAX; } } - tor_assert(total_so_far == total); - tor_assert(n_chosen == 1); - tor_assert(i_chosen >= 0); - tor_assert(i_chosen < n_entries); + raw_assert(total_so_far == total); + raw_assert(n_chosen == 1); + raw_assert(i_chosen >= 0); + raw_assert(i_chosen < n_entries); return i_chosen; } diff --git a/src/lib/log/.may_include b/src/lib/log/.may_include index 3806806405..4f6244c2d3 100644 --- a/src/lib/log/.may_include +++ b/src/lib/log/.may_include @@ -1,3 +1,13 @@ +orconfig.h lib/cc/*.h +lib/container/smartlist.h +lib/err/*.h +lib/intmath/*.h +lib/log/*.h lib/malloc/*.h +lib/string/*.h +lib/testsupport/*.h +lib/wallclock/*.h + +micro-revision.i
\ No newline at end of file diff --git a/src/lib/log/ratelim.c b/src/lib/log/ratelim.c index 2d276055b7..677c499110 100644 --- a/src/lib/log/ratelim.c +++ b/src/lib/log/ratelim.c @@ -5,6 +5,7 @@ #include "lib/log/ratelim.h" #include "lib/malloc/util_malloc.h" +#include "lib/string/printf.h" /** If the rate-limiter <b>lim</b> is ready at <b>now</b>, return the number * of calls to rate_limit_is_ready (including this one!) since the last time diff --git a/src/lib/log/ratelim.h b/src/lib/log/ratelim.h index efaeb9bf62..4ee6c5fed4 100644 --- a/src/lib/log/ratelim.h +++ b/src/lib/log/ratelim.h @@ -6,6 +6,8 @@ #ifndef TOR_RATELIM_H #define TOR_RATELIM_H +#include <time.h> + /* Rate-limiter */ /** A ratelim_t remembers how often an event is occurring, and how often diff --git a/src/lib/log/torlog.c b/src/lib/log/torlog.c index e77b775c28..aec469c53b 100644 --- a/src/lib/log/torlog.c +++ b/src/lib/log/torlog.c @@ -11,7 +11,7 @@ #include "orconfig.h" #include <stdarg.h> -// #include <stdio.h> +#include <stdio.h> #include <stdlib.h> #include <string.h> #ifdef HAVE_SYS_TIME_H @@ -32,6 +32,8 @@ #define LOG_PRIVATE #include "lib/log/torlog.h" +#include "lib/log/ratelim.h" +#include "lib/lock/compat_mutex.h" #include "lib/container/smartlist.h" #include "lib/err/torerr.h" #include "lib/intmath/bits.h" diff --git a/src/lib/tls/.may_include b/src/lib/tls/.may_include index 8fdd62806c..a2d84165f0 100644 --- a/src/lib/tls/.may_include +++ b/src/lib/tls/.may_include @@ -5,6 +5,7 @@ lib/crypt_ops/*.h lib/err/*.h lib/testsupport/testsupport.h lib/tls/*.h +lib/log/*.h ciphers.inc diff --git a/src/lib/trace/.may_include b/src/lib/trace/.may_include index 694c8405ec..45cd13676b 100644 --- a/src/lib/trace/.may_include +++ b/src/lib/trace/.may_include @@ -1,5 +1,3 @@ orconfig.h +lib/log/*.h lib/trace/*.h - -# XXXX -common/torlog.h |