Make macro expansion-safe
Use parentheses to avoid unexpected results. For example, make: 2 * SERIALIZED_EVENT_MAX_SIZE expand to: 2 * (3 + TEXT_MAX_LENGTH) instead of: 2 * 3 + TEXT_MAX_LENGTH
This commit is contained in:
parent
befe455e44
commit
999c964689
1 changed files with 1 additions and 1 deletions
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
#define CONTROL_EVENT_QUEUE_SIZE 64
|
#define CONTROL_EVENT_QUEUE_SIZE 64
|
||||||
#define TEXT_MAX_LENGTH 300
|
#define TEXT_MAX_LENGTH 300
|
||||||
#define SERIALIZED_EVENT_MAX_SIZE 3 + TEXT_MAX_LENGTH
|
#define SERIALIZED_EVENT_MAX_SIZE (3 + TEXT_MAX_LENGTH)
|
||||||
|
|
||||||
enum control_event_type {
|
enum control_event_type {
|
||||||
CONTROL_EVENT_TYPE_KEYCODE,
|
CONTROL_EVENT_TYPE_KEYCODE,
|
||||||
|
|
Loading…
Reference in a new issue