summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--epan/dissectors/packet-aim.h2
-rw-r--r--epan/dissectors/packet-dcerpc-epm.c2
-rw-r--r--epan/dissectors/packet-dcerpc-samr.c2
-rw-r--r--epan/dissectors/packet-dcerpc.c6
-rw-r--r--epan/dissectors/packet-dcerpc.h6
-rw-r--r--epan/dissectors/packet-dcom.c6
-rw-r--r--epan/dissectors/packet-dcom.h2
-rw-r--r--epan/dissectors/packet-diameter.c4
-rw-r--r--epan/dissectors/packet-giop.h2
-rw-r--r--epan/dissectors/packet-ieee80211.c4
-rw-r--r--epan/dissectors/packet-k12.c8
-rw-r--r--epan/dissectors/packet-ntlmssp.c2
-rw-r--r--epan/dissectors/packet-portmap.c3
-rw-r--r--epan/dissectors/packet-pres.c2
-rw-r--r--epan/dissectors/packet-radius.c4
-rw-r--r--epan/dissectors/packet-rpc.c6
-rw-r--r--epan/dissectors/packet-rpc.h4
-rw-r--r--epan/dissectors/packet-snmp.c4
-rw-r--r--epan/dissectors/packet-spnego.c2
-rw-r--r--epan/dissectors/packet-tacacs.c33
-rw-r--r--epan/dissectors/packet-tzsp.c2
-rw-r--r--epan/dissectors/packet-user_encap.c6
-rw-r--r--epan/packet.c8
-rw-r--r--epan/packet.h6
-rw-r--r--epan/prefs-int.h2
-rw-r--r--epan/prefs.c2
-rw-r--r--epan/proto.c28
-rw-r--r--epan/proto.h6
-rw-r--r--gtk/dcerpc_stat.c10
-rw-r--r--gtk/decode_as_dcerpc.h8
-rw-r--r--gtk/decode_as_dlg.c23
-rw-r--r--gtk/dfilter_expr_dlg.c4
-rw-r--r--gtk/prefs_dlg.c4
-rw-r--r--gtk/proto_dlg.c12
-rw-r--r--gtk/rpc_stat.c6
-rw-r--r--gtk/supported_protos_dlg.c8
-rw-r--r--tap-dcerpcstat.c4
-rw-r--r--tap-rpcstat.c2
-rw-r--r--tethereal.c3
39 files changed, 125 insertions, 123 deletions
diff --git a/epan/dissectors/packet-aim.h b/epan/dissectors/packet-aim.h
index b30556173b..12f13c624c 100644
--- a/epan/dissectors/packet-aim.h
+++ b/epan/dissectors/packet-aim.h
@@ -53,7 +53,7 @@ typedef struct _aim_family {
int proto_id;
protocol_t *proto;
guint16 family;
- char *name;
+ const char *name;
const aim_subtype *subtypes;
} aim_family;
diff --git a/epan/dissectors/packet-dcerpc-epm.c b/epan/dissectors/packet-dcerpc-epm.c
index fb97716e3c..26b90c71cd 100644
--- a/epan/dissectors/packet-dcerpc-epm.c
+++ b/epan/dissectors/packet-dcerpc-epm.c
@@ -367,7 +367,7 @@ epm_dissect_tower_data (tvbuff_t *tvb, int offset,
{
guint16 version = tvb_get_ntohs(tvb, offset+17);
- char *service = dcerpc_get_proto_name(&uuid, version);
+ const char *service = dcerpc_get_proto_name(&uuid, version);
if (service)
proto_item_append_text(tr, "UUID: %s", service);
else
diff --git a/epan/dissectors/packet-dcerpc-samr.c b/epan/dissectors/packet-dcerpc-samr.c
index e32c5aff58..43634d7c0c 100644
--- a/epan/dissectors/packet-dcerpc-samr.c
+++ b/epan/dissectors/packet-dcerpc-samr.c
@@ -195,7 +195,7 @@ static e_uuid_t uuid_dcerpc_samr = {
static guint16 ver_dcerpc_samr = 1;
/* Configuration variables */
-static char *nt_password = NULL;
+static const char *nt_password = NULL;
/* Dissect connect specific access rights */
diff --git a/epan/dissectors/packet-dcerpc.c b/epan/dissectors/packet-dcerpc.c
index 220095290d..46db718396 100644
--- a/epan/dissectors/packet-dcerpc.c
+++ b/epan/dissectors/packet-dcerpc.c
@@ -680,7 +680,7 @@ dcerpc_init_uuid (int proto, int ett, e_uuid_t *uuid, guint16 ver,
/* try to get registered name for this uuid */
-gchar *dcerpc_get_uuid_name(e_uuid_t *uuid, guint16 ver)
+const gchar *dcerpc_get_uuid_name(e_uuid_t *uuid, guint16 ver)
{
dcerpc_uuid_key key;
dcerpc_uuid_value *sub_proto;
@@ -703,7 +703,7 @@ gchar *dcerpc_get_uuid_name(e_uuid_t *uuid, guint16 ver)
/* Function to find the name of a registered protocol
* or NULL if the protocol/version is not known to ethereal.
*/
-char *
+const char *
dcerpc_get_proto_name(e_uuid_t *uuid, guint16 ver)
{
dcerpc_uuid_key key;
@@ -2174,7 +2174,7 @@ dcerpc_try_handoff (packet_info *pinfo, proto_tree *tree,
dcerpc_uuid_value *sub_proto;
proto_tree *volatile sub_tree = NULL;
dcerpc_sub_dissector *proc;
- gchar *name = NULL;
+ const gchar *name = NULL;
dcerpc_dissect_fnct_t *volatile sub_dissect;
const char *volatile saved_proto;
void *volatile saved_private_data;
diff --git a/epan/dissectors/packet-dcerpc.h b/epan/dissectors/packet-dcerpc.h
index 0410be2b91..b3374cdb3a 100644
--- a/epan/dissectors/packet-dcerpc.h
+++ b/epan/dissectors/packet-dcerpc.h
@@ -245,7 +245,7 @@ typedef struct _dcerpc_sub_dissector {
/* registration function for subdissectors */
void dcerpc_init_uuid (int proto, int ett, e_uuid_t *uuid, guint16 ver, dcerpc_sub_dissector *procs, int opnum_hf);
-char *dcerpc_get_proto_name(e_uuid_t *uuid, guint16 ver);
+const char *dcerpc_get_proto_name(e_uuid_t *uuid, guint16 ver);
int dcerpc_get_proto_hf_opnum(e_uuid_t *uuid, guint16 ver);
dcerpc_sub_dissector *dcerpc_get_proto_sub_dissector(e_uuid_t *uuid, guint16 ver);
@@ -254,7 +254,7 @@ dcerpc_sub_dissector *dcerpc_get_proto_sub_dissector(e_uuid_t *uuid, guint16 ver
value_string *value_string_from_subdissectors(dcerpc_sub_dissector *sd);
/* try to get protocol name registered for this uuid */
-gchar *dcerpc_get_uuid_name(e_uuid_t *uuid, guint16 ver);
+const gchar *dcerpc_get_uuid_name(e_uuid_t *uuid, guint16 ver);
/* Private data passed to subdissectors from the main DCERPC dissector. */
typedef struct _dcerpc_call_value {
@@ -306,7 +306,7 @@ typedef struct _dcerpc_uuid_value {
protocol_t *proto;
int proto_id;
int ett;
- gchar *name;
+ const gchar *name;
dcerpc_sub_dissector *procs;
int opnum_hf;
} dcerpc_uuid_value;
diff --git a/epan/dissectors/packet-dcom.c b/epan/dissectors/packet-dcom.c
index 23e8e65565..8c0ab83222 100644
--- a/epan/dissectors/packet-dcom.c
+++ b/epan/dissectors/packet-dcom.c
@@ -658,8 +658,8 @@ dissect_dcom_simple_resp(tvbuff_t *tvb, int offset,
Returns the associated string ptr on a match.
Formats uuid number and returns the resulting string, on failure.
(copied from val_to_str) */
-gchar* dcom_uuid_to_str(e_uuid_t *uuid) {
- gchar *ret;
+const gchar* dcom_uuid_to_str(e_uuid_t *uuid) {
+ const gchar *ret;
static gchar str[3][64];
static gchar *cur;
@@ -1154,7 +1154,7 @@ dissect_dcom_append_UUID(tvbuff_t *tvb, int offset,
int hfindex, gchar *field_name, int field_index)
{
e_uuid_t uuid;
- gchar *uuid_name;
+ const gchar *uuid_name;
offset = dissect_dcom_UUID(tvb, offset, pinfo, tree, drep,
diff --git a/epan/dissectors/packet-dcom.h b/epan/dissectors/packet-dcom.h
index cfa8072d3f..97d6fdb87d 100644
--- a/epan/dissectors/packet-dcom.h
+++ b/epan/dissectors/packet-dcom.h
@@ -60,7 +60,7 @@ extern int
dissect_dcom_append_UUID(tvbuff_t *tvb, int offset,
packet_info *pinfo, proto_tree *tree, guint8 *drep,
int hfindex, gchar *field_name, int field_index);
-extern gchar* dcom_uuid_to_str(e_uuid_t *uuid);
+extern const gchar* dcom_uuid_to_str(e_uuid_t *uuid);
extern int
dissect_dcom_indexed_WORD(tvbuff_t *tvb, int offset, packet_info *pinfo,
diff --git a/epan/dissectors/packet-diameter.c b/epan/dissectors/packet-diameter.c
index f2fdc99664..04117acb36 100644
--- a/epan/dissectors/packet-diameter.c
+++ b/epan/dissectors/packet-diameter.c
@@ -248,7 +248,7 @@ static gboolean allow_zero_as_app_id = FALSE;
static gboolean suppress_console_output = TRUE;
#define DICT_FN "diameter/dictionary.xml"
-static gchar *gbl_diameterDictionary;
+static const gchar *gbl_diameterDictionary;
typedef struct _e_diameterhdr_v16 {
guint32 versionLength;
@@ -316,7 +316,7 @@ static gchar *diameter_vendor_to_str(guint32 vendorId, gboolean longName);
* the xmlsoft examples.
*/
static xmlDocPtr
-xmlParseFilePush( char *filename, int checkValid
+xmlParseFilePush( const char *filename, int checkValid
#ifndef ETHEREAL_XML_DO_VALIDITY_CHECKING
_U_
#endif
diff --git a/epan/dissectors/packet-giop.h b/epan/dissectors/packet-giop.h
index e6f837f3ab..beb877ba51 100644
--- a/epan/dissectors/packet-giop.h
+++ b/epan/dissectors/packet-giop.h
@@ -105,7 +105,7 @@ typedef gboolean (giop_sub_dissector_t)(tvbuff_t *, packet_info *, proto_tree *,
typedef struct giop_sub_handle {
giop_sub_dissector_t *sub_fn; /* ptr to sub dissector function */
- gchar *sub_name; /* subdissector string name */
+ const gchar *sub_name; /* subdissector string name */
protocol_t *sub_proto; /* protocol_t for subprotocol */
} giop_sub_handle_t;
diff --git a/epan/dissectors/packet-ieee80211.c b/epan/dissectors/packet-ieee80211.c
index 2dd6686e7a..9bd4d07d7d 100644
--- a/epan/dissectors/packet-ieee80211.c
+++ b/epan/dissectors/packet-ieee80211.c
@@ -110,7 +110,7 @@ static int weak_iv(guchar *iv);
*/
#ifndef USE_ENV
-static char *wep_keystr[] = {NULL, NULL, NULL, NULL};
+static const char *wep_keystr[] = {NULL, NULL, NULL, NULL};
#endif
/* ************************************************************************* */
@@ -3589,7 +3589,7 @@ static int wep_decrypt(guint8 *buf, guint32 len, int key_override) {
}
static void init_wepkeys(void) {
- char *tmp;
+ const char *tmp;
int i;
GByteArray *bytes;
gboolean res;
diff --git a/epan/dissectors/packet-k12.c b/epan/dissectors/packet-k12.c
index 2a1f230d3c..fc561a5414 100644
--- a/epan/dissectors/packet-k12.c
+++ b/epan/dissectors/packet-k12.c
@@ -55,7 +55,7 @@ static dissector_handle_t data_handle;
static module_t *k12_module;
-static char* k12_config_filename = "";
+static const char* k12_config_filename = "";
static GHashTable* k12_cfg = NULL;
@@ -119,7 +119,7 @@ static gboolean free_just_key (gpointer k, gpointer v _U_, gpointer p _U_) {
}
-static GHashTable* k12_load_config(gchar* filename) {
+static GHashTable* k12_load_config(const gchar* filename) {
FILE* fp;
gchar buffer[0x10000];
size_t len;
@@ -193,8 +193,8 @@ static void k12_load_prefs(void) {
}
if (*k12_config_filename != '\0') {
- k12_cfg = k12_load_config(k12_config_filename);
- return;
+ k12_cfg = k12_load_config(k12_config_filename);
+ return;
}
}
diff --git a/epan/dissectors/packet-ntlmssp.c b/epan/dissectors/packet-ntlmssp.c
index 88fd3ad430..1a48a3ef7f 100644
--- a/epan/dissectors/packet-ntlmssp.c
+++ b/epan/dissectors/packet-ntlmssp.c
@@ -213,7 +213,7 @@ static gint ett_ntlmssp_ntlmv2_response = -1;
static gint ett_ntlmssp_ntlmv2_response_name = -1;
/* Configuration variables */
-static char *nt_password = NULL;
+static const char *nt_password = NULL;
#define MAX_BLOB_SIZE 256
typedef struct _ntlmssp_blob {
diff --git a/epan/dissectors/packet-portmap.c b/epan/dissectors/packet-portmap.c
index a620b7ef6f..6d938e782d 100644
--- a/epan/dissectors/packet-portmap.c
+++ b/epan/dissectors/packet-portmap.c
@@ -78,7 +78,8 @@ dissect_getport_call(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
{
guint32 proto, version;
guint32 prog;
- char *prog_name, *proto_name;
+ const char *prog_name;
+ char *proto_name;
/* make sure we remember protocol type until the reply packet */
if(!pinfo->fd->flags.visited){
diff --git a/epan/dissectors/packet-pres.c b/epan/dissectors/packet-pres.c
index 8cf3721dd8..afe3ee7d34 100644
--- a/epan/dissectors/packet-pres.c
+++ b/epan/dissectors/packet-pres.c
@@ -1084,7 +1084,7 @@ static void
dissect_parse_error(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree, const char *field_name, int ret)
{
- char *errstr;
+ const char *errstr;
errstr = asn1_err_to_str(ret);
if (tree != NULL)
diff --git a/epan/dissectors/packet-radius.c b/epan/dissectors/packet-radius.c
index 99d81190ff..d6bf313d63 100644
--- a/epan/dissectors/packet-radius.c
+++ b/epan/dissectors/packet-radius.c
@@ -134,7 +134,7 @@ radius_attr_info_t no_dictionary_entry = {"Unknown-Attribute",0,FALSE,FALSE,radi
dissector_handle_t eap_fragment_handle;
-static gchar* shared_secret = "";
+static const gchar* shared_secret = "";
static guint8 authenticator[AUTHENTICATOR_LENGTH];
@@ -201,7 +201,7 @@ radius_decrypt_avp(gchar *dest,tvbuff_t *tvb,int offset,int length)
totlen = 1;
md5_init(&md_ctx);
- md5_append(&md_ctx,(guint8*)shared_secret,strlen(shared_secret));
+ md5_append(&md_ctx,(const guint8*)shared_secret,strlen(shared_secret));
md5_append(&md_ctx,authenticator, AUTHENTICATOR_LENGTH);
md5_finish(&md_ctx,digest);
diff --git a/epan/dissectors/packet-rpc.c b/epan/dissectors/packet-rpc.c
index a26b8eae07..9999b35750 100644
--- a/epan/dissectors/packet-rpc.c
+++ b/epan/dissectors/packet-rpc.c
@@ -424,9 +424,9 @@ int rpc_prog_hf(guint32 prog, guint32 vers)
/* return the name associated with a previously registered program. This
should probably eventually be expanded to use the rpc YP/NIS map
so that it can give names for programs not handled by ethereal */
-char *rpc_prog_name(guint32 prog)
+const char *rpc_prog_name(guint32 prog)
{
- char *progname = NULL;
+ const char *progname = NULL;
rpc_prog_info_key rpc_prog_key;
rpc_prog_info_value *rpc_prog;
@@ -1657,7 +1657,7 @@ dissect_rpc_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
unsigned int reject_state;
const char *msg_type_name = NULL;
- char *progname = NULL;
+ const char *progname = NULL;
const char *procname = NULL;
static char procname_static[20];
diff --git a/epan/dissectors/packet-rpc.h b/epan/dissectors/packet-rpc.h
index 3f2d97e76f..5dadf15fc8 100644
--- a/epan/dissectors/packet-rpc.h
+++ b/epan/dissectors/packet-rpc.h
@@ -120,7 +120,7 @@ extern const value_string rpc_auth_flavor[];
extern void rpc_init_proc_table(guint prog, guint vers, const vsff *proc_table,
int procedure_hf);
extern void rpc_init_prog(int proto, guint32 prog, int ett);
-extern char *rpc_prog_name(guint32 prog);
+extern const char *rpc_prog_name(guint32 prog);
extern char *rpc_proc_name(guint32 prog, guint32 vers, guint32 proc);
extern int rpc_prog_hf(guint32 prog, guint32 vers);
@@ -167,7 +167,7 @@ typedef struct _rpc_prog_info_value {
protocol_t *proto;
int proto_id;
int ett;
- char* progname;
+ const char* progname;
GArray *procedure_hfs;
} rpc_prog_info_value;
diff --git a/epan/dissectors/packet-snmp.c b/epan/dissectors/packet-snmp.c
index ba5ff32714..bd2f887d47 100644
--- a/epan/dissectors/packet-snmp.c
+++ b/epan/dissectors/packet-snmp.c
@@ -131,7 +131,7 @@ static int proto_snmp = -1;
# define DEF_MIB_MODULES "IP-MIB:IF-MIB:TCP-MIB:UDP-MIB:SNMPv2-MIB:RFC1213-MIB:UCD-SNMP-MIB"
#endif /* _WIN32 */
-static gchar *mib_modules = DEF_MIB_MODULES;
+static const gchar *mib_modules = DEF_MIB_MODULES;
static gboolean display_oid = TRUE;
/* Subdissector tables */
@@ -534,7 +534,7 @@ static void
dissect_snmp_parse_error(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree, const char *field_name, int ret)
{
- char *errstr;
+ const char *errstr;
errstr = asn1_err_to_str(ret);
diff --git a/epan/dissectors/packet-spnego.c b/epan/dissectors/packet-spnego.c
index 609a013d26..715adee18f 100644
--- a/epan/dissectors/packet-spnego.c
+++ b/epan/dissectors/packet-spnego.c
@@ -198,7 +198,7 @@ static void
dissect_parse_error(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree, const char *field_name, int ret)
{
- char *errstr;
+ const char *errstr;
errstr = asn1_err_to_str(ret);
diff --git a/epan/dissectors/packet-tacacs.c b/epan/dissectors/packet-tacacs.c
index f7a2435aa2..07c6cc02d0 100644
--- a/epan/dissectors/packet-tacacs.c
+++ b/epan/dissectors/packet-tacacs.c
@@ -69,7 +69,7 @@
#include <epan/crypt-md5.h>
#include "packet-tacacs.h"
-static void md5_xor( guint8 *data, char *key, int data_len, guint8 *session_id, guint8 version, guint8 seq_no );
+static void md5_xor( guint8 *data, const char *key, int data_len, guint8 *session_id, guint8 version, guint8 seq_no );
static int proto_tacacs = -1;
static int hf_tacacs_version = -1;
@@ -88,7 +88,7 @@ static int hf_tacacs_result3 = -1;
static gint ett_tacacs = -1;
-static char *tacplus_opt_key;
+static const char *tacplus_opt_key;
static GSList *tacplus_keys = NULL;
#define VERSION_TACACS 0x00
@@ -343,7 +343,7 @@ typedef struct _tacplus_key_entry {
} tacplus_key_entry;
static gint
-tacplus_decrypted_tvb_setup( tvbuff_t *tvb, tvbuff_t **dst_tvb, packet_info *pinfo, guint32 len, guint8 version, char *key )
+tacplus_decrypted_tvb_setup( tvbuff_t *tvb, tvbuff_t **dst_tvb, packet_info *pinfo, guint32 len, guint8 version, const char *key )
{
guint8 *buff;
guint8 session_id[4];
@@ -828,7 +828,7 @@ cmp_conv_address( gconstpointer p1, gconstpointer p2 )
return ret;
}
-static char*
+static const char*
find_key( address *srv, address *cln )
{
tacplus_key_entry data;
@@ -892,9 +892,9 @@ free_tacplus_keys( gpointer data, gpointer user_data _U_ )
static
void
-parse_tacplus_keys( char *keys_from_option )
+parse_tacplus_keys( const char *keys_from_option )
{
- char *s1,*s;
+ char *key_copy,*s,*s1;
/* Drop old keys */
if( tacplus_keys ) {
@@ -907,16 +907,15 @@ parse_tacplus_keys( char *keys_from_option )
/* option not in client/server=key format */
return ;
}
- s=strdup(keys_from_option);
- s1=s;
- keys_from_option = s;
- while(keys_from_option){
- if( (s=strchr( keys_from_option, ' ' )) != NULL )
- *s++='\0';
- parse_tuple( keys_from_option );
- keys_from_option=s;
+ key_copy=strdup(keys_from_option);
+ s=key_copy;
+ while(s){
+ if( (s1=strchr( s, ' ' )) != NULL )
+ *s1++='\0';
+ parse_tuple( s );
+ s=s1;
}
- g_free( s1 );
+ g_free( key_copy );
#ifdef DEB_TACPLUS
g_slist_foreach( tacplus_keys, tacplus_print_key_entry, GINT_TO_POINTER(1) );
#endif
@@ -934,7 +933,7 @@ dissect_tacplus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_item *tmp_pi;
guint32 len;
gboolean request=( pinfo->destport == TCP_PORT_TACACS );
- char *key=NULL;
+ const char *key=NULL;
if( request ) {
key=find_key( &pinfo->dst, &pinfo->src );
@@ -1111,7 +1110,7 @@ proto_reg_handoff_tacplus(void)
#define MD5_LEN 16
static void
-md5_xor( guint8 *data, char *key, int data_len, guint8 *session_id, guint8 version, guint8 seq_no )
+md5_xor( guint8 *data, const char *key, int data_len, guint8 *session_id, guint8 version, guint8 seq_no )
{
int i,j,md5_len;
md5_byte_t *md5_buff;
diff --git a/epan/dissectors/packet-tzsp.c b/epan/dissectors/packet-tzsp.c
index 79bbfe6a6c..29bb63f7cc 100644
--- a/epan/dissectors/packet-tzsp.c
+++ b/epan/dissectors/packet-tzsp.c
@@ -286,7 +286,7 @@ dissect_tzsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
guint16 encapsulation = 0;
int wtap_encap;
dissector_handle_t encap_dissector;
- char *encap_name;
+ const char *encap_name;
const char *info;
guint8 type;
diff --git a/epan/dissectors/packet-user_encap.c b/epan/dissectors/packet-user_encap.c
index d8a43c1ed1..5bdcbb3c82 100644
--- a/epan/dissectors/packet-user_encap.c
+++ b/epan/dissectors/packet-user_encap.c
@@ -42,9 +42,9 @@ typedef struct _user_encap_t {
gchar* abbr;
gchar* long_name;
- gchar* payload;
- gchar* header;
- gchar* trailer;
+ const gchar* payload;
+ const gchar* header;
+ const gchar* trailer;
guint header_size;
guint trailer_size;
diff --git a/epan/packet.c b/epan/packet.c
index f47faeae63..bb33f54b88 100644
--- a/epan/packet.c
+++ b/epan/packet.c
@@ -937,7 +937,7 @@ dissector_add_string(const char *name, const gchar *pattern,
dtbl_entry->initial = dtbl_entry->current;
/* do the table insertion */
- g_hash_table_insert( sub_dissectors->hash_table, pattern,
+ g_hash_table_insert( sub_dissectors->hash_table, (gpointer)pattern,
(gpointer)dtbl_entry);
/*
@@ -1417,7 +1417,7 @@ register_dissector_table(const char *name, const char *ui_name, ftenum_t type,
return sub_dissectors;
}
-char *
+const char *
get_dissector_table_ui_name(const char *name)
{
dissector_table_t sub_dissectors = find_dissector_table( name);
@@ -1583,7 +1583,7 @@ static GHashTable *registered_dissectors = NULL;
/* Get the short name of the protocol for a dissector handle, if it has
a protocol. */
-char *
+const char *
dissector_handle_get_short_name(dissector_handle_t handle)
{
if (handle->protocol == NULL) {
@@ -1758,7 +1758,7 @@ dissector_dump_decodes_display(gchar *table_name, ftenum_t selector_type _U_,
dtbl_entry_t *dtbl_entry;
dissector_handle_t handle;
gint proto_id;
- gchar *decode_as;
+ const gchar *decode_as;
g_assert(sub_dissectors);
switch (sub_dissectors->type) {
diff --git a/epan/packet.h b/epan/packet.h
index 05f6195eb7..04df470356 100644
--- a/epan/packet.h
+++ b/epan/packet.h
@@ -142,7 +142,7 @@ typedef void (*DATFunc) (gchar *table_name, ftenum_t selector_type,
gpointer key, gpointer value, gpointer user_data);
typedef void (*DATFunc_handle) (gchar *table_name, gpointer value,
gpointer user_data);
-typedef void (*DATFunc_table) (gchar *table_name, gchar *ui_name,
+typedef void (*DATFunc_table) (gchar *table_name, const gchar *ui_name,
gpointer user_data);
/* Opaque structure - provides type checking but no access to components */
@@ -169,7 +169,7 @@ extern dissector_table_t register_dissector_table(const char *name,
extern dissector_table_t find_dissector_table(const char *name);
/* Get the UI name for a sub-dissector table, given its internal name */
-extern char *get_dissector_table_ui_name(const char *name);
+extern const char *get_dissector_table_ui_name(const char *name);
/* Get the field type for values of the selector for a dissector table,
given the table's internal name */
@@ -284,7 +284,7 @@ extern void new_register_dissector(const char *name, new_dissector_t dissector,
int proto);
/* Get the short name of the protocol for a dissector handle. */
-extern char *dissector_handle_get_short_name(dissector_handle_t handle);
+extern const char *dissector_handle_get_short_name(dissector_handle_t handle);
/* Get the index of the protocol for a dissector handle. */
extern int dissector_handle_get_protocol_index(dissector_handle_t handle);
diff --git a/epan/prefs-int.h b/epan/prefs-int.h
index cbcec1d52a..e3aaabddfd 100644
--- a/epan/prefs-int.h
+++ b/epan/prefs-int.h
@@ -67,7 +67,7 @@ struct preference {
guint *uint;
gboolean *boolp;
gint *enump;
- char **string;
+ const char **string;
range_t **range;
} varp; /* pointer to variable storing the value */
union {
diff --git a/epan/prefs.c b/epan/prefs.c
index 58750e152c..a2dcc2019d 100644
--- a/epan/prefs.c
+++ b/epan/prefs.c
@@ -2046,7 +2046,7 @@ set_pref(gchar *pref_name, gchar *value)
case PREF_STRING:
if (strcmp(*pref->varp.string, value) != 0) {
module->prefs_changed = TRUE;
- g_free(*pref->varp.string);
+ g_free((void *)*pref->varp.string);
*pref->varp.string = g_strdup(value);
}
break;
diff --git a/epan/proto.c b/epan/proto.c
index f080b69ad8..3b6a284afd 100644
--- a/epan/proto.c
+++ b/epan/proto.c
@@ -165,14 +165,14 @@ int hf_text_only = -1;
/* Structure for information about a protocol */
struct _protocol {
- char *name; /* long description */
- char *short_name; /* short description */
- char *filter_name; /* name of this protocol in filters */
- int proto_id; /* field ID for this protocol */
- GList *fields; /* fields for this protocol */
- GList *last_field; /* pointer to end of list of fields */
- gboolean is_enabled; /* TRUE if protocol is enabled */
- gboolean can_toggle; /* TRUE if is_enabled can be changed */
+ const char *name; /* long description */
+ const char *short_name; /* short description */
+ const char *filter_name; /* name of this protocol in filters */
+ int proto_id; /* field ID for this protocol */
+ GList *fields; /* fields for this protocol */
+ GList *last_field; /* pointer to end of list of fields */
+ gboolean is_enabled; /* TRUE if protocol is enabled */
+ gboolean can_toggle; /* TRUE if is_enabled can be changed */
};
/* List of all protocols */
@@ -2648,7 +2648,7 @@ proto_register_protocol(const char *name, const char *short_name, const char *fi
g_error("Duplicate protocol name \"%s\"!"
" This might be caused by an inappropriate plugin or a development error.", name);
}
- g_hash_table_insert(proto_names, key, name);
+ g_hash_table_insert(proto_names, key, (gpointer)name);
key = g_malloc (sizeof(gint));
*key = g_str_hash(short_name);
@@ -2657,7 +2657,7 @@ proto_register_protocol(const char *name, const char *short_name, const char *fi
g_error("Duplicate protocol short_name \"%s\"!"
" This might be caused by an inappropriate plugin or a development error.", short_name);
}
- g_hash_table_insert(proto_short_names, key, short_name);
+ g_hash_table_insert(proto_short_names, key, (gpointer)short_name);
found_invalid = FALSE;
for (i = 0; i < strlen(filter_name); i++) {
@@ -2679,7 +2679,7 @@ proto_register_protocol(const char *name, const char *short_name, const char *fi
g_error("Duplicate protocol filter_name \"%s\"!"
" This might be caused by an inappropriate plugin or a development error.", filter_name);
}
- g_hash_table_insert(proto_filter_names, key, filter_name);
+ g_hash_table_insert(proto_filter_names, key, (gpointer)filter_name);
/* Add this protocol to the list of known protocols; the list
is sorted by protocol short name. */
@@ -2813,7 +2813,7 @@ int proto_get_id_by_filter_name(const gchar* filter_name)
return protocol->proto_id;
}
-char *
+const char *
proto_get_protocol_name(int proto_id)
{
protocol_t *protocol;
@@ -2822,7 +2822,7 @@ proto_get_protocol_name(int proto_id)
return protocol->name;
}
-char *
+const char *
proto_get_protocol_short_name(protocol_t *protocol)
{
if (protocol == NULL)
@@ -2830,7 +2830,7 @@ proto_get_protocol_short_name(protocol_t *protocol)
return protocol->short_name;
}
-char *
+const char *
proto_get_protocol_filter_name(int proto_id)
{
protocol_t *protocol;
diff --git a/epan/proto.h b/epan/proto.h
index c8675054a4..859c484f74 100644
--- a/epan/proto.h
+++ b/epan/proto.h
@@ -1058,7 +1058,7 @@ extern protocol_t *find_protocol_by_id(int proto_id);
/** Get the protocol's name for the given protocol's item number.
@param proto_id protocol id (0-indexed)
@return its name */
-extern char *proto_get_protocol_name(int proto_id);
+extern const char *proto_get_protocol_name(int proto_id);
/** Get the protocol's item number, for the given protocol's "protocol_t".
@return its proto_id */
@@ -1066,7 +1066,7 @@ extern int proto_get_id(protocol_t *protocol);
/** Get the protocol's short name, for the given protocol's "protocol_t".
@return its short name. */
-extern char *proto_get_protocol_short_name(protocol_t *protocol);
+extern const char *proto_get_protocol_short_name(protocol_t *protocol);
/** Is protocol's decoding enabled ?
@param protocol
@@ -1076,7 +1076,7 @@ extern gboolean proto_is_protocol_enabled(protocol_t *protocol);
/** Get a protocol's filter name by it's item number.
@param proto_id protocol id (0-indexed)
@return its filter name. */
-extern char *proto_get_protocol_filter_name(int proto_id);
+extern const char *proto_get_protocol_filter_name(int proto_id);
/** Enable / Disable protocol of the given item number.
@param proto_id protocol id (0-indexed)
diff --git a/gtk/dcerpc_stat.c b/gtk/dcerpc_stat.c
index 2947fa1b3d..fa04c4a8ba 100644
--- a/gtk/dcerpc_stat.c
+++ b/gtk/dcerpc_stat.c
@@ -58,7 +58,7 @@
typedef struct _rpcstat_t {
GtkWidget *win;
srt_stat_table srt_table;
- char *prog;
+ const char *prog;
e_uuid_t uuid;
guint16 ver;
int num_procedures;
@@ -193,8 +193,8 @@ gtk_dcerpcstat_init(char *optarg)
GtkWidget *vbox;
GtkWidget *stat_label;
GtkWidget *filter_label;
- GtkWidget *bbox;
- GtkWidget *close_bt;
+ GtkWidget *bbox;
+ GtkWidget *close_bt;
dcerpc_sub_dissector *procs;
e_uuid_t uuid;
guint d1,d2,d3,d40,d41,d42,d43,d44,d45,d46,d47;
@@ -295,7 +295,7 @@ gtk_dcerpcstat_init(char *optarg)
for(i=0;i<(max_procs+1);i++){
int j;
- char *proc_name;
+ const char *proc_name;
proc_name="unknown";
for(j=0;procs[j].name;j++){
@@ -431,7 +431,7 @@ static GtkWidget *program_submenu_menu;
static GtkWidget *program_submenu_item;
static GtkWidget *program_submenu_label;
static int program_subitem_index;
-static char *first_menu_name;
+static const char *first_menu_name;
static void
dcerpcstat_add_program_to_menu(dcerpc_uuid_key *k, dcerpc_uuid_value *v)
{
diff --git a/gtk/decode_as_dcerpc.h b/gtk/decode_as_dcerpc.h
index 92f130d7bf..6b1dcc26eb 100644
--- a/gtk/decode_as_dcerpc.h
+++ b/gtk/decode_as_dcerpc.h
@@ -97,10 +97,10 @@ decode_dcerpc_binding_free(void *binding);
extern void
decode_add_to_show_list (
gpointer list_data,
-gchar *table_name,
+const gchar *table_name,
gchar *selector_name,
-gchar *initial_proto_name,
-gchar *current_proto_name);
+const gchar *initial_proto_name,
+const gchar *current_proto_name);
/*
@@ -124,7 +124,7 @@ gchar *current_proto_name);
* to store any information generated by this routine.
*/
extern void
-decode_add_to_list (gchar *table_name, gchar *proto_name, gpointer value, gpointer user_data);
+decode_add_to_list (gchar *table_name, const gchar *proto_name, gpointer value, gpointer user_data);
/*
* This routine starts the creation of a List on a notebook page. It
diff --git a/gtk/decode_as_dlg.c b/gtk/decode_as_dlg.c
index 0c0347ab37..d874e89812 100644
--- a/gtk/decode_as_dlg.c
+++ b/gtk/decode_as_dlg.c
@@ -260,10 +260,10 @@ gpointer userdata)
void
decode_add_to_show_list (
gpointer list_data,
-gchar *table_name,
+const gchar *table_name,
gchar *selector_name,
-gchar *initial_proto_name,
-gchar *current_proto_name)
+const gchar *initial_proto_name,
+const gchar *current_proto_name)
{
gchar *text[E_LIST_D_COLUMNS];
#if GTK_MAJOR_VERSION < 2
@@ -280,10 +280,10 @@ gchar *current_proto_name)
store = (GtkListStore *)list_data;
#endif
- text[E_LIST_D_TABLE] = table_name;
+ text[E_LIST_D_TABLE] = (char *)table_name;
text[E_LIST_D_SELECTOR] = selector_name;
- text[E_LIST_D_INITIAL] = initial_proto_name;
- text[E_LIST_D_CURRENT] = current_proto_name;
+ text[E_LIST_D_INITIAL] = (char *)initial_proto_name;
+ text[E_LIST_D_CURRENT] = (char *)current_proto_name;
#if GTK_MAJOR_VERSION < 2
row = gtk_clist_prepend(clist, text);
#else
@@ -320,8 +320,9 @@ decode_build_show_list (gchar *table_name, ftenum_t selector_type,
gpointer key, gpointer value, gpointer user_data)
{
dissector_handle_t current, initial;
- gchar *current_proto_name, *initial_proto_name, *selector_name;
- gchar string1[20];
+ const gchar *current_proto_name, *initial_proto_name;
+ gchar *selector_name;
+ gchar string1[20];
g_assert(user_data);
g_assert(value);
@@ -1229,7 +1230,7 @@ lookup_handle(GtkTreeModel *model, GtkTreePath *path _U_, GtkTreeIter *iter,
* to store any information generated by this routine.
*/
void
-decode_add_to_list (gchar *table_name, gchar *proto_name, gpointer value, gpointer user_data)
+decode_add_to_list (gchar *table_name, const gchar *proto_name, gpointer value, gpointer user_data)
{
gchar *text[E_LIST_S_COLUMNS];
#if GTK_MAJOR_VERSION < 2
@@ -1262,7 +1263,7 @@ decode_add_to_list (gchar *table_name, gchar *proto_name, gpointer value, gpoint
if (hli.found) return;
#endif
- text[E_LIST_S_PROTO_NAME] = proto_name;
+ text[E_LIST_S_PROTO_NAME] = (char *)proto_name;
text[E_LIST_S_TABLE] = table_name;
#if GTK_MAJOR_VERSION < 2
row = gtk_clist_prepend(list, text);
@@ -1279,7 +1280,7 @@ decode_add_to_list (gchar *table_name, gchar *proto_name, gpointer value, gpoint
static void
decode_proto_add_to_list (gchar *table_name, gpointer value, gpointer user_data)
{
- gchar *proto_name;
+ const gchar *proto_name;
gint i;
dissector_handle_t handle;
diff --git a/gtk/dfilter_expr_dlg.c b/gtk/dfilter_expr_dlg.c
index 5cee70387b..a98dda5220 100644
--- a/gtk/dfilter_expr_dlg.c
+++ b/gtk/dfilter_expr_dlg.c
@@ -731,7 +731,7 @@ value_list_sel_cb(GtkTreeSelection *sel, gpointer value_entry_arg)
}
static void
-dfilter_report_bad_value(char *format, ...)
+dfilter_report_bad_value(const char *format, ...)
{
char error_msg_buf[1024];
va_list args;
@@ -1396,7 +1396,7 @@ dfilter_expr_dlg_new(GtkWidget *filter_te)
GtkTreeIter iter, child_iter;
void *cookie, *cookie2;
- gchar *name;
+ const gchar *name;
for (i = proto_get_first_protocol(&cookie); i != -1;
i = proto_get_next_protocol(&cookie)) {
diff --git a/gtk/prefs_dlg.c b/gtk/prefs_dlg.c
index 6c42bfba18..6854008b03 100644
--- a/gtk/prefs_dlg.c
+++ b/gtk/prefs_dlg.c
@@ -985,7 +985,7 @@ pref_fetch(pref_t *pref, gpointer user_data)
str_val = gtk_entry_get_text(GTK_ENTRY(pref->control));
if (strcmp(*pref->varp.string, str_val) != 0) {
*pref_changed_p = TRUE;
- g_free(*pref->varp.string);
+ g_free((void *)*pref->varp.string);
*pref->varp.string = g_strdup(str_val);
}
break;
@@ -1319,7 +1319,7 @@ pref_revert(pref_t *pref, gpointer user_data)
case PREF_STRING:
if (strcmp(*pref->varp.string, pref->saved_val.string) != 0) {
*pref_changed_p = TRUE;
- g_free(*pref->varp.string);
+ g_free((void *)*pref->varp.string);
*pref->varp.string = g_strdup(pref->saved_val.string);
}
break;
diff --git a/gtk/proto_dlg.c b/gtk/proto_dlg.c
index 446eeeaf83..fae7399986 100644
--- a/gtk/proto_dlg.c
+++ b/gtk/proto_dlg.c
@@ -77,13 +77,13 @@ static GtkWidget *proto_w = NULL;
static GSList *protocol_list = NULL;
typedef struct protocol_data {
- char *name;
- char *abbrev;
- int hfinfo_index;
- gboolean enabled;
- gboolean was_enabled;
+ const char *name;
+ const char *abbrev;
+ int hfinfo_index;
+ gboolean enabled;
+ gboolean was_enabled;
#if GTK_MAJOR_VERSION < 2
- gint row;
+ gint row;
#else
GtkTreeIter iter;
#endif
diff --git a/gtk/rpc_stat.c b/gtk/rpc_stat.c
index cffc0db23a..28ecd7ab0a 100644
--- a/gtk/rpc_stat.c
+++ b/gtk/rpc_stat.c
@@ -55,7 +55,7 @@
typedef struct _rpcstat_t {
GtkWidget *win;
srt_stat_table srt_table;
- char *prog;
+ const char *prog;
guint32 program;
guint32 version;
guint32 num_procedures;
@@ -224,8 +224,8 @@ gtk_rpcstat_init(char *optarg)
GtkWidget *vbox;
GtkWidget *stat_label;
GtkWidget *filter_label;
- GtkWidget *bbox;
- GtkWidget *close_bt;
+ GtkWidget *bbox;
+ GtkWidget *close_bt;
int program, version, pos;
char *filter=NULL;
GString *error_string;
diff --git a/gtk/supported_protos_dlg.c b/gtk/supported_protos_dlg.c
index 53bc1486e0..a9978265c2 100644
--- a/gtk/supported_protos_dlg.c
+++ b/gtk/supported_protos_dlg.c
@@ -277,7 +277,7 @@ static void set_supported_text(GtkWidget *w, supported_type_t type)
const char *type_name;
void *cookie, *cookie2;
protocol_t *protocol;
- char *name, *short_name, *filter_name;
+ const char *name, *short_name, *filter_name;
int namel = 0, short_namel = 0, filter_namel = 0;
int count, fcount;
@@ -303,7 +303,7 @@ static void set_supported_text(GtkWidget *w, supported_type_t type)
for (i = proto_get_first_protocol(&cookie); i != -1;
i = proto_get_next_protocol(&cookie)) {
count++;
- protocol = find_protocol_by_id(i);
+ protocol = find_protocol_by_id(i);
name = proto_get_protocol_name(i);
short_name = proto_get_protocol_short_name(protocol);
filter_name = proto_get_protocol_filter_name(i);
@@ -328,7 +328,7 @@ static void set_supported_text(GtkWidget *w, supported_type_t type)
/* ok, display the correctly aligned strings */
for (i = proto_get_first_protocol(&cookie); i != -1;
i = proto_get_next_protocol(&cookie)) {
- protocol = find_protocol_by_id(i);
+ protocol = find_protocol_by_id(i);
name = proto_get_protocol_name(i);
short_name = proto_get_protocol_short_name(protocol);
filter_name = proto_get_protocol_filter_name(i);
@@ -391,7 +391,7 @@ static void set_supported_text(GtkWidget *w, supported_type_t type)
fcount = 0;
for (i = proto_get_first_protocol(&cookie); i != -1;
i = proto_get_next_protocol(&cookie)) {
- protocol = find_protocol_by_id(i);
+ protocol = find_protocol_by_id(i);
name = proto_get_protocol_name(i);
short_name = proto_get_protocol_short_name(protocol);
filter_name = proto_get_protocol_filter_name(i);
diff --git a/tap-dcerpcstat.c b/tap-dcerpcstat.c
index 1a03dddbcc..3a7a9bcf57 100644
--- a/tap-dcerpcstat.c
+++ b/tap-dcerpcstat.c
@@ -40,7 +40,7 @@
/* used to keep track of statistics for a specific procedure */
typedef struct _rpc_procedure_t {
- char *proc;
+ const char *proc;
int num;
nstime_t min;
nstime_t max;
@@ -49,7 +49,7 @@ typedef struct _rpc_procedure_t {
/* used to keep track of the statistics for an entire program interface */
typedef struct _rpcstat_t {
- char *prog;
+ const char *prog;
char *filter;
e_uuid_t uuid;
guint16 ver;
diff --git a/tap-rpcstat.c b/tap-rpcstat.c
index 8c53e0ab23..c0981a3a31 100644
--- a/tap-rpcstat.c
+++ b/tap-rpcstat.c
@@ -55,7 +55,7 @@ typedef struct _rpc_procedure_t {
/* used to keep track of the statistics for an entire program interface */
typedef struct _rpcstat_t {
- char *prog;
+ const char *prog;
char *filter;
guint32 program;
guint32 version;
diff --git a/tethereal.c b/tethereal.c
index d69f3f4942..44cb305359 100644
--- a/tethereal.c
+++ b/tethereal.c
@@ -268,7 +268,8 @@ print_usage(gboolean print_ver)
* descriptive name.
*/
static void
-display_dissector_table_names(char *table_name, char *ui_name, gpointer output)
+display_dissector_table_names(char *table_name, const char *ui_name,
+ gpointer output)
{
fprintf((FILE *)output, "\t%s (%s)\n", table_name, ui_name);
}