mirror of https://github.com/xzeldon/htop.git
Convert addattrstr to static inline function
NB: The macro could have been a braced while(0) loop, which without optimization produces more code
This commit is contained in:
parent
c790b6ae67
commit
db0a13970e
7
Action.c
7
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("/");
|
||||
|
|
Loading…
Reference in New Issue