aboutsummaryrefslogtreecommitdiffstats
path: root/ui/gtk/rlc_lte_graph.c
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2015-09-27 15:41:25 +0200
committerMartin Mathieson <martin.r.mathieson@googlemail.com>2015-09-27 17:09:19 +0000
commit47eb321c5d306c8561c13bba067f66e900ec5bb8 (patch)
tree3d6dcaed80e20e5cd2a13c9b66ecc058b43f9850 /ui/gtk/rlc_lte_graph.c
parent6d10efc6dd66c70110581b8c49cc3da0f0a72a25 (diff)
ui/gtk: fix weird check for axis orientation
There is only one meaning for the flags parameter, namely axis orientation (x or y). Replace the bitmap by a bool instead. Clang 3.7.0 reported this warning: ui/gtk/tcp_graph.c:1652:29: warning: shifting a negative signed value is undefined [-Wshift-negative-value] g->y_axis->flags &= ~AXIS_ORIENTATION; ~^~~~~~~~~~~~~~~~ ui/gtk/tcp_graph.c:140:28: note: expanded from macro 'AXIS_ORIENTATION' #define AXIS_ORIENTATION 1 << 0 ^ 1 warning generated. This (~1 << 0) happened to work because nothing is actually shifted. Change-Id: I406235148b7826649d35647f5d0702cd72a925a5 Reviewed-on: https://code.wireshark.org/review/10658 Reviewed-by: Peter Wu <peter@lekensteyn.nl> Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
Diffstat (limited to 'ui/gtk/rlc_lte_graph.c')
-rw-r--r--ui/gtk/rlc_lte_graph.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/ui/gtk/rlc_lte_graph.c b/ui/gtk/rlc_lte_graph.c
index 4f9d2c16b1..b318800bb7 100644
--- a/ui/gtk/rlc_lte_graph.c
+++ b/ui/gtk/rlc_lte_graph.c
@@ -142,8 +142,7 @@ struct axis {
#endif
/* Which of the 2 buffers we are currently showing */
int displayed;
-#define AXIS_ORIENTATION 1 << 0
- int flags;
+ gboolean is_horizontal_axis;
/* dim and orig (relative to origin of window) of axis' pixmap */
struct irect p;
/* dim and orig (relative to origin of axis' pixmap) of scale itself */
@@ -620,16 +619,14 @@ static struct graph *graph_new(void)
g->y_axis = (struct axis * )g_malloc0(sizeof(struct axis));
g->x_axis->g = g;
- g->x_axis->flags = 0;
- g->x_axis->flags |= AXIS_ORIENTATION;
+ g->x_axis->is_horizontal_axis = TRUE;
g->x_axis->s.x = g->x_axis->s.y = 0;
g->x_axis->s.height = HAXIS_INIT_HEIGHT;
g->x_axis->p.x = VAXIS_INIT_WIDTH;
g->x_axis->p.height = HAXIS_INIT_HEIGHT;
g->y_axis->g = g;
- g->y_axis->flags = 0;
- g->y_axis->flags &= ~AXIS_ORIENTATION;
+ g->y_axis->is_horizontal_axis = FALSE;
g->y_axis->p.x = g->y_axis->p.y = 0;
g->y_axis->p.width = VAXIS_INIT_WIDTH;
g->y_axis->s.x = 0;
@@ -1367,7 +1364,7 @@ static void axis_destroy(struct axis *axis)
static void axis_display(struct axis *axis)
{
- if (axis->flags & AXIS_ORIENTATION)
+ if (axis->is_horizontal_axis)
h_axis_pixmap_draw(axis);
else
v_axis_pixmap_draw(axis);