Trivial warning fixes
[obnox/wireshark/wip.git] / epan / dissectors / packet-mtp3mg.c
index 86e449b431dc9ebc342d15a54038b4c33e5abc6b..107f437aa118d9e3f071d55cc4b05dd9aa164c09 100644 (file)
@@ -44,7 +44,6 @@
 #include <glib.h>
 
 #include <epan/packet.h>
-#include <epan/prefs.h>
 
 #include <packet-mtp3.h>
 
@@ -284,9 +283,10 @@ static const value_string japan_test_message_type_acro_values[] = {
   { JAPAN_TEST_SRA, "SRA" },
   { 0,              NULL } };
 
-#define COO_LENGTH         2
+#define ANSI_COO_LENGTH    2
 #define ANSI_COO_SLC_MASK  0x000f
 #define ANSI_COO_FSN_MASK  0x07f0
+#define ITU_COO_LENGTH     1
 #define ITU_COO_FSN_MASK   0x007f
 #define ANSI_XCO_LENGTH    4
 #define ANSI_XCO_SLC_MASK  0x0000000f
@@ -456,7 +456,7 @@ dissect_mtp3mg_unknown_message(tvbuff_t *tvb, proto_tree *tree)
 {
     guint8 message_length;
 
-    message_length = tvb_length_remaining(tvb, 0);
+    message_length = tvb_length(tvb);
     proto_tree_add_text(tree, tvb, 0, message_length,
                        "Unknown message (%u byte%s)", message_length,
                        plurality(message_length, "", "s"));
@@ -469,7 +469,7 @@ dissect_mtp3mg_chm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
     if (check_col(pinfo->cinfo, COL_INFO))
        col_add_fstr(pinfo->cinfo, COL_INFO, "%s ",
                     val_to_str(h1, chm_h1_message_type_acro_values, "Unknown"));
-       
+
     switch (h1)
     {
     case CHM_H1_COO:
@@ -477,12 +477,12 @@ dissect_mtp3mg_chm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
        if (mtp3_standard == ANSI_STANDARD)
        {
            proto_tree_add_item(tree, hf_mtp3mg_coo_ansi_slc, tvb, 0,
-                               COO_LENGTH, TRUE);
+                               ANSI_COO_LENGTH, TRUE);
            proto_tree_add_item(tree, hf_mtp3mg_coo_ansi_fsn, tvb, 0,
-                               COO_LENGTH, TRUE);
+                               ANSI_COO_LENGTH, TRUE);
        } else /* ITU_STANDARD, CHINESE_ITU_STANDARD, and JAPAN_STANDARD */ {
            proto_tree_add_item(tree, hf_mtp3mg_coo_itu_fsn, tvb, 0,
-                               COO_LENGTH, TRUE);
+                               ITU_COO_LENGTH, TRUE);
        }
        break;
 
@@ -1033,7 +1033,7 @@ dissect_mtp3mg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
         case JAPAN_STANDARD:
           col_set_str(pinfo->cinfo, COL_PROTOCOL, "MTP3MG (Japan)");
           break;
-      };      
+      };
 
     if (tree) {
        /* create display subtree for the protocol */
@@ -1109,7 +1109,7 @@ dissect_mtp3mg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
            default:
                if (check_col(pinfo->cinfo, COL_INFO))
-                   col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown ");
+                   col_set_str(pinfo->cinfo, COL_INFO, "Unknown ");
 
                dissect_mtp3mg_unknown_message(tvb, mtp3mg_tree);
            } /* switch */
@@ -1203,7 +1203,7 @@ dissect_mtp3mg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
        default:
            if (check_col(pinfo->cinfo, COL_INFO))
-               col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown ");
+               col_set_str(pinfo->cinfo, COL_INFO, "Unknown ");
 
            dissect_mtp3mg_unknown_message(tvb, mtp3mg_tree);
        } /* switch */
@@ -1532,7 +1532,7 @@ proto_reg_handoff_mtp3mg(void)
 {
     dissector_handle_t mtp3mg_handle;
 
-    mtp3mg_handle = create_dissector_handle(dissect_mtp3mg, proto_mtp3mg);
+    mtp3mg_handle = find_dissector("mtp3mg");
 
     dissector_add("mtp3.service_indicator", MTP3MG_SI, mtp3mg_handle);