diff options
author | George Kadianakis <desnacked@riseup.net> | 2019-01-02 15:19:12 +0200 |
---|---|---|
committer | George Kadianakis <desnacked@riseup.net> | 2019-01-02 15:25:55 +0200 |
commit | a336d816a68e5eaddd9d80f7179699274b367a1d (patch) | |
tree | f3e426b94c3e42c059caf57c8384ad970150ae1a /src/lib | |
parent | d62340018c8d363ea67ef01dc4a740e47fce2a10 (diff) | |
download | tor-a336d816a68e5eaddd9d80f7179699274b367a1d.tar.gz tor-a336d816a68e5eaddd9d80f7179699274b367a1d.zip |
Circuit padding tests.
Co-authored-by: George Kadianakis <desnacked@riseup.net>
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/smartlist_core/smartlist_foreach.h | 5 | ||||
-rw-r--r-- | src/lib/time/compat_time.c | 4 | ||||
-rw-r--r-- | src/lib/time/compat_time.h | 2 |
3 files changed, 8 insertions, 3 deletions
diff --git a/src/lib/smartlist_core/smartlist_foreach.h b/src/lib/smartlist_core/smartlist_foreach.h index 14f2930c9f..c9afebd6a2 100644 --- a/src/lib/smartlist_core/smartlist_foreach.h +++ b/src/lib/smartlist_core/smartlist_foreach.h @@ -83,6 +83,11 @@ ++var ## _sl_idx) { \ var = (sl)->list[var ## _sl_idx]; +/** Iterates over the items in smartlist <b>sl</b> in reverse order, similar to + * SMARTLIST_FOREACH_BEGIN + * + * NOTE: This macro is incompatible with SMARTLIST_DEL_CURRENT. + */ #define SMARTLIST_FOREACH_REVERSE_BEGIN(sl, type, var) \ STMT_BEGIN \ int var ## _sl_idx, var ## _sl_len=(sl)->num_used; \ diff --git a/src/lib/time/compat_time.c b/src/lib/time/compat_time.c index f1ddb4fdc4..387b0fad22 100644 --- a/src/lib/time/compat_time.c +++ b/src/lib/time/compat_time.c @@ -787,8 +787,8 @@ monotime_absolute_nsec(void) return monotime_diff_nsec(&initialized_at, &now); } -uint64_t -monotime_absolute_usec(void) +MOCK_IMPL(uint64_t, +monotime_absolute_usec,(void)) { return monotime_absolute_nsec() / 1000; } diff --git a/src/lib/time/compat_time.h b/src/lib/time/compat_time.h index 44fab62de5..bf1bd28801 100644 --- a/src/lib/time/compat_time.h +++ b/src/lib/time/compat_time.h @@ -103,7 +103,7 @@ uint64_t monotime_absolute_nsec(void); /** * Return the number of microseconds since the timer system was initialized. */ -uint64_t monotime_absolute_usec(void); +MOCK_DECL(uint64_t, monotime_absolute_usec,(void)); /** * Return the number of milliseconds since the timer system was initialized. */ |