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 <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
Gerald Combs 2016-09-06 16:57:56 -07:00 committed by Michael Mann
parent facc953504
commit 5c38838432
1 changed files with 8 additions and 5 deletions

View File

@ -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)