diff options
Diffstat (limited to 'epan')
-rw-r--r-- | epan/addr_resolv.c | 12 | ||||
-rw-r--r-- | epan/dissectors/packet-soupbintcp.c | 6 | ||||
-rw-r--r-- | epan/oids.c | 14 |
3 files changed, 17 insertions, 15 deletions
diff --git a/epan/addr_resolv.c b/epan/addr_resolv.c index 6148de24bf..b5ec5dddb7 100644 --- a/epan/addr_resolv.c +++ b/epan/addr_resolv.c @@ -373,7 +373,7 @@ add_async_dns_ipv4(int type, guint32 addr) { async_dns_queue_msg_t *msg; - msg = g_malloc(sizeof(async_dns_queue_msg_t)); + msg = g_new(async_dns_queue_msg_t,1); #ifdef HAVE_C_ARES msg->family = type; msg->addr.ip4 = addr; @@ -727,7 +727,7 @@ c_ares_ghba_cb(void *arg, int status, struct hostent *he) { #else c_ares_ghba_cb(void *arg, int status, int timeouts _U_, struct hostent *he) { #endif - async_dns_queue_msg_t *caqm = arg; + async_dns_queue_msg_t *caqm = (async_dns_queue_msg_t *)arg; char **p; if (!caqm) return; @@ -825,7 +825,7 @@ host_lookup(const guint addr, gboolean *found) * else call gethostbyaddr and hope for the best */ - hostp = gethostbyaddr((char *)&addr, 4, AF_INET); + hostp = gethostbyaddr((const char *)&addr, 4, AF_INET); if (hostp != NULL) { g_strlcpy(tp->name, hostp->h_name, MAXNAMELEN); @@ -906,7 +906,7 @@ host_lookup6(const struct e_in6_addr *addr, gboolean *found) if ((gbl_resolv_flags.concurrent_dns) && name_resolve_concurrency > 0 && async_dns_initialized) { - caqm = g_malloc(sizeof(async_dns_queue_msg_t)); + caqm = g_new(async_dns_queue_msg_t,1); caqm->family = AF_INET6; memcpy(&caqm->addr.ip6, addr, sizeof(caqm->addr.ip6)); async_dns_queue_head = g_list_append(async_dns_queue_head, (gpointer) caqm); @@ -924,7 +924,7 @@ host_lookup6(const struct e_in6_addr *addr, gboolean *found) #endif /* HAVE_C_ARES */ /* Quick hack to avoid DNS/YP timeout */ - hostp = gethostbyaddr((char *)addr, sizeof(*addr), AF_INET6); + hostp = gethostbyaddr((const char *)addr, sizeof(*addr), AF_INET6); if (hostp != NULL) { g_strlcpy(tp->name, hostp->h_name, MAXNAMELEN); @@ -3257,7 +3257,7 @@ c_ares_ghi_cb(void *arg, int status, int timeouts _U_, struct hostent *hp) { * XXX - If we wanted to be really fancy we could cache results here and * look them up in get_host_ipaddr* below. */ - async_hostent_t *ahp = arg; + async_hostent_t *ahp = (async_hostent_t *)arg; if (status == ARES_SUCCESS && hp && ahp && hp->h_length == ahp->addr_size) { memcpy(ahp->addrp, hp->h_addr, hp->h_length); ahp->copied = hp->h_length; diff --git a/epan/dissectors/packet-soupbintcp.c b/epan/dissectors/packet-soupbintcp.c index 4af6890a89..9926bdcea1 100644 --- a/epan/dissectors/packet-soupbintcp.c +++ b/epan/dissectors/packet-soupbintcp.c @@ -64,6 +64,8 @@ /* For tcp_dissect_pdus() */ #include "packet-tcp.h" +void proto_register_soupbintcp(void); +void proto_reg_handoff_soupbintcp(void); /** Session data stored in the conversation */ struct conv_data { @@ -246,7 +248,7 @@ dissect_soupbintcp_common( 0); /* Store starting sequence number for session's packets */ - conv_data = wmem_alloc(wmem_file_scope(), sizeof(struct conv_data)); + conv_data = (struct conv_data *)wmem_alloc(wmem_file_scope(), sizeof(struct conv_data)); conv_data->next_seq = next_seq; conversation_add_proto_data(conv, proto_soupbintcp, conv_data); } @@ -265,7 +267,7 @@ dissect_soupbintcp_common( if (!conv) { this_seq = 0; } else { - conv_data = conversation_get_proto_data(conv, + conv_data = (struct conv_data *)conversation_get_proto_data(conv, proto_soupbintcp); if (conv_data) { this_seq = conv_data->next_seq++; diff --git a/epan/oids.c b/epan/oids.c index c2926729b6..2f7ca68ddc 100644 --- a/epan/oids.c +++ b/epan/oids.c @@ -248,8 +248,8 @@ static void smi_error_handler(char *path, int line, int severity, char *msg, cha static void* smi_mod_copy_cb(void* dest, const void* orig, size_t len _U_) { - const smi_module_t* m = orig; - smi_module_t* d = dest; + const smi_module_t* m = (const smi_module_t*)orig; + smi_module_t* d = (smi_module_t*)dest; d->name = g_strdup(m->name); @@ -257,7 +257,7 @@ static void* smi_mod_copy_cb(void* dest, const void* orig, size_t len _U_) { } static void smi_mod_free_cb(void* p) { - smi_module_t* m = p; + smi_module_t* m = (smi_module_t*)p; g_free(m->name); } @@ -322,7 +322,7 @@ static const oid_value_type_t* get_typedata(SmiType* smiType) { {"enum",SMI_BASETYPE_ENUM,&integer_type}, {"bits",SMI_BASETYPE_BITS,&bytes_type}, {"unk",SMI_BASETYPE_UNKNOWN,&unknown_type}, - {NULL,0,NULL} + {NULL,SMI_BASETYPE_UNKNOWN,NULL} /* SMI_BASETYPE_UNKNOWN = 0 */ }; const struct _type_mapping_t* t; SmiType* sT = smiType; @@ -421,7 +421,7 @@ static inline oid_kind_t smikind(SmiNode* sN, oid_key_t** key_p) { typedata = get_typedata(elType); - k = g_malloc(sizeof(oid_key_t)); + k = g_new(oid_key_t,1); oid1 = smiRenderOID(sN->oidlen, sN->oid, SMI_RENDER_QUALIFIED); oid2 = smiRenderOID(elNode->oidlen, elNode->oid, SMI_RENDER_NAME); @@ -748,7 +748,7 @@ void oid_pref_init(module_t *nameres) sizeof(smi_module_t), "smi_paths", FALSE, - (void*)&smi_paths, + (void**)&smi_paths, &num_smi_paths, /* affects dissection of packets (as the MIBs and PIBs affect the interpretation of e.g. SNMP variable bindings), but not set of @@ -776,7 +776,7 @@ void oid_pref_init(module_t *nameres) sizeof(smi_module_t), "smi_modules", FALSE, - (void*)&smi_modules, + (void**)&smi_modules, &num_smi_modules, /* affects dissection of packets (as the MIBs and PIBs affect the interpretation of e.g. SNMP variable bindings), but not set of |