diff options
author | Bill Meier <wmeier@newsguy.com> | 2013-12-20 15:34:05 +0000 |
---|---|---|
committer | Bill Meier <wmeier@newsguy.com> | 2013-12-20 15:34:05 +0000 |
commit | ccdb11e1774ac8ef83056f307e311801669f6a27 (patch) | |
tree | 6fea050ecfe22e8e88e8251d59500a6760214bf9 /ui | |
parent | 82112c8ea39b2aba09bd4470a4cad920f3318fd8 (diff) | |
download | wireshark-ccdb11e1774ac8ef83056f307e311801669f6a27.tar.gz wireshark-ccdb11e1774ac8ef83056f307e311801669f6a27.tar.bz2 wireshark-ccdb11e1774ac8ef83056f307e311801669f6a27.zip |
nnn'ULL' ==> G_GUINT64_CONSTANT(nnn)
svn path=/trunk/; revision=54304
Diffstat (limited to 'ui')
-rw-r--r-- | ui/cli/tap-iostat.c | 55 |
1 files changed, 29 insertions, 26 deletions
diff --git a/ui/cli/tap-iostat.c b/ui/cli/tap-iostat.c index e5de1f82ad..224351aaea 100644 --- a/ui/cli/tap-iostat.c +++ b/ui/cli/tap-iostat.c @@ -92,7 +92,7 @@ typedef struct _io_stat_item_t { gdouble double_counter; } io_stat_item_t; -#define NANOSECS_PER_SEC 1000000000ULL +#define NANOSECS_PER_SEC G_GUINT64_CONSTANT(1000000000) static guint64 last_relative_time; @@ -114,7 +114,7 @@ iostat_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt, const void *du /* If this frame's relative time is negative, set its relative time to last_relative_time rather than disincluding it from the calculations. */ if (pinfo->rel_ts.secs >= 0) { - relative_time = ((guint64)pinfo->rel_ts.secs * 1000000ULL) + + relative_time = ((guint64)pinfo->rel_ts.secs * G_GUINT64_CONSTANT(1000000)) + ((guint64)((pinfo->rel_ts.nsecs+500)/1000)); last_relative_time = relative_time; } else { @@ -411,7 +411,7 @@ iostat_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt, const void *du io_stat_item_t *pit; new_time = (nstime_t *)fvalue_get(&((field_info *)gp->pdata[i])->value); - val = ((guint64)new_time->secs*1000000ULL) + (guint64)(new_time->nsecs/1000); + val = ((guint64)new_time->secs*G_GUINT64_CONSTANT(1000000)) + (guint64)(new_time->nsecs/1000); tival = (int)(val % parent->interval); it->counter += tival; val -= tival; @@ -488,7 +488,7 @@ iostat_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt, const void *du break; case FT_RELATIVE_TIME: parent->max_vals[it->colnum] = - MAX(parent->max_vals[it->colnum], ((it->counter/(guint64)it->num) + 500000000ULL) / NANOSECS_PER_SEC); + MAX(parent->max_vals[it->colnum], ((it->counter/(guint64)it->num) + G_GUINT64_CONSTANT(500000000)) / NANOSECS_PER_SEC); break; default: /* UINT16-64 and INT8-64 */ @@ -565,7 +565,7 @@ iostat_draw(void *arg) num_cols = iot->num_cols; col_w = (column_width *)g_malloc(sizeof(column_width) * num_cols); fmts = (char **)g_malloc(sizeof(char *) * num_cols); - duration = ((guint64)cfile.elapsed_time.secs * 1000000ULL) + + duration = ((guint64)cfile.elapsed_time.secs * G_GUINT64_CONSTANT(1000000)) + (guint64)((cfile.elapsed_time.nsecs + 500) / 1000); /* Store the pointer to each stat column */ @@ -583,15 +583,15 @@ iostat_draw(void *arg) } /* Calc the capture duration's magnitude (dur_mag) */ - dur_secs = (int)(duration/1000000ULL); + dur_secs = (int)(duration/G_GUINT64_CONSTANT(1000000)); dur_secs_orig = dur_secs; - dur_nsecs = (int)(duration%1000000ULL); + dur_nsecs = (int)(duration%G_GUINT64_CONSTANT(1000000)); dur_nsecs_orig = dur_nsecs; dur_mag = magnitude((guint64)dur_secs, 5); g_snprintf(dur_mag_s, 3, "%u", dur_mag); /* Calc the interval's magnitude */ - invl_mag = magnitude(interval/1000000ULL, 5); + invl_mag = magnitude(interval/G_GUINT64_CONSTANT(1000000), 5); /* Set or get the interval precision */ if (interval==duration) { @@ -618,8 +618,8 @@ iostat_draw(void *arg) if ((duration%dv) > 5*(dv/10)) { duration += 5*(dv/10); duration = (duration/dv) * dv; - dur_secs = (int)(duration/1000000ULL); - dur_nsecs = (int)(duration%1000000ULL); + dur_secs = (int)(duration/G_GUINT64_CONSTANT(1000000)); + dur_nsecs = (int)(duration%G_GUINT64_CONSTANT(1000000)); /* * Recalc dur_mag in case rounding has increased its magnitude */ dur_mag = magnitude((guint64)dur_secs, 5); @@ -798,7 +798,7 @@ iostat_draw(void *arg) g_free(full_fmt); full_fmt = g_strconcat("| Interval: ", invl_fmt, " secs%s|\n", NULL); spaces_s = &spaces[18 + dur_mag]; - printf(full_fmt, (guint32)(interval/1000000ULL), spaces_s); + printf(full_fmt, (guint32)(interval/G_GUINT64_CONSTANT(1000000)), spaces_s); } else { g_snprintf(invl_prec_s, 3, "%u", invl_prec); invl_fmt = g_strconcat("%", dur_mag_s, "u.%0", invl_prec_s, "u", NULL); @@ -809,8 +809,8 @@ iostat_draw(void *arg) full_fmt = g_strconcat("| Interval: ", invl_fmt, " secs%s|\n", NULL); spaces_s = &spaces[19 + dur_mag + invl_prec]; - printf(full_fmt, (guint32)(interval/1000000ULL), - (guint32)((interval%1000000ULL)/dv), spaces_s); + printf(full_fmt, (guint32)(interval/G_GUINT64_CONSTANT(1000000)), + (guint32)((interval%G_GUINT64_CONSTANT(1000000))/dv), spaces_s); } g_free(full_fmt); @@ -986,7 +986,7 @@ iostat_draw(void *arg) /* Patch for Absolute Time */ /* XXX - has a Y2.038K problem with 32-bit time_t */ - the_time = (time_t)(iot->start_time + (t/1000000ULL)); + the_time = (time_t)(iot->start_time + (t/G_GUINT64_CONSTANT(1000000))); /* Display the interval for this row */ switch (timestamp_get_type()) { @@ -1062,13 +1062,13 @@ iostat_draw(void *arg) printf(full_fmt, (guint32)(t/1000000ULL), "Dur"); } else { printf(full_fmt, (guint32)(t/1000000ULL), - (guint32)(invl_end/1000000ULL)); + (guint32)(invl_end/G_GUINT64_CONSTANT(1000000))); } } else { - printf(full_fmt, (guint32)(t/1000000ULL), - (guint32)(t%1000000ULL / dv), - (guint32)(invl_end/1000000ULL), - (guint32)(invl_end%1000000ULL / dv)); + printf(full_fmt, (guint32)(t/G_GUINT64_CONSTANT(1000000)), + (guint32)(t%G_GUINT64_CONSTANT(1000000) / dv), + (guint32)(invl_end/G_GUINT64_CONSTANT(1000000)), + (guint32)(invl_end%G_GUINT64_CONSTANT(1000000) / dv)); } break; /* case TS_DELTA: @@ -1109,8 +1109,10 @@ iostat_draw(void *arg) printf(fmt, item->double_counter); break; case FT_RELATIVE_TIME: - item->counter = (item->counter + 500ULL) / 1000ULL; - printf(fmt, (int)(item->counter/1000000ULL), (int)(item->counter%1000000ULL)); + item->counter = (item->counter + G_GUINT64_CONSTANT(500)) / G_GUINT64_CONSTANT(1000); + printf(fmt, + (int)(item->counter/G_GUINT64_CONSTANT(1000000)), + (int)(item->counter%G_GUINT64_CONSTANT(1000000))); break; default: printf(fmt, item->counter); @@ -1131,9 +1133,10 @@ iostat_draw(void *arg) printf(fmt, item->double_counter/num); break; case FT_RELATIVE_TIME: - item->counter = ((item->counter / (guint64)num) + 500ULL) / 1000ULL; + item->counter = ((item->counter / (guint64)num) + G_GUINT64_CONSTANT(500)) / G_GUINT64_CONSTANT(1000); printf(fmt, - (int)(item->counter/1000000ULL), (int)(item->counter%1000000ULL)); + (int)(item->counter/G_GUINT64_CONSTANT(1000000)), + (int)(item->counter%G_GUINT64_CONSTANT(1000000))); break; default: printf(fmt, item->counter / (guint64)num); @@ -1148,11 +1151,11 @@ iostat_draw(void *arg) if (!last_row) { printf(fmt, (int) (item->counter/interval), - (int)((item->counter%interval)*1000000ULL / interval)); + (int)((item->counter%interval)*G_GUINT64_CONSTANT(1000000) / interval)); } else { printf(fmt, - (int) (item->counter/(invl_end-t)), - (int)((item->counter%(invl_end-t))*1000000ULL / (invl_end-t))); + (int) (item->counter/(invl_end-t)), + (int)((item->counter%(invl_end-t))*G_GUINT64_CONSTANT(1000000) / (invl_end-t))); } break; } |