mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-25 15:10:48 +01:00
Use a compile-time assert in control_events.h
(The original idiom here led clang-format to generating a too-wide line.)
This commit is contained in:
parent
8d6f27cea5
commit
98fdc3e41a
1 changed files with 2 additions and 4 deletions
|
@ -12,6 +12,7 @@
|
|||
#ifndef TOR_CONTROL_EVENTS_H
|
||||
#define TOR_CONTROL_EVENTS_H
|
||||
|
||||
#include "lib/cc/ctassert.h"
|
||||
#include "core/or/ocirc_event.h"
|
||||
#include "core/or/orconn_event.h"
|
||||
|
||||
|
@ -287,10 +288,7 @@ typedef uint64_t event_mask_t;
|
|||
|
||||
/* If EVENT_MAX_ ever hits 0x0040, we need to make the mask into a
|
||||
* different structure, as it can only handle a maximum left shift of 1<<63. */
|
||||
|
||||
#if EVENT_MAX_ >= EVENT_CAPACITY_
|
||||
#error control_connection_t.event_mask has an event greater than its capacity
|
||||
#endif
|
||||
CTASSERT(EVENT_MAX_ < EVENT_CAPACITY_);
|
||||
|
||||
#define EVENT_MASK_(e) (((uint64_t)1)<<(e))
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue