From 71d73fe818b1cd25ca6b181c450c404d43ad4abe Mon Sep 17 00:00:00 2001 From: Gabriel Ganne Date: Sat, 4 Feb 2017 10:51:04 +0100 Subject: fix some 'stored but never read' warnings raised by clang found by `scan-build make plugins-release` Signed-off-by: Gabriel Ganne Change-Id: I52048e3a8ae3fb85eb3d91f6a5e15216dd7b9baa --- src/vlib/error_funcs.h | 8 +++++--- src/vlib/node_funcs.h | 5 ++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/vlib/error_funcs.h b/src/vlib/error_funcs.h index 1a3602e9..ab281ba2 100644 --- a/src/vlib/error_funcs.h +++ b/src/vlib/error_funcs.h @@ -45,10 +45,12 @@ always_inline void vlib_error_elog_count (vlib_main_t * vm, uword counter, uword increment) { - elog_main_t *em = &vm->elog_main; if (VLIB_ELOG_MAIN_LOOP > 0 && increment > 0) - elog (em, vec_elt_at_index (vm->error_elog_event_types, counter), - increment); + { + elog_main_t *em = &vm->elog_main; + elog (em, vec_elt_at_index (vm->error_elog_event_types, counter), + increment); + } } always_inline void diff --git a/src/vlib/node_funcs.h b/src/vlib/node_funcs.h index 21167396..f49a8d6f 100644 --- a/src/vlib/node_funcs.h +++ b/src/vlib/node_funcs.h @@ -476,7 +476,7 @@ vlib_process_get_event_data (vlib_main_t * vm, vlib_node_main_t *nm = &vm->node_main; vlib_process_t *p; vlib_process_event_type_t *et; - uword t, l; + uword t; void *event_data_vector; p = vec_elt (nm->processes, nm->current_process_index); @@ -490,8 +490,7 @@ vlib_process_get_event_data (vlib_main_t * vm, p->non_empty_event_type_bitmap = clib_bitmap_andnoti (p->non_empty_event_type_bitmap, t); - l = _vec_len (p->pending_event_data_by_type_index[t]); - ASSERT (l > 0); + ASSERT (_vec_len (p->pending_event_data_by_type_index[t]) > 0); event_data_vector = p->pending_event_data_by_type_index[t]; p->pending_event_data_by_type_index[t] = 0; -- cgit 1.2.3-korg