Fix about 150 warnings new to gcc 4.0 in the error on warning directories.

Comment out -Werror in plugins/asn1/ until warnings can be fixed.


svn path=/trunk/; revision=21158
This commit is contained in:
Stephen Fisher 2007-03-23 22:49:23 +00:00
parent 3288a39db2
commit 2896811274
22 changed files with 127 additions and 123 deletions

View File

@ -562,7 +562,7 @@ pipe_read_block(int pipe, char *indicator, int len, char *msg) {
/* read header (indicator and 3-byte length) */
newly = pipe_read_bytes(pipe, header, 4);
newly = pipe_read_bytes(pipe, (char*)header, 4);
if(newly != 4) {
g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_DEBUG,
"read %d failed to read header: %u", pipe, newly);
@ -675,10 +675,10 @@ sync_pipe_input_cb(gint source, gpointer user_data)
break;
case SP_ERROR_MSG:
/* convert primary message */
pipe_convert_header(buffer, 4, &indicator, &primary_len);
pipe_convert_header((guchar*)buffer, 4, &indicator, &primary_len);
primary_msg = buffer+4;
/* convert secondary message */
pipe_convert_header(primary_msg + primary_len, 4, &indicator, &secondary_len);
pipe_convert_header((guchar*)primary_msg + primary_len, 4, &indicator, &secondary_len);
secondary_msg = primary_msg + primary_len + 4;
/* message output */
capture_input_error_message(capture_opts, primary_msg, secondary_msg);

View File

@ -930,7 +930,7 @@ col_set_addr(packet_info *pinfo, int col, address *addr, gboolean is_res,
/* XXX - should be done in "address_to_str_buf()", but that routine
doesn't know COL_MAX_LEN; it should be changed to take the
maximum length as an argument. */
strncpy(pinfo->cinfo->col_buf[col], addr->data, COL_MAX_LEN);
strncpy(pinfo->cinfo->col_buf[col], (gchar*)addr->data, COL_MAX_LEN);
pinfo->cinfo->col_buf[col][COL_MAX_LEN - 1] = '\0';
break;

View File

@ -4649,7 +4649,6 @@ samr_dissect_open_group_reply(tvbuff_t *tvb, int offset,
{
dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data;
guint32 rid = GPOINTER_TO_INT(dcv->private_data);
e_ctx_hnd policy_hnd;
proto_item *hnd_item;
guint32 status;

View File

@ -4617,12 +4617,12 @@ dissect_rsvp_call_id (proto_tree *ti, proto_tree *rsvp_object_tree,
"C-type: 2 (globally unique)");
proto_tree_add_text(rsvp_object_tree, tvb, offset2, 1, "Address type: %s",
val_to_str(type, address_type_vals, "Unknown (%u)"));
str = tvb_get_ephemeral_string (tvb, offset2 + 1, 3);
str = (char*)tvb_get_ephemeral_string (tvb, offset2 + 1, 3);
proto_tree_add_text(rsvp_object_tree, tvb, offset2 + 1, 3,
"International Segment: %s", str);
proto_item_append_text(ti, "Globally-Unique. Addr Type: %s. Intl Segment: %s. ",
val_to_str(type, address_type_vals, "Unknown (%u)"), str);
str = tvb_get_ephemeral_string (tvb, offset2 + 4, 12);
str = (char*)tvb_get_ephemeral_string (tvb, offset2 + 4, 12);
proto_tree_add_text(rsvp_object_tree, tvb, offset2 + 4, 12,
"National Segment: %s", str);
proto_item_append_text(ti, "Natl Segment: %s. ", str);

View File

@ -121,7 +121,7 @@ packet_info *pinfo, proto_item *pi, int group, int severity, const char *format,
/* XXX - use currently nonexistant se_vsnprintf instead */
ret = g_vsnprintf(formatted, sizeof(formatted), format, ap);
if ((ret == -1) || (ret >= sizeof(formatted)))
if ((ret == -1) || (ret >= (int)sizeof(formatted)))
formatted[sizeof(formatted) - 1] = '\0';
ei = ep_alloc(sizeof(expert_info_t));

6
file.c
View File

@ -2741,7 +2741,7 @@ static gboolean
match_ascii_and_unicode(capture_file *cf, frame_data *fdata, void *criterion)
{
cbs_t *info = criterion;
const char *ascii_text = info->data;
const char *ascii_text = (char*)info->data;
size_t textlen = info->data_len;
gboolean frame_matched;
guint32 buf_len;
@ -2775,7 +2775,7 @@ static gboolean
match_ascii(capture_file *cf, frame_data *fdata, void *criterion)
{
cbs_t *info = criterion;
const char *ascii_text = info->data;
const char *ascii_text = (char*)info->data;
size_t textlen = info->data_len;
gboolean frame_matched;
guint32 buf_len;
@ -2807,7 +2807,7 @@ static gboolean
match_unicode(capture_file *cf, frame_data *fdata, void *criterion)
{
cbs_t *info = criterion;
const char *ascii_text = info->data;
const char *ascii_text = (char*)info->data;
size_t textlen = info->data_len;
gboolean frame_matched;
guint32 buf_len;

View File

@ -306,7 +306,7 @@ static int dissect_octet_string(tvbuff_t *tvb, proto_tree *tree, int offset, cha
p_noct = PADDING(n_oct);
if (n_oct >= 1024)
THROW(ReportedBoundsError);
tvb_get_nstringz(tvb, offset + 4, n_oct, context);
tvb_get_nstringz(tvb, offset + 4, n_oct, (guint8*)context);
context[n_oct]='\0';
proto_tree_add_uint(tree,hf_ostring_len,tvb,offset,4,n_oct);

View File

@ -480,9 +480,9 @@ static int ett_artnet = -1;
static guint global_udp_port_artnet = UDP_PORT_ARTNET;
static guint udp_port_artnet = UDP_PORT_ARTNET;
static guint global_disp_chan_val_type = 0;
static guint global_disp_col_count = 16;
static guint global_disp_chan_nr_type = 0;
static gint global_disp_chan_val_type = 0;
static gint global_disp_col_count = 16;
static gint global_disp_chan_nr_type = 0;
/* A static handle for the ip dissector */
static dissector_handle_t ip_handle;

View File

@ -26,9 +26,9 @@ INCLUDES = -I$(top_srcdir) -I$(includedir)
include Makefile.common
if HAVE_WARNINGS_AS_ERRORS
AM_CFLAGS = -Werror
endif
#if HAVE_WARNINGS_AS_ERRORS
#AM_CFLAGS = -Werror
#endif
plugin_LTLIBRARIES = asn1.la
asn1_la_SOURCES = \

View File

@ -124,9 +124,9 @@ static guint udp_port_enttec = UDP_PORT_ENTTEC;
static guint global_tcp_port_enttec = TCP_PORT_ENTTEC;
static guint tcp_port_enttec = TCP_PORT_ENTTEC;
static guint global_disp_chan_val_type = 0;
static guint global_disp_col_count = 16;
static guint global_disp_chan_nr_type = 0;
static gint global_disp_chan_val_type = 0;
static gint global_disp_col_count = 16;
static gint global_disp_chan_nr_type = 0;
/* A static handle for the ip dissector */

View File

@ -543,11 +543,11 @@ static void dissect_iap_request(tvbuff_t* tvb, packet_info* pinfo, proto_tree* r
src = pinfo->circuit_id ^ CMD_FRAME;
srcaddr.type = AT_NONE;
srcaddr.len = 1;
srcaddr.data = (char*)&src;
srcaddr.data = (guint8*)&src;
destaddr.type = AT_NONE;
destaddr.len = 1;
destaddr.data = (char*)&pinfo->circuit_id;
destaddr.data = (guint8*)&pinfo->circuit_id;
conv = find_conversation(pinfo->fd->num, &srcaddr, &destaddr, PT_NONE, pinfo->srcport, pinfo->destport, 0);
if (conv)
@ -588,9 +588,9 @@ static void dissect_iap_request(tvbuff_t* tvb, packet_info* pinfo, proto_tree* r
iap_conv->iap_query_frame = pinfo->fd->num;
iap_conv->pattr_dissector = NULL;
tvb_memcpy(tvb, class_name, offset + 1 + 1, clen);
tvb_memcpy(tvb, (guint8*)class_name, offset + 1 + 1, clen);
class_name[clen] = 0;
tvb_memcpy(tvb, attr_name, offset + 1 + 1 + clen + 1, alen);
tvb_memcpy(tvb, (guint8*)attr_name, offset + 1 + 1 + clen + 1, alen);
attr_name[alen] = 0;
/* Find the attribute dissector */
@ -614,9 +614,9 @@ static void dissect_iap_request(tvbuff_t* tvb, packet_info* pinfo, proto_tree* r
col_add_str(pinfo->cinfo, COL_INFO, "GetValueByClass: \"");
tvb_memcpy(tvb, buf, offset + 1 + 1, clen);
tvb_memcpy(tvb, (guint8*)buf, offset + 1 + 1, clen);
memcpy(&buf[clen], "\" \"", 3);
tvb_memcpy(tvb, buf + clen + 3, offset + 1 + 1 + clen + 1, alen);
tvb_memcpy(tvb, (guint8*)buf + clen + 3, offset + 1 + 1 + clen + 1, alen);
buf[clen + 3 + alen] = '\"';
buf[clen + 3 + alen + 1] = 0;
col_append_str(pinfo->cinfo, COL_INFO, buf);
@ -703,11 +703,11 @@ static void dissect_iap_result(tvbuff_t* tvb, packet_info* pinfo, proto_tree* ro
src = pinfo->circuit_id ^ CMD_FRAME;
srcaddr.type = AT_NONE;
srcaddr.len = 1;
srcaddr.data = (char*)&src;
srcaddr.data = (guint8*)&src;
destaddr.type = AT_NONE;
destaddr.len = 1;
destaddr.data = (char*)&pinfo->circuit_id;
destaddr.data = (guint8*)&pinfo->circuit_id;
/* Find result value dissector */
conv = find_conversation(pinfo->fd->num, &srcaddr, &destaddr, PT_NONE, pinfo->srcport, pinfo->destport, 0);
@ -762,7 +762,7 @@ static void dissect_iap_result(tvbuff_t* tvb, packet_info* pinfo, proto_tree* ro
case IAS_STRING:
strcpy(buf, ", \"");
n = tvb_get_guint8(tvb, offset + 8);
tvb_memcpy(tvb, buf + 3, offset + 9, n);
tvb_memcpy(tvb, (guint8*)buf + 3, offset + 9, n);
strcpy(buf + 3 + n, "\"");
break;
}
@ -992,11 +992,11 @@ static void dissect_appl_proto(tvbuff_t* tvb, packet_info* pinfo, proto_tree* ro
src = pinfo->circuit_id ^ CMD_FRAME;
srcaddr.type = AT_NONE;
srcaddr.len = 1;
srcaddr.data = (char*)&src;
srcaddr.data = (guint8*)&src;
destaddr.type = AT_NONE;
destaddr.len = 1;
destaddr.data = (char*)&pinfo->circuit_id;
destaddr.data = (guint8*)&pinfo->circuit_id;
/* Find result value dissector */
conv = find_conversation(pinfo->fd->num, &srcaddr, &destaddr, PT_NONE, pinfo->srcport, pinfo->destport, 0);
@ -1232,12 +1232,12 @@ void add_lmp_conversation(packet_info* pinfo, guint8 dlsap, gboolean ttp, dissec
/*g_message("%d: add_lmp_conversation(%p, %d, %d, %p) = ", pinfo->fd->num, pinfo, dlsap, ttp, proto_dissector); */
srcaddr.type = AT_NONE;
srcaddr.len = 1;
srcaddr.data = (char*)&pinfo->circuit_id;
srcaddr.data = (guint8*)&pinfo->circuit_id;
dest = pinfo->circuit_id ^ CMD_FRAME;
destaddr.type = AT_NONE;
destaddr.len = 1;
destaddr.data = (char*)&dest;
destaddr.data = (guint8*)&dest;
conv = find_conversation(pinfo->fd->num, &destaddr, &srcaddr, PT_NONE, dlsap, 0, NO_PORT_B);
if (conv)
@ -1643,7 +1643,7 @@ static void dissect_xid(tvbuff_t* tvb, packet_info* pinfo, proto_tree* root, pro
if (name_len > 22)
name_len = 22;
tvb_memcpy(tvb, buf, offset, name_len);
tvb_memcpy(tvb, (guint8*)buf, offset, name_len);
buf[name_len] = 0;
col_append_str(pinfo->cinfo, COL_INFO, ", \"");
col_append_str(pinfo->cinfo, COL_INFO, buf);
@ -1690,7 +1690,7 @@ static void dissect_log(tvbuff_t* tvb, packet_info* pinfo, proto_tree* root)
length = tvb_length(tvb);
if (length > sizeof(buf)-1)
length = sizeof(buf)-1;
tvb_memcpy(tvb, buf, 0, length);
tvb_memcpy(tvb, (guint8*)buf, 0, length);
buf[length] = 0;
if (buf[length-1] == '\n')
buf[length-1] = 0;

View File

@ -374,7 +374,7 @@ static void dissect_getnamebyaddr_request(tvbuff_t* tvb, proto_tree* lwres_tree)
{
guint32 flags,family;
guint16 addrlen, slen;
const gchar* addr;
const guint8* addr;
proto_item* nba_request_item;
proto_tree* nba_request_tree;
@ -383,7 +383,7 @@ static void dissect_getnamebyaddr_request(tvbuff_t* tvb, proto_tree* lwres_tree)
family = tvb_get_ntohl(tvb, LWRES_LWPACKET_LENGTH + 4);
addrlen = tvb_get_ntohs(tvb, LWRES_LWPACKET_LENGTH + 8);
addr = tvb_get_ptr(tvb, LWRES_LWPACKET_LENGTH + 10, 4);
slen = strlen((char*)ip_to_str(addr));
slen = strlen(ip_to_str(addr));
if(lwres_tree)
{
@ -446,7 +446,7 @@ static void dissect_getnamebyaddr_response(tvbuff_t* tvb, proto_tree* lwres_tree
flags = tvb_get_ntohl(tvb, LWRES_LWPACKET_LENGTH);
naliases = tvb_get_ntohs(tvb, LWRES_LWPACKET_LENGTH + 4);
realnamelen = tvb_get_ntohs(tvb,LWRES_LWPACKET_LENGTH + 4 + 2);
tvb_get_nstringz(tvb, LWRES_LWPACKET_LENGTH + 4 + 2 + 2, realnamelen, realname);
tvb_get_nstringz(tvb, LWRES_LWPACKET_LENGTH + 4 + 2 + 2, realnamelen, (guint8*)realname);
realname[realnamelen]='\0';
proto_tree_add_uint(nba_resp_tree,
@ -483,7 +483,7 @@ static void dissect_getnamebyaddr_response(tvbuff_t* tvb, proto_tree* lwres_tree
for(i=0; i<naliases; i++)
{
aliaslen = tvb_get_ntohs(tvb, offset);
tvb_get_nstringz(tvb, offset + 2, aliaslen, aliasname);
tvb_get_nstringz(tvb, offset + 2, aliaslen, (guint8*)aliasname);
aliasname[aliaslen]='\0';
alias_item = proto_tree_add_text(nba_resp_tree, tvb, offset, 2 + aliaslen, "Alias %s",aliasname);
@ -560,7 +560,7 @@ static void dissect_getaddrsbyname_request(tvbuff_t* tvb, proto_tree* lwres_tree
tvb,
LWRES_LWPACKET_LENGTH+10,
namelen,
name);
(gchar*)name);
}
@ -594,7 +594,7 @@ static void dissect_getaddrsbyname_response(tvbuff_t* tvb, proto_tree* lwres_tre
naliases = tvb_get_ntohs(tvb, LWRES_LWPACKET_LENGTH + 4);
naddrs = tvb_get_ntohs(tvb, LWRES_LWPACKET_LENGTH + 6);
realnamelen = tvb_get_ntohs(tvb, LWRES_LWPACKET_LENGTH + 8);
tvb_get_nstringz(tvb, LWRES_LWPACKET_LENGTH + 10, realnamelen, realname);
tvb_get_nstringz(tvb, LWRES_LWPACKET_LENGTH + 10, realnamelen, (guint8*)realname);
realname[realnamelen]='\0';
@ -640,7 +640,7 @@ static void dissect_getaddrsbyname_response(tvbuff_t* tvb, proto_tree* lwres_tre
for(i=0; i<naliases; i++)
{
aliaslen = tvb_get_ntohs(tvb, offset);
tvb_get_nstringz(tvb, offset + 2, aliaslen, aliasname);
tvb_get_nstringz(tvb, offset + 2, aliaslen, (guint8*)aliasname);
aliasname[aliaslen]='\0';
alias_item = proto_tree_add_text(adn_resp_tree, tvb, offset, 2 + aliaslen, "Alias %s",aliasname);
@ -670,10 +670,10 @@ static void dissect_getaddrsbyname_response(tvbuff_t* tvb, proto_tree* lwres_tre
{
family = tvb_get_ntohl(tvb, offset);
length = tvb_get_ntohs(tvb, offset + 4);
addr = tvb_get_ptr(tvb, offset + 6, 4);
slen = strlen((char*)ip_to_str(addr));
addr = (gchar*)tvb_get_ptr(tvb, offset + 6, 4);
slen = strlen((char*)ip_to_str((guint8*)addr));
addr_item = proto_tree_add_text(adn_resp_tree,tvb, offset, 4+2+4, "Address %s",ip_to_str(addr));
addr_item = proto_tree_add_text(adn_resp_tree,tvb, offset, 4+2+4, "Address %s",ip_to_str((guint8*)addr));
addr_tree = proto_item_add_subtree(addr_item, ett_adn_addr);
proto_tree_add_uint(addr_tree,
@ -695,7 +695,7 @@ static void dissect_getaddrsbyname_response(tvbuff_t* tvb, proto_tree* lwres_tre
tvb,
offset + 6,
slen,
ip_to_str(addr));
ip_to_str((guint8*)addr));
offset+= 4 + 2 + 4;
}
@ -730,13 +730,13 @@ static void dissect_a_records(tvbuff_t* tvb, proto_tree* tree,guint32 nrec,int o
curr = offset + ((sizeof(guint32)+sizeof(guint16)) * i);
len = tvb_get_ntohs(tvb,curr);
addr = tvb_get_ptr(tvb,curr+2,4);
addr = (gchar*)tvb_get_ptr(tvb,curr+2,4);
if(a_rec_tree)
{
addr_item = proto_tree_add_text(a_rec_tree,tvb, curr, 6,"IP Address");
addr_tree = proto_item_add_subtree(addr_item, ett_a_rec_addr);
proto_item_set_text(addr_item,"Address %s",ip_to_str(addr));
proto_item_set_text(addr_item,"Address %s",ip_to_str((guint8*)addr));
}
else return;
@ -752,7 +752,7 @@ static void dissect_a_records(tvbuff_t* tvb, proto_tree* tree,guint32 nrec,int o
curr + 2,
4,
"Addr: %s",
ip_to_str(addr));
ip_to_str((guint8*)addr));
}
@ -785,9 +785,9 @@ static void dissect_srv_records(tvbuff_t* tvb, proto_tree* tree,guint32 nrec,int
weight = tvb_get_ntohs(tvb, curr + 4);
port = tvb_get_ntohs(tvb, curr + 6);
namelen = len - 8;
cmpname = tvb_get_ptr(tvb, curr + 8, namelen);
cmpname = (char*)tvb_get_ptr(tvb, curr + 8, namelen);
dlen = lwres_get_dns_name(tvb, curr + 8, curr, dname, sizeof(dname));
dlen = lwres_get_dns_name(tvb, curr + 8, curr, (gchar*)dname, sizeof(dname));
if(srv_rec_tree)
{
@ -862,8 +862,8 @@ static void dissect_mx_records(tvbuff_t* tvb, proto_tree* tree, guint32 nrec, in
len = tvb_get_ntohs(tvb, curr);
priority = tvb_get_ntohs(tvb, curr + 2);
namelen = len - 4;
cname = tvb_get_ptr(tvb, curr + 4, 4);
dlen = lwres_get_dns_name(tvb, curr + 4, curr, dname, sizeof(dname));
cname = (char*)tvb_get_ptr(tvb, curr + 4, 4);
dlen = lwres_get_dns_name(tvb, curr + 4, curr, (gchar*)dname, sizeof(dname));
if(mx_rec_tree)
{
rec_item = proto_tree_add_text(mx_rec_tree, tvb, curr,6,"MX record: pri=%d,dname=%s",
@ -916,7 +916,7 @@ static void dissect_ns_records(tvbuff_t* tvb, proto_tree* tree, guint32 nrec, in
{
len = tvb_get_ntohs(tvb, curr);
namelen = len - 2;
dlen = lwres_get_dns_name(tvb, curr + 2, curr, dname, sizeof(dname));
dlen = lwres_get_dns_name(tvb, curr + 2, curr, (char*)dname, sizeof(dname));
if(ns_rec_tree)
{
rec_item = proto_tree_add_text(ns_rec_tree, tvb, curr,4, "NS record: dname=%s",dname);
@ -995,7 +995,7 @@ static void dissect_rdata_request(tvbuff_t* tvb, proto_tree* lwres_tree)
tvb,
LWRES_LWPACKET_LENGTH+10,
namelen,
name);
(char*)name);
}
@ -1082,7 +1082,7 @@ static void dissect_rdata_response(tvbuff_t* tvb, proto_tree* lwres_tree)
tvb,
LWRES_LWPACKET_LENGTH+18,
realnamelen,
realname);
(char*)realname);
switch(rdtype)
{
@ -1114,7 +1114,7 @@ static void dissect_noop(tvbuff_t* tvb, proto_tree* lwres_tree)
proto_tree* noop_tree;
datalen = tvb_get_ntohs(tvb, LWRES_LWPACKET_LENGTH);
data = tvb_get_ptr(tvb, LWRES_LWPACKET_LENGTH, datalen);
data = (char*)tvb_get_ptr(tvb, LWRES_LWPACKET_LENGTH, datalen);
if(lwres_tree)
{

View File

@ -606,6 +606,7 @@ static void append_avpl(GString* str, AVPL* avpl) {
g_string_sprintfa(str,")");
}
#if 0 /* XXX - Not used anywhere, for testing only? */
static void print_transforms(gpointer k, gpointer v, gpointer p) {
AVPL_Transf* t;
GString* str = p;
@ -656,6 +657,7 @@ static void print_transforms(gpointer k, gpointer v, gpointer p) {
g_string_sprintfa(str,"};\n\n");
}
#endif /* 0 */
static void append_transforms(GString* s, GPtrArray* ts) {
guint i;
@ -677,6 +679,8 @@ static void print_hfid_hash(gpointer k, gpointer v, gpointer p _U_) {
g_string_sprintfa((GString*)p,"\tExtract %s From %s;\n",(guint8*)v,my_protoname(*(int*)k));
}
/* XXX - Not used anywhere, for testing only? */
#if 0
static void print_pdu_config(mate_cfg_pdu* cfg, GString* s) {
guint i;
int hfid;
@ -858,6 +862,7 @@ static void print_config(void) {
g_string_free(config_text,TRUE);
}
#endif /* 0 */
extern mate_config* mate_make_config(const gchar* filename, int mate_hfid) {
gint* ett;

View File

@ -245,10 +245,10 @@ static int mgcp_tap = -1;
* the raw text of the mgcp message, much like the HTTP dissector does.
*
*/
static int global_mgcp_gateway_tcp_port = TCP_PORT_MGCP_GATEWAY;
static int global_mgcp_gateway_udp_port = UDP_PORT_MGCP_GATEWAY;
static int global_mgcp_callagent_tcp_port = TCP_PORT_MGCP_CALLAGENT;
static int global_mgcp_callagent_udp_port = UDP_PORT_MGCP_CALLAGENT;
static guint global_mgcp_gateway_tcp_port = TCP_PORT_MGCP_GATEWAY;
static guint global_mgcp_gateway_udp_port = UDP_PORT_MGCP_GATEWAY;
static guint global_mgcp_callagent_tcp_port = TCP_PORT_MGCP_CALLAGENT;
static guint global_mgcp_callagent_udp_port = UDP_PORT_MGCP_CALLAGENT;
static gboolean global_mgcp_raw_text = FALSE;
static gboolean global_mgcp_message_count = FALSE;
@ -955,10 +955,10 @@ void proto_reg_handoff_mgcp(void)
static gboolean is_mgcp_verb(tvbuff_t *tvb, gint offset, gint maxlength, const gchar **verb_name)
{
int returnvalue = FALSE;
guint8 word[5];
gchar word[5];
/* Read the string into 'word' and see if it looks like the start of a verb */
if ((maxlength >= 4) && tvb_get_nstringz0(tvb, offset, sizeof(word), word))
if ((maxlength >= 4) && tvb_get_nstringz0(tvb, offset, sizeof(word), (guint8*)word))
{
if (((strncasecmp(word, "EPCF", 4) == 0) && (*verb_name = "EndpointConfiguration")) ||
((strncasecmp(word, "CRCX", 4) == 0) && (*verb_name = "CreateConnection")) ||
@ -1332,7 +1332,7 @@ static gint tvb_parse_param(tvbuff_t* tvb, gint offset, gint len, int** hf)
/* set the observedEvents or signalReq used in Voip Calls analysis */
if (buf != NULL) {
*buf = tvb_get_ephemeral_string(tvb, tvb_current_offset, (len - tvb_current_offset + offset));
*buf = (gchar*)tvb_get_ephemeral_string(tvb, tvb_current_offset, (len - tvb_current_offset + offset));
}
}
}
@ -1841,7 +1841,7 @@ dissect_mgcp_connectionparams(proto_tree *parent_tree, tvbuff_t *tvb, gint offse
/* The P: line */
offset += param_type_len; /* skip the P: */
tokenline = tvb_get_ephemeral_string(tvb, offset, param_val_len);
tokenline = (gchar*)tvb_get_ephemeral_string(tvb, offset, param_val_len);
/* Split into type=value pairs separated by comma */
tokens = ep_strsplit(tokenline, ",", -1);
@ -1953,7 +1953,7 @@ dissect_mgcp_localconnectionoptions(proto_tree *parent_tree, tvbuff_t *tvb, gint
/* The L: line */
offset += param_type_len; /* skip the L: */
tokenline = tvb_get_ephemeral_string(tvb, offset, param_val_len);
tokenline = (gchar*)tvb_get_ephemeral_string(tvb, offset, param_val_len);
/* Split into type=value pairs separated by comma */
tokens = ep_strsplit(tokenline, ",", -1);

View File

@ -339,7 +339,7 @@ void decode_string_attribute(tvbuff_t *tvb, proto_tree *tree, int* hfValue, int
}
pbuffer=tvb_get_string(tvb, offset+4, length-4);
proto_tree_add_string(tree, *hfValue, tvb, offset+4, length-4, pbuffer);
proto_tree_add_string(tree, *hfValue, tvb, offset+4, length-4, (char*)pbuffer);
g_free(pbuffer);
}

View File

@ -627,7 +627,7 @@ dissect_ICBAPhysicalDevice_get_LogicalDevice_resp(tvbuff_t *tvb, int offset,
/* as I currently don't understand the objref process for a root interface! */
pdev_interf = dcom_interface_new(pinfo, pinfo->net_dst.data, &uuid_ICBAPhysicalDevice, 0, 0, &info->call_data->object_uuid);
if(pdev_interf != NULL) {
pdev = cba_pdev_add(pinfo, (const char *) (pinfo->net_dst.data) );
pdev = cba_pdev_add(pinfo, pinfo->net_dst.data);
cba_pdev_link(pinfo, pdev, pdev_interf);
ldev = cba_ldev_add(pinfo, pdev, ldev_name);
@ -823,7 +823,7 @@ dissect_ICBALogicalDevice_get_ACCO_resp(tvbuff_t *tvb, int offset,
"LDev_get_ACCO: can't resolve ACCO interface pointer");
}
ldev = cba_ldev_find(pinfo, (const gchar *) (pinfo->net_src.data), &info->call_data->object_uuid);
ldev = cba_ldev_find(pinfo, pinfo->net_src.data, &info->call_data->object_uuid);
/* "crosslink" interface and it's object */
if(ldev != NULL && acco_interf != NULL) {

View File

@ -1098,13 +1098,13 @@ dissect_sbus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Response: Firmware version */
case SBUS_RD_PROGRAM_VERSION:
/*PCD type*/
tmp_string = tvb_get_string(tvb, offset, 5);
tmp_string = (char*)tvb_get_string(tvb, offset, 5);
proto_tree_add_string(sbus_tree,
hf_sbus_cpu_type, tvb, offset, 5, tmp_string);
offset += 5;
g_free(tmp_string);
/*FW version*/
tmp_string = tvb_get_string(tvb , offset, 3);
tmp_string = (char*)tvb_get_string(tvb , offset, 3);
proto_tree_add_string(sbus_tree,
hf_sbus_fw_version, tvb, offset, 3, tmp_string);
offset += 4;

View File

@ -60,12 +60,12 @@ static void ip_hosts_stats_tree_init(stats_tree* st) {
static int ip_hosts_stats_tree_packet(stats_tree *st , packet_info *pinfo, epan_dissect_t *edt _U_, const void *p _U_) {
static guint8 str[128];
tick_stat_node(st, st_str_ip, 0, FALSE);
tick_stat_node(st, (guint8*)st_str_ip, 0, FALSE);
g_snprintf(str, sizeof(str),"%s",address_to_str(&pinfo->net_src));
g_snprintf((char*)str, sizeof(str),"%s",address_to_str(&pinfo->net_src));
tick_stat_node(st, str, st_node_ip, FALSE);
g_snprintf(str, sizeof(str),"%s",address_to_str(&pinfo->net_dst));
g_snprintf((char*)str, sizeof(str),"%s",address_to_str(&pinfo->net_dst));
tick_stat_node(st, str, st_node_ip, FALSE);
return 1;
@ -98,7 +98,7 @@ static void plen_stats_tree_init(stats_tree* st) {
}
static int plen_stats_tree_packet(stats_tree* st, packet_info* pinfo, epan_dissect_t *edt _U_, const void *p _U_) {
tick_stat_node(st, st_str_plen, 0, FALSE);
tick_stat_node(st, (guint8*)st_str_plen, 0, FALSE);
stats_tree_tick_range(st, st_str_plen, 0, pinfo->fd->pkt_len);
return 1;
@ -122,14 +122,14 @@ static int dsts_stats_tree_packet(stats_tree* st, packet_info* pinfo, epan_disse
int ip_dst_node;
int proto_node;
tick_stat_node(st, st_str_dsts, 0, FALSE);
tick_stat_node(st, (guint8*)st_str_dsts, 0, FALSE);
g_snprintf(str, sizeof(str),"%s",address_to_str(&pinfo->net_src));
g_snprintf((char*)str, sizeof(str),"%s",address_to_str(&pinfo->net_src));
ip_dst_node = tick_stat_node(st, str, st_node_dsts, TRUE);
proto_node = tick_stat_node(st,port_type_to_str(pinfo->ptype),ip_dst_node,TRUE);
proto_node = tick_stat_node(st,(guint8*)port_type_to_str(pinfo->ptype),ip_dst_node,TRUE);
g_snprintf(str, sizeof(str),"%u",pinfo->destport);
g_snprintf((char*)str, sizeof(str),"%u",pinfo->destport);
tick_stat_node(st,str,proto_node,TRUE);
return 1;
@ -137,9 +137,9 @@ static int dsts_stats_tree_packet(stats_tree* st, packet_info* pinfo, epan_disse
/* register all pinfo trees */
void register_pinfo_stat_trees(void) {
stats_tree_register("ip","ip_hosts",st_str_ip, ip_hosts_stats_tree_packet, ip_hosts_stats_tree_init, NULL );
stats_tree_register("ip","ptype",st_str_ptype, ptype_stats_tree_packet, ptype_stats_tree_init, NULL );
stats_tree_register("frame","plen",st_str_plen, plen_stats_tree_packet, plen_stats_tree_init, NULL );
stats_tree_register("ip","dests",st_str_dsts, dsts_stats_tree_packet, dsts_stats_tree_init, NULL );
stats_tree_register((guint8*)"ip",(guint8*)"ip_hosts",(guint8*)st_str_ip, ip_hosts_stats_tree_packet, ip_hosts_stats_tree_init, NULL );
stats_tree_register((guint8*)"ip",(guint8*)"ptype",(guint8*)st_str_ptype, ptype_stats_tree_packet, ptype_stats_tree_init, NULL );
stats_tree_register((guint8*)"frame",(guint8*)"plen",(guint8*)st_str_plen, plen_stats_tree_packet, plen_stats_tree_init, NULL );
stats_tree_register((guint8*)"ip",(guint8*)"dests",(guint8*)st_str_dsts, dsts_stats_tree_packet, dsts_stats_tree_init, NULL );
}

16
print.c
View File

@ -623,7 +623,7 @@ get_field_data(GSList *src_list, field_info *fi)
static void
print_escaped_xml(FILE *fh, const char *unescaped_string)
{
const unsigned char *p;
const char *p;
for (p = unescaped_string; *p != '\0'; p++) {
switch (*p) {
@ -810,7 +810,7 @@ print_hex_data_buffer(print_stream_t *stream, const guchar *cp,
* and advance the offset.
*/
line[k] = '\0';
if (!print_line(stream, 0, line))
if (!print_line(stream, 0, (char*)line))
return FALSE;
ad += 16;
}
@ -1013,7 +1013,7 @@ static gboolean
print_preamble_ps(print_stream_t *self, gchar *filename)
{
output_ps *output = self->data;
char psbuffer[MAX_PS_LINE_LENGTH]; /* static sized buffer! */
unsigned char psbuffer[MAX_PS_LINE_LENGTH]; /* static sized buffer! */
print_ps_preamble(output->fh);
@ -1021,7 +1021,7 @@ print_preamble_ps(print_stream_t *self, gchar *filename)
fputs("/Courier findfont 10 scalefont setfont\n", output->fh);
fputs("\n", output->fh);
fputs("%% the page title\n", output->fh);
ps_clean_string(psbuffer, filename, MAX_PS_LINE_LENGTH);
ps_clean_string(psbuffer, (guchar*)filename, MAX_PS_LINE_LENGTH);
fprintf(output->fh, "/eth_pagetitle (%s - Wireshark) def\n", psbuffer);
fputs("\n", output->fh);
return !ferror(output->fh);
@ -1031,9 +1031,9 @@ static gboolean
print_line_ps(print_stream_t *self, int indent, const char *line)
{
output_ps *output = self->data;
char psbuffer[MAX_PS_LINE_LENGTH]; /* static sized buffer! */
unsigned char psbuffer[MAX_PS_LINE_LENGTH]; /* static sized buffer! */
ps_clean_string(psbuffer, line, MAX_PS_LINE_LENGTH);
ps_clean_string(psbuffer, (guchar*)line, MAX_PS_LINE_LENGTH);
fprintf(output->fh, "%d (%s) putline\n", indent, psbuffer);
return !ferror(output->fh);
}
@ -1042,7 +1042,7 @@ static gboolean
print_bookmark_ps(print_stream_t *self, const gchar *name, const gchar *title)
{
output_ps *output = self->data;
char psbuffer[MAX_PS_LINE_LENGTH]; /* static sized buffer! */
unsigned char psbuffer[MAX_PS_LINE_LENGTH]; /* static sized buffer! */
/*
* See the Adobe "pdfmark reference":
@ -1057,7 +1057,7 @@ print_bookmark_ps(print_stream_t *self, const gchar *name, const gchar *title)
*
* The "/DEST" creates the destination.
*/
ps_clean_string(psbuffer, title, MAX_PS_LINE_LENGTH);
ps_clean_string(psbuffer, (guchar*)title, MAX_PS_LINE_LENGTH);
fprintf(output->fh, "[/Dest /%s /Title (%s) /OUT pdfmark\n", name,
psbuffer);
fputs("[/View [/XYZ -4 currentpoint matrix currentmatrix matrix defaultmatrix\n",

View File

@ -70,7 +70,7 @@ static void draw_stats_tree(void *psp) {
}
static void init_stats_tree(const char *optarg,void* userdata _U_) {
guint8* abbr = stats_tree_get_abbr(optarg);
guint8* abbr = stats_tree_get_abbr((guint8*)optarg);
GString *error_string;
stats_tree_cfg *cfg = NULL;
stats_tree* st = NULL;
@ -79,8 +79,8 @@ static void init_stats_tree(const char *optarg,void* userdata _U_) {
cfg = stats_tree_get_cfg_by_abbr(abbr);
if (cfg != NULL) {
if (strncmp (optarg, cfg->pr->init_string, strlen(cfg->pr->init_string)) == 0){
st = stats_tree_new(cfg,NULL,((guint8*)optarg)+strlen(cfg->pr->init_string));
if (strncmp (optarg, (char*)cfg->pr->init_string, strlen((char*)cfg->pr->init_string)) == 0){
st = stats_tree_new(cfg,NULL,(char*)(optarg)+strlen((char*)cfg->pr->init_string));
} else {
report_failure("Wrong stats_tree (%s) found when looking at ->init_string",abbr);
return;
@ -97,12 +97,12 @@ static void init_stats_tree(const char *optarg,void* userdata _U_) {
return;
}
error_string = register_tap_listener( st->cfg->tapname,
st,
st->filter,
stats_tree_reset,
stats_tree_packet,
draw_stats_tree);
error_string = register_tap_listener((char*)st->cfg->tapname,
st,
st->filter,
stats_tree_reset,
stats_tree_packet,
draw_stats_tree);
if (error_string) {
report_failure("stats_tree for: %s failed to attach to the tap: %s",cfg->name,error_string->str);
@ -117,9 +117,9 @@ void register_stats_tree_tap (gpointer k _U_, gpointer v, gpointer p _U_) {
stats_tree_cfg* cfg = v;
cfg->pr = g_malloc(sizeof(tree_cfg_pres));
cfg->pr->init_string = g_strdup_printf("%s,tree",cfg->abbr);
cfg->pr->init_string = (guint8*)g_strdup_printf("%s,tree",cfg->abbr);
register_stat_cmd_arg(cfg->pr->init_string, init_stats_tree, NULL);
register_stat_cmd_arg((char*)cfg->pr->init_string, init_stats_tree, NULL);
}

View File

@ -696,7 +696,7 @@ append_to_preamble(char *str)
if (toklen != 0) {
if (packet_preamble_len + toklen > PACKET_PREAMBLE_MAX_LEN)
return; /* no room to add the token to the preamble */
strcpy(&packet_preamble[packet_preamble_len], str);
strcpy((char*)&packet_preamble[packet_preamble_len], str);
packet_preamble_len += toklen;
}
}
@ -731,7 +731,7 @@ parse_preamble (void)
/* Ensure preamble has more than two chars before atempting to parse.
* This should cover line breaks etc that get counted.
*/
if ( strlen(packet_preamble) > 2 ) {
if ( strlen((char*)packet_preamble) > 2 ) {
/*
* Initialize to the Epoch, just in case not all fields
* of the date and time are specified.
@ -747,7 +747,7 @@ parse_preamble (void)
timecode.tm_isdst = -1;
/* Get Time leaving subseconds */
subsecs = strptime( packet_preamble, ts_fmt, &timecode );
subsecs = strptime( (char*)packet_preamble, ts_fmt, &timecode );
if (subsecs != NULL) {
/* Get the long time from the tm structure */
ts_sec = (gint32)mktime( &timecode );

View File

@ -273,7 +273,7 @@ iseries_check_file_type (wtap * wth, int *err, int format)
*/
if (wth->capture.iseries->format == ISERIES_FORMAT_UNICODE)
{
iseries_UNICODE_to_ASCII (buf, ISERIES_LINE_LENGTH);
iseries_UNICODE_to_ASCII ((guint8*)buf, ISERIES_LINE_LENGTH);
}
num_items_scanned = sscanf (buf,
" Object protocol . . . . . . : %8s",
@ -384,7 +384,7 @@ iseries_seek_next_packet (wtap * wth, int *err)
if (wth->capture.iseries->format == ISERIES_FORMAT_UNICODE)
{
/* buflen is #bytes to 1st 0x0A */
buflen = iseries_UNICODE_to_ASCII (buf, ISERIES_LINE_LENGTH);
buflen = iseries_UNICODE_to_ASCII ((guint8*)buf, ISERIES_LINE_LENGTH);
}
else
{
@ -502,7 +502,7 @@ iseries_parse_packet (wtap * wth, FILE_T fh,
/* Convert UNICODE data to ASCII */
if (wth->capture.iseries->format == ISERIES_FORMAT_UNICODE)
{
iseries_UNICODE_to_ASCII (data, ISERIES_LINE_LENGTH);
iseries_UNICODE_to_ASCII ((guint8*)data, ISERIES_LINE_LENGTH);
}
/* look for packet header */
num_items_scanned =
@ -543,7 +543,7 @@ iseries_parse_packet (wtap * wth, FILE_T fh,
if (wth->capture.iseries->sdate)
{
num_items_scanned =
sscanf (wth->capture.iseries->sdate, "%d/%d/%d", &month, &day, &year);
sscanf ((char*)wth->capture.iseries->sdate, "%d/%d/%d", &month, &day, &year);
tm.tm_year = 100 + year;
tm.tm_mon = month - 1;
tm.tm_mday = day;
@ -578,9 +578,9 @@ iseries_parse_packet (wtap * wth, FILE_T fh,
* Allocate 2 work buffers to handle concatentation of the hex data block
*/
tcpdatabuf = g_malloc (ISERIES_PKT_ALLOC_SIZE);
g_snprintf (tcpdatabuf, 1, "%s", "");
g_snprintf ((gchar*)tcpdatabuf, 1, "%s", "");
workbuf = g_malloc (ISERIES_PKT_ALLOC_SIZE);
g_snprintf (workbuf, 1, "%s", "");
g_snprintf ((gchar*)workbuf, 1, "%s", "");
/* loop through packet lines and breakout when the next packet header is read */
pktline = 0;
while (isCurrentPacket)
@ -607,7 +607,7 @@ iseries_parse_packet (wtap * wth, FILE_T fh,
/* Convert UNICODE data to ASCII and determine line length */
if (wth->capture.iseries->format == ISERIES_FORMAT_UNICODE)
{
buflen = iseries_UNICODE_to_ASCII (data, ISERIES_LINE_LENGTH);
buflen = iseries_UNICODE_to_ASCII ((guint8*)data, ISERIES_LINE_LENGTH);
}
else
{
@ -649,19 +649,19 @@ iseries_parse_packet (wtap * wth, FILE_T fh,
switch (num_items_scanned)
{
case 1:
g_snprintf (workbuf, ISERIES_PKT_ALLOC_SIZE, "%s%s", tcpdatabuf,
g_snprintf ((gchar*)workbuf, ISERIES_PKT_ALLOC_SIZE, "%s%s", tcpdatabuf,
hex1);
break;
case 2:
g_snprintf (workbuf, ISERIES_PKT_ALLOC_SIZE, "%s%s%s",
g_snprintf ((gchar*)workbuf, ISERIES_PKT_ALLOC_SIZE, "%s%s%s",
tcpdatabuf, hex1, hex2);
break;
case 3:
g_snprintf (workbuf, ISERIES_PKT_ALLOC_SIZE, "%s%s%s%s",
g_snprintf ((gchar*)workbuf, ISERIES_PKT_ALLOC_SIZE, "%s%s%s%s",
tcpdatabuf, hex1, hex2, hex3);
break;
default:
g_snprintf (workbuf, ISERIES_PKT_ALLOC_SIZE, "%s%s%s%s%s",
g_snprintf ((gchar*)workbuf, ISERIES_PKT_ALLOC_SIZE, "%s%s%s%s%s",
tcpdatabuf, hex1, hex2, hex3, hex4);
}
memcpy (tcpdatabuf, workbuf, ISERIES_PKT_ALLOC_SIZE);
@ -720,20 +720,20 @@ iseries_parse_packet (wtap * wth, FILE_T fh,
if (wth->capture.iseries->tcp_formatted)
{
/* build string for formatted fields */
g_snprintf (asciibuf, ISERIES_PKT_ALLOC_SIZE, "%s%s%s%s%s%s",
g_snprintf ((gchar*)asciibuf, ISERIES_PKT_ALLOC_SIZE, "%s%s%s%s%s%s",
destmac, srcmac, type, ipheader, tcpheader, tcpdatabuf);
}
else
{
/* build string for unformatted data fields */
g_snprintf (asciibuf, ISERIES_PKT_ALLOC_SIZE, "%s%s%s%s", destmac,
g_snprintf ((gchar*)asciibuf, ISERIES_PKT_ALLOC_SIZE, "%s%s%s%s", destmac,
srcmac, type, tcpdatabuf);
}
}
else
{
/* No data in the packet */
g_snprintf (asciibuf, ISERIES_PKT_ALLOC_SIZE, "%s%s%s%s%s", destmac,
g_snprintf ((gchar*)asciibuf, ISERIES_PKT_ALLOC_SIZE, "%s%s%s%s%s", destmac,
srcmac, type, ipheader, tcpheader);
}
@ -741,7 +741,7 @@ iseries_parse_packet (wtap * wth, FILE_T fh,
* Extract the packet length from the actual IP header, this may differ from the capture length
* reported by the formatted trace
*/
num_items_scanned = sscanf (asciibuf + 32, "%4x", &pkt_len);
num_items_scanned = sscanf ((gchar*)asciibuf + 32, "%4x", &pkt_len);
wth->phdr.len = pkt_len + 14;
/* Make sure we have enough room for the packet, only create buffer if none supplied */
@ -750,12 +750,12 @@ iseries_parse_packet (wtap * wth, FILE_T fh,
buffer_assure_space (wth->frame_buffer, ISERIES_MAX_PACKET_LEN);
buf = buffer_start_ptr (wth->frame_buffer);
/* Convert ascii data to binary and return in the frame buffer */
iseries_parse_hex_string (asciibuf, buf, strlen (asciibuf));
iseries_parse_hex_string (asciibuf, buf, strlen ((gchar*)asciibuf));
}
else
{
/* Convert ascii data to binary and return in the frame buffer */
iseries_parse_hex_string (asciibuf, pd, strlen (asciibuf));
iseries_parse_hex_string (asciibuf, pd, strlen ((gchar*)asciibuf));
}
/* free buffers allocs and return */