From 999c9646895fea64ece612be86aed162472b5d3b Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Wed, 29 May 2019 08:27:10 +0200 Subject: [PATCH] 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 --- app/src/control_event.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/control_event.h b/app/src/control_event.h index a7bde313..ac698065 100644 --- a/app/src/control_event.h +++ b/app/src/control_event.h @@ -10,7 +10,7 @@ #define CONTROL_EVENT_QUEUE_SIZE 64 #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 { CONTROL_EVENT_TYPE_KEYCODE,