summaryrefslogtreecommitdiffstats
path: root/Action.c
diff options
context:
space:
mode:
authorBenny Baumann <BenBE@geshi.org>2020-10-31 20:26:53 +0100
committerBenny Baumann <BenBE@geshi.org>2020-11-02 22:14:26 +0100
commitdb0a13970ed512a75ade9770f0a1aa468f657f8b (patch)
treea1b8d70f4963bcb4fe8f7ca39589f3fab27be821 /Action.c
parentc790b6ae67cc4af9f8b4dbba2e4590d36523f2a9 (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.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/Action.c b/Action.c
index 5b68811e..303eeeaf 100644
--- a/Action.c
+++ b/Action.c
@@ -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("/");

© 2014-2024 Faster IT GmbH | imprint | privacy policy