aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--epan/dissectors/packet-ftp.c2
-rw-r--r--epan/dissectors/packet-icmpv6.c4
-rw-r--r--epan/dissectors/packet-ip.c4
-rw-r--r--epan/dissectors/packet-rpc.c15
-rw-r--r--epan/dissectors/packet-sametime.c2
-rw-r--r--epan/dissectors/packet-sbus.c7
-rw-r--r--epan/dissectors/packet-sua.c4
-rw-r--r--epan/dvb_chartbl.h2
-rw-r--r--epan/gcp.c2
-rw-r--r--epan/sna-utils.c4
-rw-r--r--epan/uat.c6
-rw-r--r--ui/gtk/wlan_stat_dlg.c14
-rw-r--r--ui/time_shift.c4
13 files changed, 34 insertions, 36 deletions
diff --git a/epan/dissectors/packet-ftp.c b/epan/dissectors/packet-ftp.c
index 8196e11c97..1bf970aa96 100644
--- a/epan/dissectors/packet-ftp.c
+++ b/epan/dissectors/packet-ftp.c
@@ -843,7 +843,7 @@ dissect_ftp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
else if (ftp_ip_address.type == AT_IPv6) {
addr_it = proto_tree_add_ipv6(reqresp_tree,
hf_ftp_epsv_ipv6, tvb, 0, 0,
- (guint8*)ftp_ip_address.data);
+ (const guint8*)ftp_ip_address.data);
PROTO_ITEM_SET_GENERATED(addr_it);
}
diff --git a/epan/dissectors/packet-icmpv6.c b/epan/dissectors/packet-icmpv6.c
index 89689daa37..ff39c40e58 100644
--- a/epan/dissectors/packet-icmpv6.c
+++ b/epan/dissectors/packet-icmpv6.c
@@ -3287,9 +3287,9 @@ dissect_icmpv6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
truncated, so we can checksum it. */
/* 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;
phdr[0] = g_htonl(reported_length);
diff --git a/epan/dissectors/packet-ip.c b/epan/dissectors/packet-ip.c
index b4fde3a10e..fd64067607 100644
--- a/epan/dissectors/packet-ip.c
+++ b/epan/dissectors/packet-ip.c
@@ -2208,7 +2208,7 @@ dissect_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
src_host = get_hostname(addr);
if (ip_summary_in_tree) {
proto_item_append_text(ti, ", Src: %s (%s)", src_host,
- ip_to_str((guint8 *)iph->ip_src.data));
+ ip_to_str((const guint8 *)iph->ip_src.data));
}
proto_tree_add_ipv4(ip_tree, hf_ip_src, tvb, offset + 12, 4, addr);
item = proto_tree_add_ipv4(ip_tree, hf_ip_addr, tvb, offset + 12, 4, addr);
@@ -2276,7 +2276,7 @@ dissect_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
cur_rt = tvb_get_ipv4(tvb, offset + 16);
if (ip_summary_in_tree) {
proto_item_append_text(ti, ", Dst: %s (%s)", dst_host,
- ip_to_str((guint8 *)iph->ip_dst.data));
+ ip_to_str((const guint8 *)iph->ip_dst.data));
if (dst_off)
proto_item_append_text(ti, ", Via: %s (%s)", get_hostname(cur_rt),
ip_to_str((gchar *)&cur_rt));
diff --git a/epan/dissectors/packet-rpc.c b/epan/dissectors/packet-rpc.c
index 8100629fa8..c19d0eeaf2 100644
--- a/epan/dissectors/packet-rpc.c
+++ b/epan/dissectors/packet-rpc.c
@@ -1688,7 +1688,7 @@ dissect_rpc_indir_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
conversation_t* conversation;
static address null_address = { AT_NONE, -1, 0, NULL };
rpc_call_info_value *rpc_call;
- char *procname=NULL;
+ const char *procname=NULL;
dissect_function_t *dissect_function = NULL;
rpc_conv_info_t *rpc_conv_info=NULL;
guint32 xid;
@@ -1762,7 +1762,7 @@ dissect_rpc_indir_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (rpc_call->proc_info != NULL) {
dissect_function = rpc_call->proc_info->dissect_reply;
if (rpc_call->proc_info->name != NULL) {
- procname = (char *)rpc_call->proc_info->name;
+ procname = rpc_call->proc_info->name;
}
else {
procname=wmem_strdup_printf(wmem_packet_scope(), "proc-%u", rpc_call->proc);
@@ -1898,7 +1898,7 @@ dissect_rpc_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
const char *msg_type_name = NULL;
const char *progname = NULL;
- char *procname = NULL;
+ const char *procname = NULL;
unsigned int vers_low;
unsigned int vers_high;
@@ -2180,7 +2180,7 @@ dissect_rpc_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if ((value = (rpc_proc_info_value *)g_hash_table_lookup(rpc_procs,&key)) != NULL) {
dissect_function = value->dissect_call;
- procname = (char *)value->name;
+ procname = value->name;
}
else {
/* happens only with strange program versions or
@@ -2226,8 +2226,7 @@ dissect_rpc_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (tvb_get_ntohl(tvb, offset+28)) {
flavor = FLAVOR_AUTHGSSAPI_MSG;
gss_proc = proc;
- procname = (char *)
- val_to_str(gss_proc,
+ procname = val_to_str(gss_proc,
rpc_authgssapi_proc, "Unknown (%d)");
} else {
flavor = FLAVOR_AUTHGSSAPI;
@@ -2414,7 +2413,7 @@ dissect_rpc_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (rpc_call->proc_info != NULL) {
dissect_function = rpc_call->proc_info->dissect_reply;
if (rpc_call->proc_info->name != NULL) {
- procname = (char *)rpc_call->proc_info->name;
+ procname = rpc_call->proc_info->name;
}
else {
procname=wmem_strdup_printf(wmem_packet_scope(), "proc-%u", proc);
@@ -2435,7 +2434,7 @@ dissect_rpc_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
* AUTH_GSSAPI procname.
*/
if (flavor == FLAVOR_AUTHGSSAPI_MSG) {
- procname = (char *)val_to_str_const(gss_proc, rpc_authgssapi_proc, "(null)");
+ procname = val_to_str_const(gss_proc, rpc_authgssapi_proc, "(null)");
}
rpc_prog_key.prog = prog;
diff --git a/epan/dissectors/packet-sametime.c b/epan/dissectors/packet-sametime.c
index 4b83abfe78..944902342c 100644
--- a/epan/dissectors/packet-sametime.c
+++ b/epan/dissectors/packet-sametime.c
@@ -635,7 +635,7 @@ dissect_sametime_content(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo
static int
sametime_stats_tree_packet(stats_tree* st, packet_info* pinfo _U_, epan_dissect_t* edt _U_, const void* p)
{
- struct SametimeTap *pi = (struct SametimeTap *)p;
+ const struct SametimeTap *pi = (const struct SametimeTap *)p;
tick_stat_node(st, st_str_packet, 0, FALSE);
if (pi->message_type != -1)
diff --git a/epan/dissectors/packet-sbus.c b/epan/dissectors/packet-sbus.c
index 14995dddcf..ef45041a22 100644
--- a/epan/dissectors/packet-sbus.c
+++ b/epan/dissectors/packet-sbus.c
@@ -567,8 +567,8 @@ static guint crc_calc (guint crc, guint val)
/* Hash functions*/
static gint sbus_equal(gconstpointer v, gconstpointer w)
{
- sbus_request_key *v1 = (sbus_request_key *)v;
- sbus_request_key *v2 = (sbus_request_key *)w;
+ const sbus_request_key *v1 = (const sbus_request_key *)v;
+ const sbus_request_key *v2 = (const sbus_request_key *)w;
if (v1->conversation == v2->conversation &&
v1->sequence == v2->sequence) {
@@ -579,8 +579,9 @@ static gint sbus_equal(gconstpointer v, gconstpointer w)
static guint sbus_hash(gconstpointer v)
{
- sbus_request_key *key = (sbus_request_key *)v;
+ const sbus_request_key *key = (const sbus_request_key *)v;
guint val;
+
val = key->conversation + key->sequence;
return val;
}
diff --git a/epan/dissectors/packet-sua.c b/epan/dissectors/packet-sua.c
index 8ff32028ef..39a31d8571 100644
--- a/epan/dissectors/packet-sua.c
+++ b/epan/dissectors/packet-sua.c
@@ -437,8 +437,8 @@ sua_assoc(packet_info* pinfo, address* opc, address* dpc, guint src_rn, guint ds
return &no_sua_assoc;
}
- opck = opc->type == AT_SS7PC ? mtp3_pc_hash((mtp3_addr_pc_t *)opc->data) : g_str_hash(ep_address_to_str(opc));
- dpck = dpc->type == AT_SS7PC ? mtp3_pc_hash((mtp3_addr_pc_t *)dpc->data) : g_str_hash(ep_address_to_str(dpc));
+ opck = opc->type == AT_SS7PC ? mtp3_pc_hash((const mtp3_addr_pc_t *)opc->data) : g_str_hash(ep_address_to_str(opc));
+ dpck = dpc->type == AT_SS7PC ? mtp3_pc_hash((const mtp3_addr_pc_t *)dpc->data) : g_str_hash(ep_address_to_str(dpc));
switch (message_type) {
case MESSAGE_TYPE_CORE:
diff --git a/epan/dvb_chartbl.h b/epan/dvb_chartbl.h
index 6c2941026b..8e70016cfd 100644
--- a/epan/dvb_chartbl.h
+++ b/epan/dvb_chartbl.h
@@ -62,7 +62,7 @@ typedef enum {
DVB_ENCODING_KSX_1001,
DVB_ENCODING_GB_2312,
DVB_ENCODING_ISO_10646_BIG5,
- DVB_ENCODING_ISO_10646_UTF8_BMP,
+ DVB_ENCODING_ISO_10646_UTF8_BMP
} dvb_encoding_e;
WS_DLL_PUBLIC
diff --git a/epan/gcp.c b/epan/gcp.c
index 5c6ca7327f..b00c030b61 100644
--- a/epan/gcp.c
+++ b/epan/gcp.c
@@ -402,7 +402,7 @@ gcp_term_t* gcp_cmd_add_term(gcp_msg_t* m, gcp_trx_t* tr, gcp_cmd_t* c, gcp_term
gcp_terms_t* ct;
gcp_terms_t* ct2;
- static gcp_term_t all_terms = {"$",(guint8*)"",1,GCP_TERM_TYPE_UNKNOWN,NULL,NULL,NULL};
+ static gcp_term_t all_terms = {"$",(const guint8*)"",1,GCP_TERM_TYPE_UNKNOWN,NULL,NULL,NULL};
if ( !c ) return NULL;
diff --git a/epan/sna-utils.c b/epan/sna-utils.c
index 54cc44f7bc..0d0acbe1e2 100644
--- a/epan/sna-utils.c
+++ b/epan/sna-utils.c
@@ -51,12 +51,12 @@ sna_fid_to_str_buf(const address *addr, gchar *buf, int buf_len)
switch (addr->len) {
case 1:
- addrdata = (guint8 *)addr->data;
+ addrdata = (const guint8 *)addr->data;
g_snprintf(buf, buf_len, "%04X", addrdata[0]);
break;
case 2:
- addrdata = (guint8 *)addr->data;
+ addrdata = (const guint8 *)addr->data;
g_snprintf(buf, buf_len, "%04X", pntoh16(&addrdata[0]));
break;
diff --git a/epan/uat.c b/epan/uat.c
index 85c34493ff..d42854f4ca 100644
--- a/epan/uat.c
+++ b/epan/uat.c
@@ -258,7 +258,7 @@ static void putfld(FILE* fp, void* rec, uat_field_t* f) {
guint i;
for(i=0;i<fld_len;i++) {
- fprintf(fp,"%.2x",((guint8*)fld_ptr)[i]);
+ fprintf(fp,"%.2x",((const guint8*)fld_ptr)[i]);
}
return;
@@ -709,12 +709,12 @@ char* uat_undquote(const char* si, guint in_len, guint* len_p) {
char* uat_esc(const char* buf, guint len) {
- const guint8* end = ((guint8*)buf)+len;
+ const guint8* end = ((const guint8*)buf)+len;
char* out = (char *)ep_alloc0((4*len)+1);
const guint8* b;
char* s = out;
- for (b = (guint8 *)buf; b < end; b++) {
+ for (b = (const guint8 *)buf; b < end; b++) {
if (isprint(*b) ) {
*(s++) = (*b);
} else {
diff --git a/ui/gtk/wlan_stat_dlg.c b/ui/gtk/wlan_stat_dlg.c
index 9998055b94..8bf670cd30 100644
--- a/ui/gtk/wlan_stat_dlg.c
+++ b/ui/gtk/wlan_stat_dlg.c
@@ -230,7 +230,7 @@ invalidate_detail_iters (wlanstat_t *hs)
}
static wlan_ep_t*
-alloc_wlan_ep (struct _wlan_hdr *si, packet_info *pinfo _U_)
+alloc_wlan_ep (const struct _wlan_hdr *si, const packet_info *pinfo _U_)
{
wlan_ep_t *ep;
@@ -256,7 +256,7 @@ alloc_wlan_ep (struct _wlan_hdr *si, packet_info *pinfo _U_)
}
static wlan_details_ep_t *
-alloc_wlan_details_ep (address *addr)
+alloc_wlan_details_ep (const address *addr)
{
wlan_details_ep_t *d_ep;
@@ -282,7 +282,7 @@ alloc_wlan_details_ep (address *addr)
}
static wlan_details_ep_t *
-get_details_ep (wlan_ep_t *te, address *addr)
+get_details_ep (wlan_ep_t *te, const address *addr)
{
wlan_details_ep_t *tmp, *d_te = NULL;
@@ -311,7 +311,7 @@ get_details_ep (wlan_ep_t *te, address *addr)
}
static void
-wlanstat_packet_details (wlan_ep_t *te, guint32 type, address *addr, gboolean src)
+wlanstat_packet_details (wlan_ep_t *te, guint32 type, const address *addr, gboolean src)
{
wlan_details_ep_t *d_te = get_details_ep (te, addr);
@@ -357,7 +357,7 @@ wlanstat_packet_details (wlan_ep_t *te, guint32 type, address *addr, gboolean sr
}
static gboolean
-is_broadcast(address *addr)
+is_broadcast(const address *addr)
{
#if 0
/* doesn't work if MAC resolution is disable */
@@ -367,7 +367,7 @@ is_broadcast(address *addr)
}
static gboolean
-ssid_equal(struct _wlan_stats *st1, struct _wlan_stats *st2 )
+ssid_equal(const struct _wlan_stats *st1, const struct _wlan_stats *st2 )
{
return (st1->ssid_len == st2->ssid_len) && (memcmp(st1->ssid, st2->ssid, st1->ssid_len) == 0);
}
@@ -377,7 +377,7 @@ wlanstat_packet (void *phs, packet_info *pinfo, epan_dissect_t *edt _U_, const v
{
wlanstat_t *hs = (wlanstat_t *)phs;
wlan_ep_t *tmp, *te = NULL;
- struct _wlan_hdr *si = (struct _wlan_hdr *) phi;
+ const struct _wlan_hdr *si = (const struct _wlan_hdr *) phi;
if (!hs)
return (0);
diff --git a/ui/time_shift.c b/ui/time_shift.c
index 658b79b884..ec490f7d74 100644
--- a/ui/time_shift.c
+++ b/ui/time_shift.c
@@ -134,13 +134,11 @@ calcNT3(nstime_t *OT1, nstime_t *OT3, nstime_t *NT1, nstime_t *NT3,
const gchar *
time_string_parse(const gchar *time_text, int *year, int *month, int *day, gboolean *negative, int *hour, int *minute, long double *second) {
- gchar *pts;
+ const gchar *pts = time_text;
if (!time_text || !hour || !minute || !second)
return "Unable to convert time.";
- pts = (gchar *)time_text;
-
/* strip whitespace */
while (isspace(pts[0]))
++pts;