Fix some of the Errors/warnings detected by checkapi.
authorwmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 15 May 2008 12:08:20 +0000 (12:08 +0000)
committerwmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 15 May 2008 12:08:20 +0000 (12:08 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@25306 f5534014-38df-0310-8fa8-9805f1628bb7

epan/dissectors/packet-mpls-echo.c
epan/dissectors/packet-mq.c
epan/dissectors/packet-mtp3.c

index 4643cedbe4d844ab89f0ecf5aaf723da283d6895..b8a0c82d0db211b74ef2d772b203ffb3ce48ae44 100644 (file)
@@ -309,6 +309,7 @@ static void
 dissect_mpls_echo_tlv_fec(tvbuff_t *tvb, guint offset, proto_tree *tree, int rem)
 {
         proto_tree *ti = NULL, *tlv_fec_tree = NULL;
+        proto_item *hidden_item;
         guint16 index = 1, nil_index = 1, type, saved_type;
         int length, nil_length, pad;
         guint32 label;
@@ -377,8 +378,9 @@ dissect_mpls_echo_tlv_fec(tvbuff_t *tvb, guint offset, proto_tree *tree, int rem
                proto_tree_add_text(tlv_fec_tree, tvb, offset + 12, 4,
                    "Extended Tunnel ID: 0x%08X (%s)", tvb_get_ntohl(tvb, offset + 12),
                    ip_to_str(tvb_get_ptr(tvb, offset + 12, 4)));
-               proto_tree_add_item_hidden(tlv_fec_tree, hf_mpls_echo_tlv_fec_rsvp_ipv4_ext_tunnel_id,
+               hidden_item = proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_rsvp_ipv4_ext_tunnel_id,
                    tvb, offset + 12, 4, FALSE);
+               PROTO_ITEM_SET_HIDDEN(hidden_item);
                proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_rsvp_ipv4_ipv4_sender,
                    tvb, offset + 16, 4, FALSE);
                proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_rsvp_ip_mbz2,
@@ -402,8 +404,9 @@ dissect_mpls_echo_tlv_fec(tvbuff_t *tvb, guint offset, proto_tree *tree, int rem
                     "Extended Tunnel ID: 0x%s (%s)",
                    tvb_bytes_to_str(tvb, offset + 24, 16),
                     ip6_to_str((const struct e_in6_addr *)tvb_get_ptr(tvb, offset + 24, 16)));
-                proto_tree_add_item_hidden(tlv_fec_tree, hf_mpls_echo_tlv_fec_rsvp_ipv6_ext_tunnel_id,
+                hidden_item = proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_rsvp_ipv6_ext_tunnel_id,
                     tvb, offset + 24, 16, FALSE);
+               PROTO_ITEM_SET_HIDDEN(hidden_item);
                 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_rsvp_ipv6_ipv6_sender,
                     tvb, offset + 40, 16, FALSE);
                 proto_tree_add_item(tlv_fec_tree, hf_mpls_echo_tlv_fec_rsvp_ip_mbz2,
index 545d6c49fafa1aafcd8d9a42e3f448dd2b462dc8..9c86285bfccddc8a47a55a11fc51aa50ea750af9 100644 (file)
@@ -2248,7 +2248,9 @@ dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                                                                        }
                                                                        if (tree)
                                                                        {
-                                                                               proto_tree_add_string_hidden(tree, hf_mq_md_hidden_lastformat, tvb, tMsgProps.iOffsetFormat, 8, (const char*)sFormat);
+                                                                               proto_item *hidden_item;
+                                                                               hidden_item = proto_tree_add_string(tree, hf_mq_md_hidden_lastformat, tvb, tMsgProps.iOffsetFormat, 8, (const char*)sFormat);
+                                                                               PROTO_ITEM_SET_HIDDEN(hidden_item);
                                                                        }
                                                        }
                                                        if (check_col(pinfo->cinfo, COL_INFO))
