From 8fcff0109fd0af7435df5b26c1c9912df506efae Mon Sep 17 00:00:00 2001 From: Michael Richters Date: Sat, 2 Dec 2017 00:19:54 -0600 Subject: [PATCH] Small improvement to QUKEYS() macro Using braces really makes it much clearer. I stole the idea from @algernon. --- src/Kaleidoscope/Qukeys.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Kaleidoscope/Qukeys.h b/src/Kaleidoscope/Qukeys.h index aacc75d9..3e227e70 100644 --- a/src/Kaleidoscope/Qukeys.h +++ b/src/Kaleidoscope/Qukeys.h @@ -114,7 +114,8 @@ class Qukeys : public KaleidoscopePlugin { extern kaleidoscope::Qukeys Qukeys; // macro for use in sketch file to simplify definition of qukeys -#define QUKEYS(qukey_defs...) \ +#define QUKEYS(qukey_defs...) { \ static kaleidoscope::Qukey qukeys[] = { qukey_defs }; \ Qukeys.qukeys_ = qukeys; \ - Qukeys.qukeys_count_ = sizeof(qukeys) / sizeof(kaleidoscope::Qukey); + Qukeys.qukeys_count_ = sizeof(qukeys) / sizeof(kaleidoscope::Qukey); \ +}