From 5c388384329775538d618681f571d5f052bc2ae6 Mon Sep 17 00:00:00 2001 From: Gerald Combs Date: Tue, 6 Sep 2016 16:57:56 -0700 Subject: [PATCH] Place variable declarations where they're used. Fix ../../ui/io_graph_item.h:251:29: warning: will never be executed [-Wunreachable-code] guint64 t, pt; /* time in us */ ^ Change-Id: I0e861e892c2c03151d9f98e31ac68ce296baa26a Reviewed-on: https://code.wireshark.org/review/17545 Reviewed-by: Gerald Combs Petri-Dish: Gerald Combs Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann --- ui/io_graph_item.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/ui/io_graph_item.h b/ui/io_graph_item.h index d4e51995a8..0b93be1fee 100644 --- a/ui/io_graph_item.h +++ b/ui/io_graph_item.h @@ -248,18 +248,20 @@ update_io_graph_item(io_graph_item_t *items, int idx, packet_info *pinfo, epan_d new_time = (nstime_t *)fvalue_get(&((field_info *)gp->pdata[i])->value); switch (item_unit) { + case IOG_ITEM_UNIT_CALC_LOAD: + { guint64 t, pt; /* time in us */ int j; - case IOG_ITEM_UNIT_CALC_LOAD: /* - * Add the time this call spanned each interval according to its contribution - * to that interval. - */ + * Add the time this call spanned each interval according to its contribution + * to that interval. + */ t = new_time->secs; t = t * 1000000 + new_time->nsecs / 1000; j = idx; /* - * Handle current interval */ + * Handle current interval + */ pt = pinfo->rel_ts.secs * 1000000 + pinfo->rel_ts.nsecs / 1000; pt = pt % (interval * 1000); if (pt > t) { @@ -287,6 +289,7 @@ update_io_graph_item(io_graph_item_t *items, int idx, packet_info *pinfo, epan_d } } break; + } default: if ( (new_time->secs > item->time_max.secs) || ( (new_time->secs == item->time_max.secs)