Wireshark-dev: Re: [Wireshark-dev] Bug 8416 - remove C++ incompatibilities from packet-pw-atm.c
From: Ed Beroset <beroset@xxxxxxxxxxxxxx>
Date: Fri, 1 Mar 2013 02:39:24 +0000 (GMT+00:00)
Jaap Keuter <jaap.keuter@xxxxxxxxx>

>
>What I would like to see is the abolishment of the pwc_packet_properties_t type
>altogether. This is _not_ an enum.

I agree, and have come across another such "enum abuse" instance that may be harder to address. Specifically, in the header file gmessages.h there is a similar typedef enum called GLogLevelFlags which is also intended to provide names for bitflags rather than actually enumerate.  This construct is used a number of places in the Wireshark code (such as line 3169 of plugins/asn1/packet-asn1.c).  Adding a cast quiets the compiler, but is there a better way that doesn't require rewriting glib-2.0?

	mylogh = g_log_set_handler (NULL, GLogLevelFlags(G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL
						    | G_LOG_FLAG_RECURSION), my_log_handler, NULL);

Ed