Commit 34b630f3 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Various Flexelinting

parent bd51f43c
-efile(451, "varnishhist_profiles.h") -efile(451, "varnishhist_profiles.h")
-efile(451, "varnishhist_options.h") -efile(451, "varnishhist_options.h")
-sem(usage, r_no) -sem(usage, r_no)
-sem(profile_error, r_no)
...@@ -63,7 +63,7 @@ static struct VUT *vut; ...@@ -63,7 +63,7 @@ static struct VUT *vut;
static int hist_low; static int hist_low;
static int hist_high; static int hist_high;
static int hist_range; static int hist_range;
static int hist_buckets; static unsigned hist_buckets;
static pthread_mutex_t mtx = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t mtx = PTHREAD_MUTEX_INITIALIZER;
...@@ -143,7 +143,7 @@ update(void) ...@@ -143,7 +143,7 @@ update(void)
unsigned bm[n], bh[n]; unsigned bm[n], bh[n];
unsigned max; unsigned max;
unsigned i, j, scale; unsigned i, j, scale;
int k, l; unsigned k, l;
erase(); erase();
...@@ -161,10 +161,11 @@ update(void) ...@@ -161,10 +161,11 @@ update(void)
mvprintw(0, 0, "%*s", COLS - 1, ident); mvprintw(0, 0, "%*s", COLS - 1, ident);
/* count our flock */ /* count our flock */
for (i = 0; i < n; ++i) memset(bm, 0, sizeof bm);
bm[i] = bh[i] = 0; memset(bh, 0, sizeof bh);
for (k = 0, max = 1; k < hist_buckets; ++k) { for (k = 0, max = 1; k < hist_buckets; ++k) {
l = k * n / hist_buckets; l = k * n / hist_buckets;
assert(l < n);
bm[l] += bucket_miss[k]; bm[l] += bucket_miss[k];
bh[l] += bucket_hit[k]; bh[l] += bucket_hit[k];
if (bm[l] + bh[l] > max) if (bm[l] + bh[l] > max)
...@@ -413,13 +414,13 @@ do_curses(void *arg) ...@@ -413,13 +414,13 @@ do_curses(void *arg)
break; break;
case '\032': /* Ctrl-Z */ case '\032': /* Ctrl-Z */
endwin(); endwin();
raise(SIGTSTP); AZ(raise(SIGTSTP));
break; break;
case '\003': /* Ctrl-C */ case '\003': /* Ctrl-C */
case '\021': /* Ctrl-Q */ case '\021': /* Ctrl-Q */
case 'Q': case 'Q':
case 'q': case 'q':
raise(SIGINT); AZ(raise(SIGINT));
endwin(); endwin();
return (NULL); return (NULL);
case '0': case '0':
...@@ -432,7 +433,7 @@ do_curses(void *arg) ...@@ -432,7 +433,7 @@ do_curses(void *arg)
case '7': case '7':
case '8': case '8':
case '9': case '9':
delay = 1 << (ch - '0'); delay = 1U << (ch - '0');
break; break;
case '+': case '+':
delay /= 2; delay /= 2;
...@@ -483,7 +484,7 @@ usage(int status) ...@@ -483,7 +484,7 @@ usage(int status)
exit(status); exit(status);
} }
static void static void v_noreturn_
profile_error(const char *s) profile_error(const char *s)
{ {
fprintf(stderr, "-P: '%s' is not a valid" fprintf(stderr, "-P: '%s' is not a valid"
...@@ -506,7 +507,7 @@ main(int argc, char **argv) ...@@ -506,7 +507,7 @@ main(int argc, char **argv)
char *colon; char *colon;
const char *ptag, *profile = "responsetime"; const char *ptag, *profile = "responsetime";
pthread_t thr; pthread_t thr;
int fnum = -1; int fnum;
struct profile cli_p = {0}; struct profile cli_p = {0};
vut = VUT_InitProg(argc, argv, &vopt_spec); vut = VUT_InitProg(argc, argv, &vopt_spec);
......
...@@ -582,7 +582,6 @@ vtx_retire(struct VSLQ *vslq, struct vtx **pvtx) ...@@ -582,7 +582,6 @@ vtx_retire(struct VSLQ *vslq, struct vtx **pvtx)
vslq->n_cache++; vslq->n_cache++;
} else { } else {
FREE_OBJ(vtx); FREE_OBJ(vtx);
vtx = NULL;
} }
} }
...@@ -693,7 +692,7 @@ vtx_parse_link(const char *str, enum VSL_transaction_e *ptype, ...@@ -693,7 +692,7 @@ vtx_parse_link(const char *str, enum VSL_transaction_e *ptype,
return (0); return (0);
/* transaction type */ /* transaction type */
for (et = 0; et < VSL_t__MAX; et++) for (et = VSL_t_unknown; et < VSL_t__MAX; et++)
if (!strcmp(type, vsl_t_names[et])) if (!strcmp(type, vsl_t_names[et]))
break; break;
if (et >= VSL_t__MAX) if (et >= VSL_t__MAX)
...@@ -709,7 +708,7 @@ vtx_parse_link(const char *str, enum VSL_transaction_e *ptype, ...@@ -709,7 +708,7 @@ vtx_parse_link(const char *str, enum VSL_transaction_e *ptype,
return (2); return (2);
/* transaction reason */ /* transaction reason */
for (er = 0; er < VSL_r__MAX; er++) for (er = VSL_r_unknown; er < VSL_r__MAX; er++)
if (!strcmp(reason, vsl_r_names[er])) if (!strcmp(reason, vsl_r_names[er]))
break; break;
if (er >= VSL_r__MAX) if (er >= VSL_r__MAX)
......
-efile(451, "tbl_*.h") // No include guard -efile(451, "tbl_*.h") // No include guard
-e784 // Nul character truncated from string
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment