[-Wmissing-prototypes]
authoretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 20 Mar 2013 05:59:22 +0000 (05:59 +0000)
committeretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 20 Mar 2013 05:59:22 +0000 (05:59 +0000)
Use explicit casts.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@48439 f5534014-38df-0310-8fa8-9805f1628bb7

asn1/ansi_map/packet-ansi_map-template.c
asn1/snmp/packet-snmp-template.c
epan/dissectors/packet-ansi_map.c
epan/dissectors/packet-snmp.c
epan/dissectors/packet-udp.c
plugins/wimaxasncp/wimaxasncp_dict.l
text2pcap.c

index 263f04d1c0003db355588b6ac6b15b37f71a0b2f..931fb5592bbffe44aaa9472ca9d78e917b997275 100644 (file)
 #define PSNAME "ANSI MAP"
 #define PFNAME "ansi_map"
 
+
+void proto_register_ansi_map(void);
+void proto_reg_handoff_ansi_map(void);
+
 /* Preference settings default */
 #define MAX_SSN 254
 static range_t *global_ssn_range;
@@ -4286,7 +4290,7 @@ find_saved_invokedata(asn1_ctx_t *actx){
     guint8 *dst_str;
     char *buf;
 
-    buf=ep_alloc(1024);
+    buf=(char *)ep_alloc(1024);
 
     /* Data from the TCAP dissector */
     if (actx->pinfo->private_data != NULL){
index 6d57d3d96ace9745ca85e48e964a7da77b95292d..82e182bb8967d5b7aff08b02c7d88d894f448aa1 100644 (file)
@@ -106,6 +106,11 @@ static int proto_smux = -1;
 static gboolean display_oid = TRUE;
 static gboolean snmp_var_in_tree = TRUE;
 
+void proto_register_snmp(void);
+void proto_reg_handoff_snmp(void);
+void proto_register_smux(void);
+void proto_reg_handoff_smux(void);
+
 static gboolean snmp_usm_auth_md5(snmp_usm_params_t* p, guint8**, guint*, gchar const**);
 static gboolean snmp_usm_auth_sha1(snmp_usm_params_t* p, guint8**, guint*, gchar const**);
 
@@ -701,7 +706,7 @@ show_oid_index:
                                                                                proto_tree_add_ether(pt_name,k->hfid,tvb,name_offset,buf_len, buf);
                                                                                break;
                                                                        case OID_KEY_TYPE_IPADDR: {
-                                                                               guint32* ipv4_p = (void*)buf;
+                                                                               guint32* ipv4_p = (guint32*)buf;
                                                                                proto_tree_add_ipv4(pt_name,k->hfid,tvb,name_offset,buf_len, *ipv4_p);
                                                                                }
                                                                                break;
@@ -1481,7 +1486,7 @@ snmp_usm_priv_des(snmp_usm_params_t* p _U_, tvbuff_t* encryptedData _U_, gchar c
        return clear_tvb;
 
 on_gcry_error:
-       *error = (void*)gpg_strerror(err);
+       *error = (const gchar *)gpg_strerror(err);
        if (hd) gcry_cipher_close(hd);
        return NULL;
 #else
@@ -1551,7 +1556,7 @@ snmp_usm_priv_aes_common(snmp_usm_params_t* p, tvbuff_t* encryptedData, gchar co
        return clear_tvb;
 
 on_gcry_error:
-       *error = (void*)gpg_strerror(err);
+       *error = (const gchar *)gpg_strerror(err);
        if (hd) gcry_cipher_close(hd);
        return NULL;
 }
@@ -1590,7 +1595,7 @@ snmp_usm_priv_aes256(snmp_usm_params_t* p _U_, tvbuff_t* encryptedData _U_, gcha
 #endif
 }
 
-gboolean
+static gboolean
 check_ScopedPdu(tvbuff_t* tvb)
 {
        int offset;
index f8a10c667822794788348bdad92ac5f047e26748..ce8773618ab97ac7975182507f0c73b297b91aa1 100644 (file)
 #define PSNAME "ANSI MAP"
 #define PFNAME "ansi_map"
 
+
+void proto_register_ansi_map(void);
+void proto_reg_handoff_ansi_map(void);
+
 /* Preference settings default */
 #define MAX_SSN 254
 static range_t *global_ssn_range;
@@ -877,7 +881,7 @@ static int hf_ansi_map_interSystemSMSDeliveryPointToPointRes = -1;  /* InterSyst
 static int hf_ansi_map_qualificationRequest2Res = -1;  /* QualificationRequest2Res */
 
 /*--- End of included file: packet-ansi_map-hf.c ---*/
-#line 321 "../../asn1/ansi_map/packet-ansi_map-template.c"
+#line 325 "../../asn1/ansi_map/packet-ansi_map-template.c"
 
 /* Initialize the subtree pointers */
 static gint ett_ansi_map = -1;
@@ -1137,7 +1141,7 @@ static gint ett_ansi_map_InvokeData = -1;
 static gint ett_ansi_map_ReturnData = -1;
 
 /*--- End of included file: packet-ansi_map-ett.c ---*/
-#line 353 "../../asn1/ansi_map/packet-ansi_map-template.c"
+#line 357 "../../asn1/ansi_map/packet-ansi_map-template.c"
 
 /* Global variables */
 static dissector_table_t is637_tele_id_dissector_table; /* IS-637 Teleservice ID */
@@ -15458,7 +15462,7 @@ dissect_ansi_map_ReturnData(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int of
 
 
 /*--- End of included file: packet-ansi_map-fn.c ---*/
-#line 3584 "../../asn1/ansi_map/packet-ansi_map-template.c"
+#line 3588 "../../asn1/ansi_map/packet-ansi_map-template.c"
 
 /*
  * 6.5.2.dk N.S0013-0 v 1.0,X.S0004-550-E v1.0 2.301
@@ -16164,7 +16168,7 @@ find_saved_invokedata(asn1_ctx_t *actx){
     guint8 *dst_str;
     char *buf;
 
-    buf=ep_alloc(1024);
+    buf=(char *)ep_alloc(1024);
 
     /* Data from the TCAP dissector */
     if (actx->pinfo->private_data != NULL){
@@ -19304,7 +19308,7 @@ void proto_register_ansi_map(void) {
         NULL, HFILL }},
 
 /*--- End of included file: packet-ansi_map-hfarr.c ---*/
-#line 5237 "../../asn1/ansi_map/packet-ansi_map-template.c"
+#line 5241 "../../asn1/ansi_map/packet-ansi_map-template.c"
     };
 
     /* List of subtrees */
@@ -19565,7 +19569,7 @@ void proto_register_ansi_map(void) {
     &ett_ansi_map_ReturnData,
 
 /*--- End of included file: packet-ansi_map-ettarr.c ---*/
-#line 5270 "../../asn1/ansi_map/packet-ansi_map-template.c"
+#line 5274 "../../asn1/ansi_map/packet-ansi_map-template.c"
     };
 
     static const enum_val_t ansi_map_response_matching_type_values[] = {
index 6384d7eff43fc0387d8e6002da44bf3473d415a6..baea271e5eefc6ce0dedf7d822e70bccd4c538c6 100644 (file)
@@ -114,6 +114,11 @@ static int proto_smux = -1;
 static gboolean display_oid = TRUE;
 static gboolean snmp_var_in_tree = TRUE;
 
+void proto_register_snmp(void);
+void proto_reg_handoff_snmp(void);
+void proto_register_smux(void);
+void proto_reg_handoff_smux(void);
+
 static gboolean snmp_usm_auth_md5(snmp_usm_params_t* p, guint8**, guint*, gchar const**);
 static gboolean snmp_usm_auth_sha1(snmp_usm_params_t* p, guint8**, guint*, gchar const**);
 
@@ -306,7 +311,7 @@ static int hf_snmp_priority = -1;                 /* INTEGER_M1_2147483647 */
 static int hf_snmp_operation = -1;                /* T_operation */
 
 /*--- End of included file: packet-snmp-hf.c ---*/
-#line 232 "../../asn1/snmp/packet-snmp-template.c"
+#line 237 "../../asn1/snmp/packet-snmp-template.c"
 
 static int hf_smux_version = -1;
 static int hf_smux_pdutype = -1;
@@ -349,7 +354,7 @@ static gint ett_snmp_SimpleOpen_U = -1;
 static gint ett_snmp_RReqPDU_U = -1;
 
 /*--- End of included file: packet-snmp-ett.c ---*/
-#line 251 "../../asn1/snmp/packet-snmp-template.c"
+#line 256 "../../asn1/snmp/packet-snmp-template.c"
 
 static const true_false_string auth_flags = {
        "OK",
@@ -803,7 +808,7 @@ show_oid_index:
                                                                                proto_tree_add_ether(pt_name,k->hfid,tvb,name_offset,buf_len, buf);
                                                                                break;
                                                                        case OID_KEY_TYPE_IPADDR: {
-                                                                               guint32* ipv4_p = (void*)buf;
+                                                                               guint32* ipv4_p = (guint32*)buf;
                                                                                proto_tree_add_ipv4(pt_name,k->hfid,tvb,name_offset,buf_len, *ipv4_p);
                                                                                }
                                                                                break;
@@ -1583,7 +1588,7 @@ snmp_usm_priv_des(snmp_usm_params_t* p _U_, tvbuff_t* encryptedData _U_, gchar c
        return clear_tvb;
 
 on_gcry_error:
-       *error = (void*)gpg_strerror(err);
+       *error = (const gchar *)gpg_strerror(err);
        if (hd) gcry_cipher_close(hd);
        return NULL;
 #else
@@ -1653,7 +1658,7 @@ snmp_usm_priv_aes_common(snmp_usm_params_t* p, tvbuff_t* encryptedData, gchar co
        return clear_tvb;
 
 on_gcry_error:
-       *error = (void*)gpg_strerror(err);
+       *error = (const gchar *)gpg_strerror(err);
        if (hd) gcry_cipher_close(hd);
        return NULL;
 }
@@ -1692,7 +1697,7 @@ snmp_usm_priv_aes256(snmp_usm_params_t* p _U_, tvbuff_t* encryptedData _U_, gcha
 #endif
 }
 
-gboolean
+static gboolean
 check_ScopedPdu(tvbuff_t* tvb)
 {
        int offset;
@@ -2851,7 +2856,7 @@ static void dissect_SMUX_PDUs_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, pro
 
 
 /*--- End of included file: packet-snmp-fn.c ---*/
-#line 1631 "../../asn1/snmp/packet-snmp-template.c"
+#line 1636 "../../asn1/snmp/packet-snmp-template.c"
 
 
 guint
@@ -3766,7 +3771,7 @@ void proto_register_snmp(void) {
         NULL, HFILL }},
 
 /*--- End of included file: packet-snmp-hfarr.c ---*/
-#line 2281 "../../asn1/snmp/packet-snmp-template.c"
+#line 2286 "../../asn1/snmp/packet-snmp-template.c"
   };
 
   /* List of subtrees */
@@ -3806,7 +3811,7 @@ void proto_register_snmp(void) {
     &ett_snmp_RReqPDU_U,
 
 /*--- End of included file: packet-snmp-ettarr.c ---*/
-#line 2297 "../../asn1/snmp/packet-snmp-template.c"
+#line 2302 "../../asn1/snmp/packet-snmp-template.c"
   };
   module_t *snmp_module;
 
index 31dc7bb3aac108f7412f15923742dc9ea09fd9f1..7a04e43fd9f714d1cf18e246c7d33d752497b84a 100644 (file)
@@ -45,6 +45,9 @@
 #include <epan/conversation.h>
 #include <epan/tap.h>
 
+void proto_register_udp(void);
+void proto_reg_handoff_udp(void);
+
 static int udp_tap = -1;
 static int udp_follow_tap = -1;
 
@@ -452,9 +455,9 @@ dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 ip_proto)
     if (((ip_proto == IP_PROTO_UDP) && (udp_check_checksum)) ||
         ((ip_proto == IP_PROTO_UDPLITE) && (udplite_check_checksum))) {
       /* Set up the fields of the pseudo-header. */
-      cksum_vec[0].ptr = (guint8 *)pinfo->src.data;
+      cksum_vec[0].ptr = (const guint8 *)pinfo->src.data;
       cksum_vec[0].len = pinfo->src.len;
-      cksum_vec[1].ptr = (guint8 *)pinfo->dst.data;
+      cksum_vec[1].ptr = (const guint8 *)pinfo->dst.data;
       cksum_vec[1].len = pinfo->dst.len;
       cksum_vec[2].ptr = (const guint8 *)&phdr;
       switch (pinfo->src.type) {
index b4c273368b2ae322111feb5c281bd31b48e5849b..a643275453505afc34e992b9d6c2cf72349da718 100644 (file)
@@ -195,7 +195,7 @@ since_attr since=\042
 <LOADING>{xmlpi_start} BEGIN LOADING_XMLPI;
 <LOADING_XMLPI>{whitespace} ;
 <LOADING_XMLPI>{entityname} {
-       xmlpi = g_malloc(sizeof(wimaxasncp_dict_xmlpi_t));
+       xmlpi = g_new(wimaxasncp_dict_xmlpi_t,1);
        xmlpi->name = g_strdup(yytext);
        xmlpi->key = NULL;
        xmlpi->value = NULL;
@@ -219,7 +219,7 @@ since_attr since=\042
 
 <LOADING>{start_entity} BEGIN ENTITY;
 <ENTITY>{entityname} {
-       entity_t *e = g_malloc(sizeof(entity_t));
+       entity_t *e = g_new(entity_t,1);
        D(("ENTITY: %s\n",yytext));
        e->name = g_strdup(yytext);
        e->next = ents.next;
@@ -385,7 +385,7 @@ since_attr since=\042
 <IN_DICT>{tlv_start}   {
        D(("tlv_start\n"));
 
-       tlv = g_malloc(sizeof(wimaxasncp_dict_tlv_t));
+       tlv = g_new(wimaxasncp_dict_tlv_t,1);
        tlv->type = 0;
        tlv->name = NULL;
        tlv->description = NULL;
@@ -425,7 +425,7 @@ since_attr since=\042
 <IN_TLV>{enum_start} {
        D(("enum_start\n"));
 
-       enumitem = g_malloc(sizeof(wimaxasncp_dict_enum_t));
+       enumitem = g_new(wimaxasncp_dict_enum_t,1);
        enumitem->name = NULL;
        enumitem->code = 0;
        enumitem->next = NULL;
@@ -539,11 +539,11 @@ void wimaxasncp_dict_unused(void) {
 static void append_to_buffer(const gchar *txt, int len) {
 
        if (strbuf == NULL) {
-               read_ptr = write_ptr = strbuf = g_malloc(size_strbuf);
+               read_ptr = write_ptr = strbuf = (gchar *)g_malloc(size_strbuf);
        }
 
        if ( (len_strbuf + len + 1) >= size_strbuf ) {
-               read_ptr = strbuf = g_realloc(strbuf,size_strbuf *= 2);
+               read_ptr = strbuf = (gchar *)g_realloc(strbuf,size_strbuf *= 2);
        }
 
        write_ptr = strbuf + len_strbuf;
@@ -626,7 +626,7 @@ wimaxasncp_dict_t *wimaxasncp_dict_scan(
                wimaxasncp_dict_free(dict);
        }
 
-       dict = g_malloc(sizeof(wimaxasncp_dict_t));
+       dict = g_new(wimaxasncp_dict_t,1);
        dict->tlvs = NULL;
        dict->xmlpis = NULL;
 
index 14bc41911875543dca8045595c048dcc479b495a..ce531cf71e4e947b82cf5ecdd23b8f4000f92f73 100644 (file)
@@ -440,7 +440,7 @@ static guint16
 in_checksum (void *buf, guint32 count)
 {
     guint32 sum = 0;
-    guint16 *addr = buf;
+    guint16 *addr = (guint16 *)buf;
 
     while (count > 1) {
         /*  This is the inner loop */