lkml.org 
[lkml]   [2014]   [Dec]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] tools: perf: util: color.c: Remove some unused functions
Em Mon, Dec 22, 2014 at 12:05:12PM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Mon, Dec 22, 2014 at 03:56:10PM +0100, Jiri Olsa escreveu:
> > On Sat, Dec 20, 2014 at 01:51:05PM +0100, Rickard Strandqvist wrote:
> > > Removes some functions that are not used anywhere:
> > > color_parse_mem() color_parse()
> > >
> > > This was partially found by using a static code analysis program called cppcheck.
> >
> > and partially removed ;-)
> >
> > [jolsa@krava perf]$ make
> > BUILD: Doing 'make -j4' parallel build
> > CC util/debug.o
> > CC util/color.o
> > CC util/machine.o
> > CC util/map.o
> > util/color.c:8:12: error: ‘parse_color’ defined but not used [-Werror=unused-function]
> > static int parse_color(const char *name, int len)
> > ^
> > util/color.c:28:12: error: ‘parse_attr’ defined but not used [-Werror=unused-function]
> > static int parse_attr(const char *name, int len)
> > ^
> > cc1: all warnings being treated as errors
> > make[1]: *** [util/color.o] Error 1
> > make[1]: *** Waiting for unfinished jobs....
> > make: *** [all] Error 2
> >
> >
> > any clue why this (color name parsing) is in?
>
> Humm, there is support for changing the TUI colors in ~/.perfconfig, but
> probably it doesn't uses those functions?

void ui_browser__init(void)
{
int i = 0;

perf_config(ui_browser__color_config, NULL);

while (ui_browser__colorsets[i].name) {
struct ui_browser_colorset *c = &ui_browser__colorsets[i++];
sltt_set_color(c->colorset, c->name, c->fg, c->bg);
}

annotate_browser__init();
}

And ui_browser__color_config does really simple parsing, using straight
away the color strings provided in the config file.

Looking again, we could even use those, after adapting it to what
libslang expects, not what ncurses do, but I haven't checked, perhaps
libslang will do that validation for us, in the meantime, I'm applying
the patch.

- Arnaldo


\
 
 \ /
  Last update: 2014-12-22 16:21    [W:0.040 / U:0.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site