aboutsummaryrefslogtreecommitdiffstats
path: root/packet-x11.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2002-04-14 21:44:48 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2002-04-14 21:44:48 +0000
commit28390dea1002c3231a7feaaf62aff12d18edd279 (patch)
treeb6adec95c69e6df0807547f4f5ec3b03e08a161e /packet-x11.c
parent9b8de508d4c9c9c12542b7b672779fd72c6f8a3e (diff)
Display Boolean bitfields regardless of whether they're set or clear, so
you can see not only what flags are set, but also what flags aren't set. Don't show reserved bits unless they're set, though. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5157 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-x11.c')
-rw-r--r--packet-x11.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/packet-x11.c b/packet-x11.c
index 0cf8c0cb48..8f2629b7db 100644
--- a/packet-x11.c
+++ b/packet-x11.c
@@ -2,7 +2,7 @@
* Routines for X11 dissection
* Copyright 2000, Christophe Tronche <ch.tronche@computer.org>
*
- * $Id: packet-x11.c,v 1.34 2002/04/13 20:16:09 guy Exp $
+ * $Id: packet-x11.c,v 1.35 2002/04/14 21:44:48 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -643,6 +643,9 @@ static struct maskStruct {
}
#define FLAG(position, name) {\
+ proto_tree_add_boolean(lastMask._tree, hf_x11_##position##_mask##_##name, tvb, lastMask._offset, lastMask._zone, lastMask._value); }
+
+#define FLAG_IF_NONZERO(position, name) {\
if (lastMask._value & proto_registrar_get_nth(hf_x11_##position##_mask##_##name) -> bitmask)\
proto_tree_add_boolean(lastMask._tree, hf_x11_##position##_mask##_##name, tvb, lastMask._offset, lastMask._zone, lastMask._value); }
@@ -1425,7 +1428,7 @@ static void setOfEvent(tvbuff_t *tvb, int *offsetp, proto_tree *t)
FLAG(event, PropertyChange);
FLAG(event, ColormapChange);
FLAG(event, OwnerGrabButton);
- FLAG(event, erroneous_bits);
+ FLAG_IF_NONZERO(event, erroneous_bits);
lastMask = save;
}
@@ -1444,7 +1447,7 @@ static void setOfDeviceEvent(tvbuff_t *tvb, int *offsetp, proto_tree *t)
FLAG(do_not_propagate, Button4Motion);
FLAG(do_not_propagate, Button5Motion);
FLAG(do_not_propagate, ButtonMotion);
- FLAG(do_not_propagate, erroneous_bits);
+ FLAG_IF_NONZERO(do_not_propagate, erroneous_bits);
lastMask = save;
}
@@ -1471,7 +1474,7 @@ static void setOfKeyMask(tvbuff_t *tvb, int *offsetp, proto_tree *t)
FLAG(modifiers, Mod3);
FLAG(modifiers, Mod4);
FLAG(modifiers, Mod5);
- FLAG(modifiers, erroneous_bits);
+ FLAG_IF_NONZERO(modifiers, erroneous_bits);
}
lastMask = save;
*offsetp += 2;
@@ -1494,7 +1497,7 @@ static void setOfPointerEvent(tvbuff_t *tvb, int *offsetp, proto_tree *t)
FLAG(pointer_event, Button5Motion);
FLAG(pointer_event, ButtonMotion);
FLAG(pointer_event, KeymapState);
- FLAG(pointer_event, erroneous_bits);
+ FLAG_IF_NONZERO(pointer_event, erroneous_bits);
lastMask = save;
}