> Date: Sat, 2 Jan 2016 18:21:07 +0100 > From: Sebastian Benoit <be...@openbsd.org> > > an earlier commit today prompted florian@ to run clang, these fixes are a > result of issues found. > > ok?
sure > [PATCH 1/4] remove unused variable cur. code probably c&p from > print_bar_title(). > > diff --git usr.bin/systat/engine.c usr.bin/systat/engine.c > index 51c0b7f..bc9f6ef 100644 > --- usr.bin/systat/engine.c > +++ usr.bin/systat/engine.c > @@ -361,7 +361,7 @@ print_bar_title(field_def *fld) > void > print_fld_bar(field_def *fld, int value) > { > - int i, tw, val, cur; > + int i, tw, val; > > if (fld->width < 1) > return; > @@ -370,7 +370,7 @@ print_fld_bar(field_def *fld, int value) > tw = fld->arg / 2; > > tb_start(); > - cur = 0; > + > for(i = 0; i < fld->width; i++) { > tw += fld->arg; > > [PATCH 2/4] remove useless assignement to variable change. > > diff --git usr.bin/systat/engine.c usr.bin/systat/engine.c > index bc9f6ef..faefaa0 100644 > --- usr.bin/systat/engine.c > +++ usr.bin/systat/engine.c > @@ -488,7 +488,6 @@ field_setup(void) > width -= fwid; > } > > - change = 0; > while (width > 0) { > change = 0; > for (fp = curr_view->view; *fp != NULL; fp++) { > > [PATCH 3/4] garbage collect unused variable tm > > diff --git usr.bin/systat/cpu.c usr.bin/systat/cpu.c > index 520bb93..8bb5be1 100644 > --- usr.bin/systat/cpu.c > +++ usr.bin/systat/cpu.c > @@ -246,12 +246,10 @@ initcpu(void) > void > print_cpu(void) > { > - time_t tm; > int cur = 0, c, i; > int end = dispstart + maxprint; > int64_t *states; > double value[CPUSTATES]; > - tm = time(NULL); > > if (end > num_disp) > end = num_disp; > > [PATCH 4/4] make sure debug will be initialized, choose "unknown" > because pfctl loglevel_to_string() uses "unknown" as well. > > diff --git usr.bin/systat/pf.c usr.bin/systat/pf.c > index 0833618..58c0d69 100644 > --- usr.bin/systat/pf.c > +++ usr.bin/systat/pf.c > @@ -259,6 +259,9 @@ print_pf(void) > case LOG_DEBUG: > debug = "debug"; > break; > + default: > + debug = "unknown"; > + break; > } > ADD_LINE_S("pf", "Debug", debug); > > >