diff options
author | Guy Harris <guy@alum.mit.edu> | 2014-07-01 03:02:47 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2014-07-01 10:03:20 +0000 |
commit | deeb1de24c7d3b47306765529b76a02d7a4842c9 (patch) | |
tree | 6bb69c0e1ca5ad1ac1e6a5605013e6d168144bd1 /ui/gtk/io_stat.c | |
parent | f90bf8ae2a38c12792e250791b724a8b3644cacc (diff) | |
download | wireshark-deeb1de24c7d3b47306765529b76a02d7a4842c9.tar.gz |
Squelch some warnings.
Make some arguments and structure members gsize, as that's what stored
into them or passed to them. (And move a newly-widened-on-LP64 item, to
avoid extra structure padding.)
Add a cast, which also appears necessary to squelch a warning.
Clean up indentation while we're at it.
Change-Id: I0cc92e7d2904c5af1f3f3d93f51b6ecb3aed464d
Reviewed-on: https://code.wireshark.org/review/2741
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'ui/gtk/io_stat.c')
-rw-r--r-- | ui/gtk/io_stat.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ui/gtk/io_stat.c b/ui/gtk/io_stat.c index fe911c6942..646c276c85 100644 --- a/ui/gtk/io_stat.c +++ b/ui/gtk/io_stat.c @@ -168,12 +168,12 @@ typedef struct _io_stat_graph_t { typedef struct _io_stat_t { + gsize space_items; /* space for items allocated */ gboolean needs_redraw; guint32 interval; /* measurement interval in ms */ guint32 last_interval; /* the last *displayed* interval */ guint32 max_interval; /* the maximum interval based on the capture duration */ guint32 num_items; /* total number of items in all intervals (zero relative) */ - guint32 space_items; /* space for items allocated */ guint32 left_x_border; guint32 right_x_border; gboolean view_as_time; @@ -272,12 +272,12 @@ tap_iostat_packet(void *g, packet_info *pinfo, epan_dissect_t *edt, const void * /* reallocate graphs */ static const gsize exp_inc_limit = 1000000; static const gsize step = 100000; - const gsize new_size = (idx < exp_inc_limit)?exp2(log2(idx + 1) + 1):(idx + step); + const gsize new_size = (gsize)((idx < exp_inc_limit)?exp2(log2(idx + 1) + 1):(idx + step)); if (io->space_items == 0) { /* nothing allocated yet */ int i; for (i = 0; i < MAX_GRAPHS; i++) { - io->graphs[i].items = (io_graph_item_t *)g_malloc(sizeof(io->graphs[i].items[0]) * new_size); + io->graphs[i].items = (io_graph_item_t *)g_malloc(sizeof(io->graphs[i].items[0]) * new_size); reset_io_graph_items(io->graphs[i].items, new_size); } } else { |