From 929f70ac0b14506508e6de9dc357608b91667120 Mon Sep 17 00:00:00 2001 From: gram Date: Sun, 12 Mar 2000 04:48:32 +0000 Subject: Break proto_tree_add_item_format() into multiple functions: proto_tree_add_protocol_format() proto_tree_add_uint_format() proto_tree_add_ipxnet_format() proto_tree_add_ipv4_format() proto_tree_add_ipv6_format() proto_tree_add_bytes_format() proto_tree_add_string_format() proto_tree_add_ether_format() proto_tree_add_time_format() proto_tree_add_double_format() proto_tree_add_boolean_format() If using GCC 2.x, we can check the print-format against the variable args passed in. Regardless of compiler, we can now check at run-time that the field type passed into the function corresponds to what that function expects (FT_UINT, FT_BOOLEAN, etc.) Note that proto_tree_add_protocol_format() does not require a value field, since the value of a protocol is always NULL. It's more intuitive w/o the vestigial argument. Fixed a proto_tree_add_item_format-related bug in packet-isis-hello.c Fixed a variable usage bug in packet-v120.c. (ett_* was used instead of hf_*) Checked in Guy's fix for the function declearation for proto_tree_add_text() and proto_tree_add_notext(). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1713 f5534014-38df-0310-8fa8-9805f1628bb7 --- packet-atalk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'packet-atalk.c') diff --git a/packet-atalk.c b/packet-atalk.c index 51b8d7d2b5..824d5f68e9 100644 --- a/packet-atalk.c +++ b/packet-atalk.c @@ -1,7 +1,7 @@ /* packet-atalk.c * Routines for Appletalk packet disassembly (DDP, currently). * - * $Id: packet-atalk.c,v 1.30 1999/12/09 17:06:37 nneul Exp $ + * $Id: packet-atalk.c,v 1.31 2000/03/12 04:47:35 gram Exp $ * * Simon Wilkinson * @@ -313,7 +313,7 @@ dissect_nbp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { ti = proto_tree_add_item(tree, proto_nbp, offset, END_OF_FRAME, NULL); nbp_tree = proto_item_add_subtree(ti, ett_nbp); - info_item = proto_tree_add_item_format(nbp_tree, hf_nbp_info, offset, 1, + info_item = proto_tree_add_uint_format(nbp_tree, hf_nbp_info, offset, 1, pd[offset], "Info: 0x%01X Operation: %s Count: %d", pd[offset], val_to_str(op, nbp_op_vals, "unknown"), -- cgit v1.2.3