diff options
| -rw-r--r-- | tools/perf/util/newt.c | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/tools/perf/util/newt.c b/tools/perf/util/newt.c index 2001d26a5579..ccb7c5bb269e 100644 --- a/tools/perf/util/newt.c +++ b/tools/perf/util/newt.c | |||
| @@ -14,6 +14,17 @@ | |||
| 14 | #include "sort.h" | 14 | #include "sort.h" |
| 15 | #include "symbol.h" | 15 | #include "symbol.h" |
| 16 | 16 | ||
| 17 | #if SLANG_VERSION < 20104 | ||
| 18 | #define slsmg_printf(msg, args...) SLsmg_printf((char *)msg, ##args) | ||
| 19 | #define slsmg_write_nstring(msg, len) SLsmg_write_nstring((char *)msg, len) | ||
| 20 | #define sltt_set_color(obj, name, fg, bg) SLtt_set_color(obj,(char *)name,\ | ||
| 21 | (char *)fg, (char *)bg) | ||
| 22 | #else | ||
| 23 | #define slsmg_printf SLsmg_printf | ||
| 24 | #define slsmg_write_nstring SLsmg_write_nstring | ||
| 25 | #define sltt_set_color SLtt_set_color | ||
| 26 | #endif | ||
| 27 | |||
| 17 | struct ui_progress { | 28 | struct ui_progress { |
| 18 | newtComponent form, scale; | 29 | newtComponent form, scale; |
| 19 | }; | 30 | }; |
| @@ -292,21 +303,21 @@ static int objdump_line__show(struct objdump_line *self, struct list_head *head, | |||
| 292 | 303 | ||
| 293 | color = ui_browser__percent_color(percent, current_entry); | 304 | color = ui_browser__percent_color(percent, current_entry); |
| 294 | SLsmg_set_color(color); | 305 | SLsmg_set_color(color); |
| 295 | SLsmg_printf(" %7.2f ", percent); | 306 | slsmg_printf(" %7.2f ", percent); |
| 296 | if (!current_entry) | 307 | if (!current_entry) |
| 297 | SLsmg_set_color(HE_COLORSET_CODE); | 308 | SLsmg_set_color(HE_COLORSET_CODE); |
| 298 | } else { | 309 | } else { |
| 299 | int color = ui_browser__percent_color(0, current_entry); | 310 | int color = ui_browser__percent_color(0, current_entry); |
| 300 | SLsmg_set_color(color); | 311 | SLsmg_set_color(color); |
| 301 | SLsmg_write_nstring(" ", 9); | 312 | slsmg_write_nstring(" ", 9); |
| 302 | } | 313 | } |
| 303 | 314 | ||
| 304 | SLsmg_write_char(':'); | 315 | SLsmg_write_char(':'); |
| 305 | SLsmg_write_nstring(" ", 8); | 316 | slsmg_write_nstring(" ", 8); |
| 306 | if (!*self->line) | 317 | if (!*self->line) |
| 307 | SLsmg_write_nstring(" ", width - 18); | 318 | slsmg_write_nstring(" ", width - 18); |
| 308 | else | 319 | else |
| 309 | SLsmg_write_nstring(self->line, width - 18); | 320 | slsmg_write_nstring(self->line, width - 18); |
| 310 | 321 | ||
| 311 | return 0; | 322 | return 0; |
| 312 | } | 323 | } |
| @@ -1054,11 +1065,11 @@ void setup_browser(void) | |||
| 1054 | newtInit(); | 1065 | newtInit(); |
| 1055 | newtCls(); | 1066 | newtCls(); |
| 1056 | ui_helpline__puts(" "); | 1067 | ui_helpline__puts(" "); |
| 1057 | SLtt_set_color(HE_COLORSET_TOP, NULL, c->topColorFg, c->topColorBg); | 1068 | sltt_set_color(HE_COLORSET_TOP, NULL, c->topColorFg, c->topColorBg); |
| 1058 | SLtt_set_color(HE_COLORSET_MEDIUM, NULL, c->mediumColorFg, c->mediumColorBg); | 1069 | sltt_set_color(HE_COLORSET_MEDIUM, NULL, c->mediumColorFg, c->mediumColorBg); |
| 1059 | SLtt_set_color(HE_COLORSET_NORMAL, NULL, c->normalColorFg, c->normalColorBg); | 1070 | sltt_set_color(HE_COLORSET_NORMAL, NULL, c->normalColorFg, c->normalColorBg); |
| 1060 | SLtt_set_color(HE_COLORSET_SELECTED, NULL, c->selColorFg, c->selColorBg); | 1071 | sltt_set_color(HE_COLORSET_SELECTED, NULL, c->selColorFg, c->selColorBg); |
| 1061 | SLtt_set_color(HE_COLORSET_CODE, NULL, c->codeColorFg, c->codeColorBg); | 1072 | sltt_set_color(HE_COLORSET_CODE, NULL, c->codeColorFg, c->codeColorBg); |
| 1062 | } | 1073 | } |
| 1063 | 1074 | ||
| 1064 | void exit_browser(bool wait_for_ok) | 1075 | void exit_browser(bool wait_for_ok) |
