The convention is to use TFS(...) when specifying a true_false_string with an FT_BOOLEAN field;

Also: use the global true_false_string tfs_yes_no  in place of a static local string.

svn path=/trunk/; revision=28320
This commit is contained in:
Bill Meier 2009-05-08 22:18:14 +00:00
parent f8e4a91659
commit 5aa5576a55
3 changed files with 11 additions and 13 deletions

View File

@ -1111,7 +1111,7 @@ dissect_arp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
void
proto_register_arp(void)
{
static struct true_false_string type_bit = { "E.164", "ATM Forum NSAPA" };
static struct true_false_string tfs_type_bit = { "E.164", "ATM Forum NSAPA" };
static hf_register_info hf[] = {
{ &hf_arp_hard_type,
@ -1131,7 +1131,7 @@ proto_register_arp(void)
{ &hf_atmarp_sht,
{ "Sender ATM number type", "arp.src.htype",
FT_BOOLEAN, 8, &type_bit, ATMARP_IS_E164,
FT_BOOLEAN, 8, TFS(&tfs_type_bit), ATMARP_IS_E164,
"", HFILL }},
{ &hf_atmarp_shl,
@ -1141,7 +1141,7 @@ proto_register_arp(void)
{ &hf_atmarp_sst,
{ "Sender ATM subaddress type", "arp.src.stype",
FT_BOOLEAN, 8, &type_bit, ATMARP_IS_E164,
FT_BOOLEAN, 8, TFS(&tfs_type_bit), ATMARP_IS_E164,
"", HFILL }},
{ &hf_atmarp_ssl,
@ -1166,7 +1166,7 @@ proto_register_arp(void)
{ &hf_atmarp_tht,
{ "Target ATM number type", "arp.dst.htype",
FT_BOOLEAN, 8, &type_bit, ATMARP_IS_E164,
FT_BOOLEAN, 8, TFS(&tfs_type_bit), ATMARP_IS_E164,
"", HFILL }},
{ &hf_atmarp_thl,
@ -1176,7 +1176,7 @@ proto_register_arp(void)
{ &hf_atmarp_tst,
{ "Target ATM subaddress type", "arp.dst.stype",
FT_BOOLEAN, 8, &type_bit, ATMARP_IS_E164,
FT_BOOLEAN, 8, TFS(&tfs_type_bit), ATMARP_IS_E164,
"", HFILL }},
{ &hf_atmarp_tsl,

View File

@ -3357,13 +3357,13 @@ proto_register_q931(void)
"True if the interface identifier is explicit in the following octets", HFILL }},
{ &hf_q931_channel_interface_type,
{ "Interface type", "q931.channel.interface_type", FT_BOOLEAN, 8, &tfs_interface_type, 0x20,
{ "Interface type", "q931.channel.interface_type", FT_BOOLEAN, 8, TFS(&tfs_interface_type), 0x20,
"Identifies the ISDN interface type", HFILL }},
/* 0x10 is spare */
{ &hf_q931_channel_exclusive,
{ "Indicated channel", "q931.channel.exclusive", FT_BOOLEAN, 8, &tfs_channel_exclusive, 0x08,
{ "Indicated channel", "q931.channel.exclusive", FT_BOOLEAN, 8, TFS(&tfs_channel_exclusive), 0x08,
"True if only the indicated channel is acceptable", HFILL }},
{ &hf_q931_channel_dchan,
@ -3379,7 +3379,7 @@ proto_register_q931(void)
"Identifies the information channel to be used", HFILL }},
{ &hf_q931_channel_map,
{ "Number/map", "q931.channel.map", FT_BOOLEAN, 8, &tfs_channel_map, 0x10,
{ "Number/map", "q931.channel.map", FT_BOOLEAN, 8, TFS(&tfs_channel_map), 0x10,
"True if channel is indicates by channel map rather than number", HFILL }},
{ &hf_q931_channel_element_type,

View File

@ -80,8 +80,6 @@ static gboolean rpc_dissect_unknown_programs = FALSE;
*/
static gboolean rpc_find_fragment_start = FALSE;
static struct true_false_string yesno = { "Yes", "No" };
static int rpc_tap = -1;
static const value_string rpc_msg_type[] = {
@ -3576,7 +3574,7 @@ proto_register_rpc(void)
NULL, 0, "Reply Frame", HFILL }},
{ &hf_rpc_lastfrag, {
"Last Fragment", "rpc.lastfrag", FT_BOOLEAN, 32,
&yesno, RPC_RM_LASTFRAG, "Last Fragment", HFILL }},
TFS(&tfs_yes_no), RPC_RM_LASTFRAG, "Last Fragment", HFILL }},
{ &hf_rpc_fraglen, {
"Fragment Length", "rpc.fraglen", FT_UINT32, BASE_DEC,
NULL, RPC_RM_FRAGLEN, "Fragment Length", HFILL }},
@ -3682,7 +3680,7 @@ proto_register_rpc(void)
HFILL }},
{ &hf_rpc_authgssapi_msg, {
"AUTH_GSSAPI Message", "rpc.authgssapi.message",
FT_BOOLEAN, BASE_NONE, &yesno, 0, "AUTH_GSSAPI Message",
FT_BOOLEAN, BASE_NONE, TFS(&tfs_yes_no), 0, "AUTH_GSSAPI Message",
HFILL }},
{ &hf_rpc_authgssapi_msgv, {
"Msg Version", "rpc.authgssapi.msgversion",
@ -3732,7 +3730,7 @@ proto_register_rpc(void)
NULL, 0, "This is a duplicate to the reply in frame", HFILL }},
{ &hf_rpc_value_follows, {
"Value Follows", "rpc.value_follows", FT_BOOLEAN, BASE_NONE,
&yesno, 0, "Value Follows", HFILL }},
TFS(&tfs_yes_no), 0, "Value Follows", HFILL }},
{ &hf_rpc_array_len, {
"num", "rpc.array.len", FT_UINT32, BASE_DEC,
NULL, 0, "Length of RPC array", HFILL }},