diff options
author | Benny Baumann <BenBE@geshi.org> | 2020-10-31 20:26:53 +0100 |
---|---|---|
committer | Benny Baumann <BenBE@geshi.org> | 2020-11-02 22:14:26 +0100 |
commit | db0a13970ed512a75ade9770f0a1aa468f657f8b (patch) | |
tree | a1b8d70f4963bcb4fe8f7ca39589f3fab27be821 /Action.c | |
parent | c790b6ae67cc4af9f8b4dbba2e4590d36523f2a9 (diff) |
Convert addattrstr to static inline function
NB: The macro could have been a braced while(0) loop, which without optimization produces more code
Diffstat (limited to 'Action.c')
-rw-r--r-- | Action.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -443,6 +443,11 @@ static const struct { const char* key; const char* info; } helpRight[] = { { .key = NULL, .info = NULL } }; +static inline void addattrstr( int attr, const char* str) { + attrset(attr); + addstr(str); +} + static Htop_Reaction actionHelp(State* st) { Settings* settings = st->settings; @@ -460,7 +465,7 @@ static Htop_Reaction actionHelp(State* st) { attrset(CRT_colors[DEFAULT_COLOR]); line++; mvaddstr(line++, 0, "CPU usage bar: "); - #define addattrstr(a,s) attrset(a);addstr(s) + addattrstr(CRT_colors[BAR_BORDER], "["); if (settings->detailedCPUTime) { addattrstr(CRT_colors[CPU_NICE_TEXT], "low"); addstr("/"); |