From 8737035999474283a28faa5780f43138f96ab82c Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Mon, 6 Jun 2022 11:00:26 +0200 Subject: themes: simplify empty macros, remove do { } while(0) Multiple function calls should still be nested in a do { } while(0), but this is hopefully obvious looking at the other lines. While testing, gcc with -O0 created the same binary. clang added a single jmp instruction. --- themes/mono.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'themes/mono.h') diff --git a/themes/mono.h b/themes/mono.h index 586ede0..253d76e 100644 --- a/themes/mono.h +++ b/themes/mono.h @@ -1,13 +1,13 @@ /* default mono theme */ -#define THEME_ITEM_NORMAL() do { } while(0) -#define THEME_ITEM_FOCUS() do { } while(0) +#define THEME_ITEM_NORMAL() +#define THEME_ITEM_FOCUS() #define THEME_ITEM_BOLD() do { attrmode(ATTR_BOLD_ON); } while(0) #define THEME_ITEM_SELECTED() do { if (p->focused) attrmode(ATTR_REVERSE_ON); } while(0) -#define THEME_SCROLLBAR_FOCUS() do { } while(0) +#define THEME_SCROLLBAR_FOCUS() #define THEME_SCROLLBAR_NORMAL() do { attrmode(ATTR_FAINT_ON); } while(0) #define THEME_SCROLLBAR_TICK_FOCUS() do { attrmode(ATTR_REVERSE_ON); } while(0) #define THEME_SCROLLBAR_TICK_NORMAL() do { attrmode(ATTR_REVERSE_ON); } while(0) #define THEME_LINEBAR() do { attrmode(ATTR_FAINT_ON); } while(0) #define THEME_STATUSBAR() do { attrmode(ATTR_REVERSE_ON); } while(0) #define THEME_INPUT_LABEL() do { attrmode(ATTR_REVERSE_ON); } while(0) -#define THEME_INPUT_NORMAL() do { } while(0) +#define THEME_INPUT_NORMAL() -- cgit v1.2.3