Don't rely on G_STMT

svn path=/trunk/; revision=31042
This commit is contained in:
Kovarththanan Rajaratnam 2009-11-21 11:03:14 +00:00
parent 9bbbd6ef0e
commit a2f211d07b
1 changed files with 16 additions and 16 deletions

View File

@ -249,10 +249,10 @@ typedef struct field_info {
#define FI_GET_FLAG(fi, flag) ((fi) ? (fi->flags & flag) : 0)
/** convenience macro to set field_info.flags */
#define FI_SET_FLAG(fi, flag) \
G_STMT_START \
if (fi) \
(fi)->flags = (fi)->flags | (flag); \
G_STMT_END
do { \
if (fi) \
(fi)->flags = (fi)->flags | (flag); \
} while(0)
/** One of these exists for the entire protocol tree. Each proto_node
* in the protocol tree points to the same copy. */
@ -327,28 +327,28 @@ typedef proto_node proto_item;
/** mark this protocol field to be hidden from the protocol tree display (used for filtering only) */
/* HIDING PROTOCOL FIELDS IS DEPRECATED, IT'S CONSIDERED TO BE BAD GUI DESIGN! */
#define PROTO_ITEM_SET_HIDDEN(proto_item) \
G_STMT_START \
if (proto_item) \
FI_SET_FLAG(PITEM_FINFO(proto_item), FI_HIDDEN); \
G_STMT_END
do { \
if (proto_item) \
FI_SET_FLAG(PITEM_FINFO(proto_item), FI_HIDDEN); \
} while(0)
/** is this protocol field generated by Wireshark (and not read from the packet data)? */
#define PROTO_ITEM_IS_GENERATED(proto_item) \
((proto_item) ? FI_GET_FLAG(PITEM_FINFO(proto_item), FI_GENERATED) : 0)
/** mark this protocol field as generated by Wireshark (and not read from the packet data) */
#define PROTO_ITEM_SET_GENERATED(proto_item) \
G_STMT_START \
if (proto_item) \
FI_SET_FLAG(PITEM_FINFO(proto_item), FI_GENERATED); \
G_STMT_END
do { \
if (proto_item) \
FI_SET_FLAG(PITEM_FINFO(proto_item), FI_GENERATED); \
} while(0)
/** is this protocol field actually a URL? */
#define PROTO_ITEM_IS_URL(proto_item) \
((proto_item) ? FI_GET_FLAG(PITEM_FINFO(proto_item), FI_URL) : 0)
/** mark this protocol field as a URL */
#define PROTO_ITEM_SET_URL(proto_item) \
G_STMT_START \
if (proto_item) \
FI_SET_FLAG(PITEM_FINFO(proto_item), FI_URL); \
G_STMT_END
do { \
if (proto_item) \
FI_SET_FLAG(PITEM_FINFO(proto_item), FI_URL); \
} while(0)
typedef void (*proto_tree_foreach_func)(proto_node *, gpointer);
typedef gboolean (*proto_tree_traverse_func)(proto_node *, gpointer);