index 4c23a28d22f958a5cdf123927b3d51e9bac59f3f..57a599b46de84f8c5688dc513a12e684c2a27d50 100644 (file)
@@ -400,7 +400,7 @@ dissect_mtp3_3byte_pc(tvbuff_t *tvb, guint offset, proto_tree *tree, gint ett_pc
                      int hf_pc_cluster, int hf_pc_member, int hf_dpc, int hf_pc)
 {
     guint32 pc;
-    proto_item *pc_item;
+    proto_item *pc_item, *hidden_item;
     proto_tree *pc_tree;
     char pc_string[MAX_STRUCTURED_PC_LENGTH];
 
@@ -415,10 +415,12 @@ dissect_mtp3_3byte_pc(tvbuff_t *tvb, guint offset, proto_tree *tree, gint ett_pc
      */
     g_snprintf(pc_string, sizeof(pc_string), "%u", pc);
     proto_item_append_text(pc_item, " (%s)", pc_string);
-    proto_tree_add_string_hidden(tree, hf_pc_string, tvb, offset, ANSI_PC_LENGTH, pc_string);
+    hidden_item = proto_tree_add_string(tree, hf_pc_string, tvb, offset, ANSI_PC_LENGTH, pc_string);
+    PROTO_ITEM_SET_HIDDEN(hidden_item);
     g_snprintf(pc_string, sizeof(pc_string), "0x%x", pc);
     proto_item_append_text(pc_item, " (%s)", pc_string);
-    proto_tree_add_string_hidden(tree, hf_pc_string, tvb, offset, ANSI_PC_LENGTH, pc_string);
+    hidden_item = proto_tree_add_string(tree, hf_pc_string, tvb, offset, ANSI_PC_LENGTH, pc_string);
+    PROTO_ITEM_SET_HIDDEN(hidden_item);
 
     pc_tree = proto_item_add_subtree(pc_item, ett_pc);
 
@@ -427,11 +429,14 @@ dissect_mtp3_3byte_pc(tvbuff_t *tvb, guint offset, proto_tree *tree, gint ett_pc
     proto_tree_add_uint(pc_tree, hf_pc_member,  tvb, offset + ANSI_MEMBER_OFFSET,  ANSI_NCM_LENGTH, pc);
 
     /* add full integer values of DPC as hidden for filtering purposes */
-    if (hf_dpc)
-       proto_tree_add_uint_hidden(pc_tree, hf_dpc, tvb, offset, ANSI_PC_LENGTH, pc);
-    if (hf_pc)
-       proto_tree_add_uint_hidden(pc_tree, hf_pc,  tvb, offset, ANSI_PC_LENGTH, pc);
-
+    if (hf_dpc) {
+       hidden_item = proto_tree_add_uint(pc_tree, hf_dpc, tvb, offset, ANSI_PC_LENGTH, pc);
+       PROTO_ITEM_SET_HIDDEN(hidden_item);
+    }
+    if (hf_pc) {
+       hidden_item = proto_tree_add_uint(pc_tree, hf_pc,  tvb, offset, ANSI_PC_LENGTH, pc);
+       PROTO_ITEM_SET_HIDDEN(hidden_item);
+    }
 }
 
 static void
@@ -480,6 +485,7 @@ dissect_mtp3_routing_label(tvbuff_t *tvb, packet_info *pinfo, proto_tree *mtp3_t
 {
   guint32 label, dpc, opc;
   proto_item *label_item, *label_dpc_item, *label_opc_item;
+  proto_item *hidden_item;
   proto_tree *label_tree;
   int *hf_dpc_string;
   int *hf_opc_string;
@@ -495,8 +501,10 @@ dissect_mtp3_routing_label(tvbuff_t *tvb, packet_info *pinfo, proto_tree *mtp3_t
     opc = (label & ITU_OPC_MASK) >> 14;
     dpc =  label & ITU_DPC_MASK;
 
-    proto_tree_add_uint_hidden(label_tree, hf_mtp3_itu_pc, tvb, ROUTING_LABEL_OFFSET, ITU_ROUTING_LABEL_LENGTH, opc);
-    proto_tree_add_uint_hidden(label_tree, hf_mtp3_itu_pc, tvb, ROUTING_LABEL_OFFSET, ITU_ROUTING_LABEL_LENGTH, dpc);
+    hidden_item = proto_tree_add_uint(label_tree, hf_mtp3_itu_pc, tvb, ROUTING_LABEL_OFFSET, ITU_ROUTING_LABEL_LENGTH, opc);
+    PROTO_ITEM_SET_HIDDEN(hidden_item);
+    hidden_item = proto_tree_add_uint(label_tree, hf_mtp3_itu_pc, tvb, ROUTING_LABEL_OFFSET, ITU_ROUTING_LABEL_LENGTH, dpc);
+    PROTO_ITEM_SET_HIDDEN(hidden_item);
 
     label_dpc_item = proto_tree_add_uint(label_tree, hf_mtp3_itu_dpc, tvb, ROUTING_LABEL_OFFSET, ITU_ROUTING_LABEL_LENGTH, label);
     if (mtp3_pc_structured())
@@ -564,8 +572,10 @@ dissect_mtp3_routing_label(tvbuff_t *tvb, packet_info *pinfo, proto_tree *mtp3_t
       proto_item_append_text(label_opc_item, " (%s)", mtp3_pc_to_str(opc));
     }
 
-    proto_tree_add_item_hidden(label_tree, hf_mtp3_japan_pc, tvb, ROUTING_LABEL_OFFSET, JAPAN_PC_LENGTH, TRUE);
-    proto_tree_add_item_hidden(label_tree, hf_mtp3_japan_pc, tvb, JAPAN_OPC_OFFSET, JAPAN_PC_LENGTH, TRUE);
+    hidden_item = proto_tree_add_item(label_tree, hf_mtp3_japan_pc, tvb, ROUTING_LABEL_OFFSET, JAPAN_PC_LENGTH, TRUE);
+    PROTO_ITEM_SET_HIDDEN(hidden_item);
+    hidden_item = proto_tree_add_item(label_tree, hf_mtp3_japan_pc, tvb, JAPAN_OPC_OFFSET, JAPAN_PC_LENGTH, TRUE);
+    PROTO_ITEM_SET_HIDDEN(hidden_item);
 
     if (mtp3_use_japan_5_bit_sls) {
        proto_tree_add_item(label_tree, hf_mtp3_japan_5_bit_sls, tvb, JAPAN_SLS_OFFSET, JAPAN_SLS_SPARE_LENGTH, TRUE);