More 'char*' -> 'const char*' changes to fix warnings.
authorjmayer <jmayer@f5534014-38df-0310-8fa8-9805f1628bb7>
Sat, 23 Jul 2005 11:41:25 +0000 (11:41 +0000)
committerjmayer <jmayer@f5534014-38df-0310-8fa8-9805f1628bb7>
Sat, 23 Jul 2005 11:41:25 +0000 (11:41 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15015 f5534014-38df-0310-8fa8-9805f1628bb7

46 files changed:
clopts_common.c
clopts_common.h
disabled_protos.c
epan/addr_resolv.c
epan/asn1.c
epan/asn1.h
epan/column.c
epan/column.h
epan/dissectors/packet-dcerpc.h
epan/dissectors/packet-giop.c
epan/dissectors/packet-giop.h
epan/filesystem.c
epan/filesystem.h
epan/packet.c
epan/packet.h
epan/packet_info.h
epan/prefs.c
epan/prefs.h
epan/proto.c
epan/proto.h
epan/stats_tree.c
epan/stats_tree.h
epan/tap.c
epan/tap.h
epan/to_str.c
epan/xdlc.c
plugins/gryphon/packet-gryphon.c
plugins/gryphon/packet-gryphon.h
plugins/irda/irda-appl.h
plugins/mate/mate.h
plugins/mate/mate_grammar.lemon
plugins/mate/mate_parser.l
plugins/mate/mate_setup.c
plugins/mate/mate_util.c
plugins/mate/mate_util.h
plugins/mate/packet-mate.c
plugins/mgcp/packet-mgcp.c
plugins/opsi/packet-opsi.h
plugins/profinet/packet-pn-dcp.c
plugins/rlm/packet-rlm.c
print.c
randpkt.c
tap-iousers.c
tethereal.c
text2pcap.c
tools/lemon/lempar.c

index d30f8751b6a3c6de89bb9c6e3a15f5ae0b260cd7..1528d726e8ae4aa1b7b452ec33a7a3a7c0cce853 100644 (file)
@@ -40,7 +40,7 @@
  * to be printed.
  */
 void
-handle_dashG_option(int argc, char **argv, char *progname)
+handle_dashG_option(int argc, char **argv, const char *progname)
 {
   char *gpf_path, *pf_path;
   int   gpf_open_errno, gpf_read_errno;
index 376ddcc9c3bb15b1a4d767135df1e52a3ef009df..d4862f85751bafcd2979d15f5ead74989f7105f6 100644 (file)
@@ -33,7 +33,7 @@ extern "C" {
  * Handle the "-G" option, to cause protocol field, etc. information
  * to be printed.
  */
-void handle_dashG_option(int argc, char **argv, char *progname);
+void handle_dashG_option(int argc, char **argv, const char *progname);
 
 int get_natural_int(const char *appname, const char *string, const char *name);
 
index cc11ad0de9d0e819b05c4eb7e237bc3e4c942b32..19045431dbcdd923e6441a02f4b43579c467df03 100644 (file)
@@ -317,11 +317,12 @@ skip:
 void
 save_disabled_protos_list(char **pref_path_return, int *errno_return)
 {
-  gchar      *ff_path, *ff_path_new, *ff_name;
-  FILE       *ff;
-  gint        i;
-  protocol_t *protocol;
-  void       *cookie;
+  gchar       *ff_path, *ff_path_new;
+  const gchar *ff_name;
+  FILE        *ff;
+  gint         i;
+  protocol_t  *protocol;
+  void        *cookie;
 
   *pref_path_return = NULL;    /* assume no error */
 
index b1ca1b97e2ceca99f691388f71c32e7c7d814df7..32e83cf427625e95066631e92a96140862e5fb22 100644 (file)
@@ -277,7 +277,7 @@ static gchar *serv_name_lookup(guint port, port_type proto)
   int hash_idx;
   hashport_t *tp;
   hashport_t **table;
-  char *serv_proto = NULL;
+  const char *serv_proto = NULL;
   struct servent *servp;
 
   switch(proto) {
@@ -524,7 +524,7 @@ static gchar *host_name_lookup6(struct e_in6_addr *addr, gboolean *found)
 
 } /* host_name_lookup6 */
 
-const gchar *solve_address_to_name(address *addr)
+static const gchar *solve_address_to_name(address *addr)
 {
   guint32 ipv4_addr;
   struct e_in6_addr ipv6_addr;
index f9ff91f85c78d4df6740ad206e5c155ef95c1f86..e976866bbdce67a4576b7cf3a69bc4621b1e6cb3 100644 (file)
@@ -1039,7 +1039,7 @@ done:
 
 /*
  * NAME:        asn1_err_to_str                             [API]
- * SYNOPSIS:    char *asn1_err_to_str
+ * SYNOPSIS:    const char *asn1_err_to_str
  *                  (
  *                      int     err
  *                  )
@@ -1048,10 +1048,10 @@ done:
  *              err: the error code
  * RETURNS:     string for the error
  */
-char *
+const char *
 asn1_err_to_str(int err)
 {
-    char         *errstr;
+    const char   *errstr;
     char         errstrbuf[14+1+1+11+1+1];     /* "Unknown error (%d)\0" */
 
     switch (err) {
index 5d751ff7fd1e944363bd1bae80cb0be014b67b1b..2352b416ee4af70c38ca573a82d2180ff9039855 100644 (file)
@@ -145,6 +145,6 @@ extern int asn1_oid_decode (ASN1_SCK *asn1, subid_t **oid, guint *len,
                            guint *nbytes);
 extern int asn1_sequence_decode (ASN1_SCK *asn1, guint *seq_len, guint *nbytes);
 
-extern char *asn1_err_to_str (int err);
+extern const char *asn1_err_to_str (int err);
 
 #endif
index c11e96da5d35862e0dacac86159f95dd9394b8e4..83d96d0004ce936538ee23e34318a406f374f99e 100644 (file)
 
 /* Given a format number (as defined in packet.h), returns its equivalent
    string */
-gchar *
+const gchar *
 col_format_to_string(gint fmt) {
-  gchar *slist[] = { "%m", "%t", "%Rt", "%At", "%Yt", "%Tt", "%s", "%rs",
-                     "%us","%hs", "%rhs", "%uhs", "%ns", "%rns", "%uns", "%d",
-                     "%rd", "%ud", "%hd", "%rhd", "%uhd", "%nd", "%rnd",
-                     "%und", "%S", "%rS", "%uS", "%D", "%rD", "%uD", "%p",
-                     "%i", "%L", "%B", "%XO", "%XR", "%I", "%c", "%Xs", 
-                     "%Xd", "%V", "%x", "%e", "%H", "%P", "%y" };
+  const gchar *slist[] = {
+       "%m", "%t", "%Rt", "%At", "%Yt", "%Tt", "%s", "%rs",
+       "%us","%hs", "%rhs", "%uhs", "%ns", "%rns", "%uns", "%d",
+       "%rd", "%ud", "%hd", "%rhd", "%uhd", "%nd", "%rnd",
+       "%und", "%S", "%rS", "%uS", "%D", "%rD", "%uD", "%p",
+       "%i", "%L", "%B", "%XO", "%XR", "%I", "%c", "%Xs", 
+       "%Xd", "%V", "%x", "%e", "%H", "%P", "%y"
+};
                      
   if (fmt < 0 || fmt >= NUM_COL_FMTS)
     return NULL;
@@ -63,7 +65,7 @@ col_format_to_string(gint fmt) {
 
 /* Given a format number (as defined in packet.h), returns its
   description */
-static gchar *dlist[NUM_COL_FMTS] = {
+static const gchar *dlist[NUM_COL_FMTS] = {
        "Number",
        "Time (format as specified)",
        "Relative time",
@@ -112,7 +114,7 @@ static gchar *dlist[NUM_COL_FMTS] = {
        "DCE/RPC call (cn_call_id / dg_seqnum)",
 };
 
-gchar *
+const gchar *
 col_format_desc(gint fmt) {
   g_assert((fmt >= 0) && (fmt < NUM_COL_FMTS));
   return(dlist[fmt]);
@@ -224,7 +226,7 @@ get_column_format_matches(gboolean *fmt_list, gint format) {
    is done, and given that the width for COL...SRC and COL...DST columns
    is somewhat arbitrary in any case.  We should probably clean
    that up eventually, though. */
-char *
+const char *
 get_column_longest_string(gint format)
 {
   switch (format) {
index 45a7b4ce29c06f7a3dfecf46ee044ec341140082..3cd972d2b7a467ac25e9b05a298d5504a79455bb 100644 (file)
@@ -30,13 +30,13 @@ typedef struct _fmt_data {
   gchar *fmt;
 } fmt_data;
 
-gchar               *col_format_to_string(gint);
-gchar               *col_format_desc(gint);
+const gchar         *col_format_to_string(gint);
+const gchar         *col_format_desc(gint);
 gint                 get_column_format(gint);
 void                 get_column_format_matches(gboolean *, gint);
 gint                 get_column_format_from_str(gchar *);
 gchar               *get_column_title(gint);
-char                *get_column_longest_string(gint);
+const char          *get_column_longest_string(gint);
 gint                 get_column_char_width(gint format);
 
 #endif /* column.h */
index 3f467ed9ad748f62cab6be734478c24ff565df05..0410be2b91c4bf904fc49745cee395a3e1ac87b8 100644 (file)
@@ -238,7 +238,7 @@ int dissect_ndr_wchar_vstring(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
 typedef struct _dcerpc_sub_dissector {
     guint16 num;
-    gchar   *name;
+    const gchar   *name;
     dcerpc_dissect_fnct_t *dissect_rqst;
     dcerpc_dissect_fnct_t *dissect_resp;
 } dcerpc_sub_dissector;
index b7fb1c517ce55a9cb4aa8a741eec051657d6c972..4b93d45262916b133f62ab011a21393cd27483d9 100644 (file)
@@ -1288,7 +1288,7 @@ static int giop_getline(FILE *fp, gchar *line, int maxlen) {
  * and store in object key hash
  */
 
-static void read_IOR_strings_from_file(gchar *name, int max_iorlen) {
+static void read_IOR_strings_from_file(const gchar *name, int max_iorlen) {
   guchar *buf;                 /* NOTE reused for every line */
   int len;
   int ior_val_len;             /* length after unstringifying. */
@@ -1436,7 +1436,7 @@ static void giop_init(void) {
  *
  */
 
-void register_giop_user(giop_sub_dissector_t *sub, gchar *name, int sub_proto) {
+void register_giop_user(giop_sub_dissector_t *sub, const gchar *name, int sub_proto) {
 
   giop_sub_handle_t *subh;
 
index 928bbf6eeb63f18dc2a6678a772b4d89f0faaee8..e6f837f3ab25c6860a1d13475c196d0a6926bcd3 100644 (file)
@@ -118,7 +118,7 @@ extern gboolean dissect_giop(tvbuff_t *, packet_info *, proto_tree *); /* new in
  * This is for heuristic dissection
  */
 
-extern void register_giop_user(giop_sub_dissector_t *sub, gchar *name,
+extern void register_giop_user(giop_sub_dissector_t *sub, const gchar *name,
     int sub_proto);
 
 /*
index 8bb384087a2544d656ac181abca05bd19fe6a9df..f87644969d1ebdbedc82422f04d570bfc45f2270 100644 (file)
@@ -351,7 +351,7 @@ get_persconffile_dir(void)
        char *appdatadir;
        char *userprofiledir;
 #else
-       char *homedir;
+       const char *homedir;
        struct passwd *pwd;
 #endif
        static char *pf_dir = NULL;
@@ -647,10 +647,10 @@ char *get_tempfile_path(const char *filename)
  * Return an error message for UNIX-style errno indications on open or
  * create operations.
  */
-char *
+const char *
 file_open_error_message(int err, gboolean for_writing)
 {
-       char *errmsg;
+       const char *errmsg;
        static char errmsg_errno[1024+1];
 
        switch (err) {
@@ -698,10 +698,10 @@ file_open_error_message(int err, gboolean for_writing)
  * Return an error message for UNIX-style errno indications on write
  * operations.
  */
-char *
+const char *
 file_write_error_message(int err)
 {
-       char *errmsg;
+       const char *errmsg;
        static char errmsg_errno[1024+1];
 
        switch (err) {
index 534cfe384a4ac67eae02468d4e22e7ea09e4a719..060937ef168cae4b760c662a7ee636983dd1a4d7 100644 (file)
@@ -119,13 +119,13 @@ gboolean deletefile (const char *path);
  * Return an error message for UNIX-style errno indications on open or
  * create operations.
  */
-char *file_open_error_message(int err, gboolean for_writing);
+const char *file_open_error_message(int err, gboolean for_writing);
 
 /*
  * Return an error message for UNIX-style errno indications on write
  * operations.
  */
-char *file_write_error_message(int err);
+const char *file_write_error_message(int err);
 
 /*
  * Check, if file is existing.
index a012ef7c2d626e946d57c8466e2514833237a56d..f47faeae63d24d5ddb363823dc68138fb6be86e5 100644 (file)
@@ -187,7 +187,7 @@ static GMemChunk *data_source_chunk = NULL;
  * the tvbuff for the data source and its name.
  */
 void
-add_new_data_source(packet_info *pinfo, tvbuff_t *tvb, char *name)
+add_new_data_source(packet_info *pinfo, tvbuff_t *tvb, const char *name)
 {
        data_source *src;
 
@@ -616,7 +616,7 @@ struct dtbl_entry {
 struct dissector_table {
        GHashTable      *hash_table;
        GSList          *dissector_handles;
-       char            *ui_name;
+       const char      *ui_name;
        ftenum_t        type;
        int             base;
 };
@@ -906,7 +906,7 @@ find_string_dtbl_entry(dissector_table_t sub_dissectors, const gchar *pattern)
 
 /* Add an entry to a string dissector table. */
 void
-dissector_add_string(const char *name, gchar *pattern,
+dissector_add_string(const char *name, const gchar *pattern,
     dissector_handle_t handle)
 {
        dissector_table_t sub_dissectors = find_dissector_table( name);
@@ -1369,7 +1369,7 @@ dissector_all_tables_foreach_table (DATFunc_table func,
 }
 
 dissector_table_t
-register_dissector_table(const char *name, char *ui_name, ftenum_t type,
+register_dissector_table(const char *name, const char *ui_name, ftenum_t type,
     int base)
 {
        dissector_table_t       sub_dissectors;
index b1f2bc1ea8887b35ef998e70382d59b495570f40..05f6195eb77aa230917564544eca43ebb2426fb8 100644 (file)
@@ -163,7 +163,7 @@ extern void dissector_all_tables_foreach_table (DATFunc_table func,
 
 /* a protocol uses the function to register a sub-dissector table */
 extern dissector_table_t register_dissector_table(const char *name,
-    char *ui_name, ftenum_t type, int base);
+    const char *ui_name, ftenum_t type, int base);
 
 /* Find a dissector table by table name. */
 extern dissector_table_t find_dissector_table(const char *name);
@@ -208,7 +208,7 @@ extern dissector_handle_t dissector_get_port_handle(
     dissector_table_t sub_dissectors, guint32 port);
 
 /* Add an entry to a string dissector table. */
-extern void dissector_add_string(const char *name, gchar *pattern,
+extern void dissector_add_string(const char *name, const gchar *pattern,
     dissector_handle_t handle);
 
 /* Delete the entry for a dissector in a string dissector table
@@ -379,7 +379,7 @@ final_registration_all_protocols(void);
  * the tvbuff for the data source and its name.
  */
 extern void add_new_data_source(packet_info *pinfo, tvbuff_t *tvb,
-    char *name);
+    const char *name);
 
 /*
  * Free up a frame's list of data sources.
index bca15bd9172424431504d73f6557f00cdd3abe96..185ffcdb11cea643615a54cf1d20d48ec23fa72f 100644 (file)
@@ -60,7 +60,7 @@ typedef struct _packet_info {
   guint32 ipxptype;            /* IPX packet type, if this is an IPX packet */
   circuit_type ctype;          /* type of circuit, for protocols with a VC identifier */
   guint32 circuit_id;          /* circuit ID, for protocols with a VC identifier */
-  char   *noreassembly_reason;  /* reason why reassembly wasn't done, if any */
+  const char *noreassembly_reason;  /* reason why reassembly wasn't done, if any */
   gboolean fragmented;         /* TRUE if the protocol is only a fragment */
   gboolean in_error_pkt;       /* TRUE if we're inside an {ICMP,CLNP,...} error packet */
   port_type ptype;             /* type of the following two port numbers */
index a30acf261ed8de62708aeed564579739ec715db7..58750e152cb061495ddaf8f41962ebc432202f60 100644 (file)
@@ -556,7 +556,7 @@ prefs_register_enum_preference(module_t *module, const char *name,
  */
 void
 prefs_register_string_preference(module_t *module, const char *name,
-    const char *title, const char *description, char **var)
+    const char *title, const char *description, const char **var)
 {
        pref_t *preference;
 
index 7aa215ebd879ce6988a49ae29866b106e2c51e28..76c69ce89e699e6f930c11a2adbceb5dba1cef4d 100644 (file)
@@ -275,7 +275,7 @@ extern void prefs_register_enum_preference(module_t *module, const char *name,
  * Register a preference with a character-string value.
  */
 extern void prefs_register_string_preference(module_t *module, const char *name,
-    const char *title, const char *description, char **var);
+    const char *title, const char *description, const char **var);
 
 /*
  * Register a preference with a ranged value.
index 93418d2d5473db8f20a54b1fc078decfd5150a17..f080b69ad8ab684340e473fbd817926a377aeb06 100644 (file)
@@ -580,7 +580,7 @@ header_field_info*
 proto_registrar_get_byname(const char *field_name)
 {
        DISSECTOR_ASSERT(field_name != NULL);
-       return g_tree_lookup(gpa_name_tree, (gpointer)field_name);
+       return g_tree_lookup(gpa_name_tree, field_name);
 }
 
 /* Add a text-only node, leaving it to our caller to fill the text in */
@@ -2800,7 +2800,7 @@ proto_get_id(protocol_t *protocol)
        return protocol->proto_id;
 }
 
-int proto_get_id_by_filter_name(gchar* filter_name)
+int proto_get_id_by_filter_name(const gchar* filter_name)
 {
        GList *list_entry;
        protocol_t *protocol;
index 8a7cf9ed7f06e54c173dfe644205ac38d8fa0418..c8675054a42034605023733f758336d91d3f8657 100644 (file)
@@ -1044,7 +1044,7 @@ extern header_field_info *proto_get_next_protocol_field(void **cookle);
 /** Given a protocol's filter_name.
  @param filter_name the filter name to search for
  @return proto_id */
-extern int proto_get_id_by_filter_name(gchar* filter_name);
+extern int proto_get_id_by_filter_name(const gchar* filter_name);
 
 /** Can item # n decoding be disabled?
  @param proto_id protocol id (0-indexed)
index e1fd21d49c74e54581b86a3f5c2da9e8a14840f8..150460afe93343f82ce44b06e7c09e033f60a122 100644 (file)
@@ -237,9 +237,9 @@ extern void stats_tree_reinit(void* p) {
 }
 
 /* register a new stats_tree */
-extern void stats_tree_register(guint8* tapname,
-                                                               guint8* abbr, 
-                                                               guint8* name,
+extern void stats_tree_register(const guint8* tapname,
+                                                               const guint8* abbr, 
+                                                               const guint8* name,
                                                                stat_tree_packet_cb packet,
                                                                stat_tree_init_cb init,
                                                                stat_tree_cleanup_cb cleanup) {
index 872450cb707d685714bf785fb63faa7dfb5d8837..d3d81e01798ee527a34fdb604fb8f319e6f03f5c 100644 (file)
@@ -55,9 +55,9 @@ typedef void  (*stat_tree_cleanup_cb)(stats_tree*);
  * packet: per packet callback
  * init: tree initialization callback
  */
-extern void stats_tree_register(guint8* tapname,
-                                                               guint8* abbr, 
-                                                               guint8* name,
+extern void stats_tree_register(const guint8* tapname,
+                                                               const guint8* abbr, 
+                                                               const guint8* name,
                                                                stat_tree_packet_cb packet,
                                                                stat_tree_init_cb init,
                                                                stat_tree_cleanup_cb cleanup);
index 79721ebc78be9d0f56a954e8adfb83ec5c540ff2..2480086809a76c36f6bcc45305c80a73d6b885f7 100644 (file)
@@ -84,7 +84,7 @@ static volatile tap_listener_t *tap_listener_queue=NULL;
  */
 typedef struct _tap_cmd_arg {
        struct _tap_cmd_arg *next;
-       char *cmd;
+       const char *cmd;
        void (*func)(char *arg);
 } tap_cmd_arg;
 static tap_cmd_arg *tap_cmd_arg_list=NULL;
@@ -117,7 +117,7 @@ tap_init(void)
  * and initialization routine
  * ********************************************************************** */
 void
-register_tap_listener_cmd_arg(char *cmd, void (*func)(char *arg))
+register_tap_listener_cmd_arg(const char *cmd, void (*func)(char *arg))
 {
        tap_cmd_arg *newtca;
 
@@ -384,7 +384,7 @@ draw_tap_listeners(gboolean draw_all)
    or 0 if no such tap was found.
  */
 int 
-find_tap_id(char *name)
+find_tap_id(const char *name)
 {
        tap_dissector_t *td;
        int i;
@@ -404,7 +404,7 @@ find_tap_id(char *name)
  *           message.
  */
 GString *
-register_tap_listener(char *tapname, void *tapdata, char *fstring, tap_reset_cb reset, tap_packet_cb packet, tap_draw_cb draw)
+register_tap_listener(const char *tapname, void *tapdata, char *fstring, tap_reset_cb reset, tap_packet_cb packet, tap_draw_cb draw)
 {
        tap_listener_t *tl;
        int tap_id;
index 2d92a8c1791cb5d6f1af342357db0b861daca918..0834ce90e4868b0b0d65c9d720428d7eaf86237d 100644 (file)
@@ -38,18 +38,18 @@ typedef void (*tap_draw_cb)(void *tapdata);
 
 
 extern void tap_init(void);
-extern void register_tap_listener_cmd_arg(char *cmd, void (*func)(char *arg));
+extern void register_tap_listener_cmd_arg(const char *cmd, void (*func)(char *arg));
 extern gboolean process_tap_cmd_arg(char *optarg);
 extern void list_tap_cmd_args(void);
 extern void start_requested_taps(void);
 extern int register_tap(const char *name);
-extern int find_tap_id(char *name);
+extern int find_tap_id(const char *name);
 extern void tap_queue_packet(int tap_id, packet_info *pinfo, const void *tap_specific_data);
 extern void tap_queue_init(epan_dissect_t *edt);
 extern void tap_push_tapped_queue(epan_dissect_t *edt);
 extern void reset_tap_listeners(void);
 extern void draw_tap_listeners(gboolean draw_all);
-extern GString *register_tap_listener(char *tapname, void *tapdata,
+extern GString *register_tap_listener(const char *tapname, void *tapdata,
     char *fstring, tap_reset_cb tap_reset, tap_packet_cb tap_packet,
     tap_draw_cb tap_draw);
 extern void remove_tap_listener(void *tapdata);
index f24cde7d9f931e9722391afb9c8408ecc5b2573e..6ccdd4bcbc726d27cea640104ada80806e3f413b 100644 (file)
@@ -341,7 +341,7 @@ time_secs_to_str_buf(gint32 time, guint32 frac, gboolean is_nsecs,
 {
   static gchar *p;
   int hours, mins, secs;
-  gchar *msign = "";
+  const gchar *msign = "";
   gboolean do_comma = FALSE;
 
   if(time<0){
@@ -497,7 +497,7 @@ void
 display_signed_time(gchar *buf, int buflen, gint32 sec, gint32 frac,
     time_res_t units)
 {
-       char *sign;
+       const char *sign;
 
        /* If the fractional part of the time stamp is negative,
           print its absolute value and, if the seconds part isn't
@@ -533,7 +533,7 @@ rel_time_to_str(nstime_t *rel_time)
 {
        gchar *buf;
        char *p;
-       char *sign;
+       const char *sign;
        gint32 time;
        gint32 nsec;
 
index f631475303d8d65b4fe4c3a5356beca5a79c9d75..d6fb3148ab878d1dbd288349c1e1a57a003ac6a8 100644 (file)
@@ -180,11 +180,11 @@ dissect_xdlc_control(tvbuff_t *tvb, int offset, packet_info *pinfo,
     guint16 control;
     int control_len;
     const xdlc_cf_items *cf_items;
-    char *control_format;
+    const char *control_format;
     guint16 poll_final;
     char info[80];
     proto_tree *tc, *control_tree;
-    gchar *frame_type = NULL;
+    const gchar *frame_type = NULL;
     const gchar *modifier;
 
     switch (tvb_get_guint8(tvb, offset) & 0x03) {
index eb84399a05123b60d075f5167b3eb5654704aa22..4d6b67f35b892cb8b65145178eb55e281dbcf305 100644 (file)
@@ -137,7 +137,7 @@ static int cmd_bits_in(tvbuff_t*, int, proto_tree*);
 static int cmd_bits_out(tvbuff_t*, int, proto_tree*);
 static int cmd_init_strat(tvbuff_t*, int, proto_tree*);
 
-static char *frame_type[] = {
+static const char *frame_type[] = {
        "",
        "Command request",
        "Command response",
@@ -869,7 +869,7 @@ decode_misc (tvbuff_t *tvb, int offset, proto_tree *pt)
 static int
 cmd_init(tvbuff_t *tvb, int offset, proto_tree *pt)
 {
-    char       *ptr;
+    const char         *ptr;
 
     if (tvb_get_guint8(tvb, offset) == 0)
        ptr = "Always initialize";
@@ -1164,7 +1164,7 @@ resp_getspeeds(tvbuff_t *tvb, int offset, proto_tree *pt)
 static int
 cmd_sort(tvbuff_t *tvb, int offset, proto_tree *pt)
 {
-    char       *which;
+    const char *which;
 
     which = tvb_get_guint8(tvb, offset) ?
            "Sort into blocks of up to 16 messages" :
@@ -1177,7 +1177,7 @@ cmd_sort(tvbuff_t *tvb, int offset, proto_tree *pt)
 static int
 cmd_optimize(tvbuff_t *tvb, int offset, proto_tree *pt)
 {
-    char       *which;
+    const char *which;
 
     which = tvb_get_guint8(tvb, offset) ?
            "Optimize for latency (Nagle algorithm disabled)" :
@@ -1390,7 +1390,7 @@ cmd_sched_rep(tvbuff_t *tvb, int offset, proto_tree *pt)
     proto_item     *item;
     int                    save_offset;
     unsigned int    x;
-    char            *type;
+    const char      *type;
 
     msglen = tvb_reported_length_remaining(tvb, offset);
     x = tvb_get_ntohl(tvb, offset);
@@ -1415,10 +1415,10 @@ cmd_sched_rep(tvbuff_t *tvb, int offset, proto_tree *pt)
 static int
 resp_blm_data(tvbuff_t *tvb, int offset, proto_tree *pt)
 {
-    unsigned int    i;
-    int             hours, minutes, seconds, fraction, x, fract;
-    unsigned long   timestamp;
-    static char    *fields[] = {
+    unsigned int      i;
+    int               hours, minutes, seconds, fraction, x, fract;
+    unsigned long     timestamp;
+    static const char *fields[] = {
        "Bus load average: %d.%02d%%",
        "Current bus load: %d.%02d%%",
        "Peak bus load: %d.%02d%%",
@@ -1446,7 +1446,7 @@ static int
 resp_blm_stat(tvbuff_t *tvb, int offset, proto_tree *pt)
 {
     unsigned int    x, i;
-    char           *fields[] = {
+    const char             *fields[] = {
        "Receive frame count: %u",
        "Transmit frame count: %u",
        "Receive dropped frame count: %u",
@@ -1815,7 +1815,7 @@ cmd_options(tvbuff_t *tvb, int offset, proto_tree *pt)
     proto_item     *item;
     proto_tree     *tree;
     unsigned int    i, size, padding, option, option_length, option_value;
-    char           *string, *string1;
+    const char     *string, *string1;
 
     msglen = tvb_reported_length_remaining(tvb, offset);
     item = proto_tree_add_text(pt, tvb, offset, 1, "Handle: %u",
@@ -1882,8 +1882,8 @@ cmd_options(tvbuff_t *tvb, int offset, proto_tree *pt)
 static int
 cmd_files(tvbuff_t *tvb, int offset, proto_tree *pt)
 {
-    int            msglen;
-    gchar  *which;
+    int                 msglen;
+    const gchar  *which;
 
     msglen = tvb_reported_length_remaining(tvb, offset);
     if (tvb_get_guint8(tvb, offset) == 0)
@@ -1901,8 +1901,8 @@ cmd_files(tvbuff_t *tvb, int offset, proto_tree *pt)
 static int
 resp_files(tvbuff_t *tvb, int offset, proto_tree *pt)
 {
-    int                msglen;
-    gchar      *flag;
+    int                        msglen;
+    const gchar        *flag;
 
     msglen = tvb_reported_length_remaining(tvb, offset);
     flag = tvb_get_guint8(tvb, offset) ? "Yes": "No";
@@ -1915,24 +1915,30 @@ resp_files(tvbuff_t *tvb, int offset, proto_tree *pt)
 static int
 cmd_usdt(tvbuff_t *tvb, int offset, proto_tree *pt)
 {
-    int     ids, id, remain, size, i, j, bytes;
-    gchar  *desc;
-    guint8  flags;
-    proto_tree     *localTree;
-    proto_item     *localItem;
-    gchar  *actions[] = {"Use 11 bit headers only",
-                          "Use 29 bit headers only",
-                          "Use both 11 & 29 bit headers",
-                          "undefined"};
-    gchar *xmit_opts[] = {"Pad messages with less than 8 data bytes with 0x00's",
-                           "Pad messages with less than 8 data bytes with 0xFF's",
-                           "Do not pad messages with less than 8 data bytes",
-                           "undefined"};
-    gchar *recv_opts[] = {"Do not verify the integrity of long received messages and do not send them to the client",
-                           "Verify the integrity of long received messages and send them to the client",
-                           "Verify the integrity of long received messages but do not send them to the client",
-                           "undefined"};
-    gchar *block_desc[] = {"USDT request", "USDT response", "UUDT response"};
+    int                ids, id, remain, size, i, j, bytes;
+    const gchar        *desc;
+    guint8     flags;
+    proto_tree *localTree;
+    proto_item *localItem;
+    const gchar        *actions[] = {
+       "Use 11 bit headers only",
+       "Use 29 bit headers only",
+       "Use both 11 & 29 bit headers",
+       "undefined"
+    };
+    const gchar *xmit_opts[] = {
+       "Pad messages with less than 8 data bytes with 0x00's",
+       "Pad messages with less than 8 data bytes with 0xFF's",
+       "Do not pad messages with less than 8 data bytes",
+       "undefined"
+    };
+    const gchar *recv_opts[] = {
+       "Do not verify the integrity of long received messages and do not send them to the client",
+       "Verify the integrity of long received messages and send them to the client",
+       "Verify the integrity of long received messages but do not send them to the client",
+       "undefined"
+    };
+    const gchar *block_desc[] = {"USDT request", "USDT response", "UUDT response"};
 
     flags = tvb_get_guint8(tvb, offset);
     if (flags & 1)
@@ -2046,8 +2052,8 @@ cmd_bits_in (tvbuff_t *tvb, int offset, proto_tree *pt)
     proto_item *item;
     proto_tree *tree;
     unsigned int i;
-    int            msglen, mask, value;
-    char    *decode[] = {"Input 1", "Input 2", "Input 3", "Pushbutton"};
+    int                msglen, mask, value;
+    const char  *decode[] = {"Input 1", "Input 2", "Input 3", "Pushbutton"};
 
     msglen = tvb_reported_length_remaining(tvb, offset);
     value = tvb_get_guint8(tvb, offset);
@@ -2075,8 +2081,8 @@ cmd_bits_out (tvbuff_t *tvb, int offset, proto_tree *pt)
     proto_item *item;
     proto_tree *tree;
     unsigned int i;
-    int            msglen, mask, value;
-    char    *decode[] = {"Output 1", "Output 2"};
+    int                msglen, mask, value;
+    const char  *decode[] = {"Output 1", "Output 2"};
 
     msglen = tvb_reported_length_remaining(tvb, offset);
     value = tvb_get_guint8(tvb, offset);
@@ -2187,7 +2193,8 @@ filter_block(tvbuff_t *tvb, int offset, proto_tree *pt)
 static int
 blm_mode(tvbuff_t *tvb, int offset, proto_tree *pt)
 {
-    char    *mode, line[50];
+    const char    *mode;
+    char line[50];
     int     x, y, seconds;
 
     x = tvb_get_ntohl(tvb, offset);
index abac7c3957ebfb4d561c5f7d5b3925787e0ef1c0..01f3f25fab754423d64f2ec685b4c53cd8788915 100644 (file)
 
 
 typedef struct val_str_dsp {
-    int     value;
-    char    *strptr;
-    int     (*cmd_fnct)(tvbuff_t *, int, proto_tree*);
-    int     (*rsp_fnct)(tvbuff_t *, int, proto_tree*);
+    int                value;
+    const char *strptr;
+    int                (*cmd_fnct)(tvbuff_t *, int, proto_tree*);
+    int                (*rsp_fnct)(tvbuff_t *, int, proto_tree*);
 } val_str_dsp;
index 571d8bfc5ee53e2723173058af109fb0cd90654d..683e03503e6f1e9dbb8d14883b8512479b1f1ea0 100644 (file)
@@ -54,12 +54,12 @@ typedef gboolean (*ias_value_dissector_t)(tvbuff_t* tvb, unsigned offset, packet
                                           unsigned list_index, guint8 attr_type);
 
 typedef const struct ias_attr_dissector {
-    char*                   attr_name;
+    const char*             attr_name;
     ias_value_dissector_t   value_dissector;
 } ias_attr_dissector_t;
 
 typedef const struct ias_class_dissector {
-    char*                   class_name;
+    const char*             class_name;
     ias_attr_dissector_t*   pattr_dissector;
 } ias_class_dissector_t;
 
index 61060dbdcb8aceff6b42a8d6d741a6f24bc57f56..7b12625aa0b71ef54a6243b0ace5966955634208 100644 (file)
@@ -372,7 +372,7 @@ extern mate_pdu* mate_get_pdus(guint32 framenum);
 extern void mate_analyze_frame(packet_info *pinfo, proto_tree* tree);
 
 /* from mate_setup.c */
-extern mate_config* mate_make_config(gchar* filename, int mate_hfid);
+extern mate_config* mate_make_config(const gchar* filename, int mate_hfid);
 
 extern mate_config* mate_cfg(void);
 extern mate_cfg_pdu* new_pducfg(gchar* name);
@@ -384,6 +384,6 @@ extern gchar* add_ranges(gchar* range, GPtrArray* range_ptr_arr);
 
 
 /* from mate_parser.l */
-extern gboolean mate_load_config(gchar* filename, mate_config* mc);
+extern gboolean mate_load_config(const gchar* filename, mate_config* mc);
 
 #endif
index 837a66e3e96eefd631ee4eca73cc7a1725debef5..54dc221d7d547da80480c244832f8e71305eeb3a 100644 (file)
@@ -94,9 +94,9 @@ typedef struct _gog_statements {
        LoAL* current_gogkeys;
 } gog_statement_t;
 
-static void configuration_error(mate_config* mc, gchar* fmt, ...) {
+static void configuration_error(mate_config* mc, const gchar* fmt, ...) {
        static gchar error_buffer[256];
-       gchar* incl;
+       const gchar* incl;
        gint i;
        mate_config_frame* current_frame;
        va_list list;
index f8d3076403277a046535cd2fee19e26cae0c7d03..1cd0730528919c0c3fd5808e8218236aba20923a 100644 (file)
@@ -245,7 +245,7 @@ blk_cmnt_stop  "*/"
 
 %%
 
-extern gboolean mate_load_config(gchar* filename, mate_config* matecfg) {
+extern gboolean mate_load_config(const gchar* filename, mate_config* matecfg) {
        gboolean state;
        mc = matecfg;
 
index c54f18d7e58cbf62db17229fe97ba8ffe2294cbf..07b7af85978a41887ad51353f7f48adc10d37a11 100644 (file)
@@ -30,7 +30,7 @@
 static mate_config* matecfg = NULL;
 
 /* appends the formatted string to the current error log */
-static void report_error(gchar* fmt, ...) {
+static void report_error(const gchar* fmt, ...) {
        static gchar error_buffer[DEBUG_BUFFER_SIZE];
 
        va_list list;
@@ -679,8 +679,8 @@ static void print_hfid_hash(gpointer k, gpointer v, gpointer p _U_) {
 static void print_pdu_config(mate_cfg_pdu* cfg, GString* s) {
        guint i;
        int hfid;
-       gchar* discard;
-       gchar* stop;
+       const gchar* discard;
+       const gchar* stop;
        
        discard = cfg->discard ? "TRUE": "FALSE";
        stop = cfg->last_extracted ? "TRUE" : "FALSE";
@@ -858,7 +858,7 @@ static void print_config(void) {
        g_string_free(config_text,TRUE);
 }
 
-extern mate_config* mate_make_config(gchar* filename, int mate_hfid) {
+extern mate_config* mate_make_config(const gchar* filename, int mate_hfid) {
        gint* ett;
        avp_init();
 
index 1020046ad4c52bde40864755017911fb21278675..8137f0cd56c166510cc87bd896fa03e5c30ea7e6 100644 (file)
@@ -130,7 +130,7 @@ extern SCS_collection* scs_init(void) {
  *
  * Return value: a pointer to the subscribed string.
  **/
-gchar* scs_subscribe(SCS_collection* c, gchar* s) {
+gchar* scs_subscribe(SCS_collection* c, const gchar* s) {
        gchar* orig = NULL;
        guint* ip = NULL;
        size_t len = 0;
@@ -346,7 +346,7 @@ extern void avp_init(void) {
  * Return value: a pointer to the newly created avp.
  *
  **/
-extern AVP* new_avp_from_finfo(gchar* name, field_info* finfo) {
+extern AVP* new_avp_from_finfo(const gchar* name, field_info* finfo) {
        AVP* new = g_mem_chunk_alloc(avp_chunk);
        gchar* value;
        
@@ -397,7 +397,7 @@ extern AVP* new_avp_from_finfo(gchar* name, field_info* finfo) {
  * Return value: a pointer to the newly created avp.
  *
  **/
-extern AVP* new_avp(gchar* name, gchar* value, gchar o) {
+extern AVP* new_avp(const gchar* name, const gchar* value, gchar o) {
        AVP* new = g_mem_chunk_alloc(avp_chunk);
 
        new->n = scs_subscribe(avp_strings, name);
@@ -468,7 +468,7 @@ extern void rename_avp(AVP* avp, gchar* name) {
  * Return value: a pointer to the newly created avpl.
  *
  **/
-extern AVPL* new_avpl(gchar* name) {
+extern AVPL* new_avpl(const gchar* name) {
        AVPL* new_avpl = g_mem_chunk_alloc(avp_chunk);
 
 #ifdef _AVP_DEBUGGING
@@ -913,7 +913,7 @@ extern void merge_avpl(AVPL* dst, AVPL* src, gboolean copy_avps) {
  * Return value: a pointer to the newly allocated string.
  *
  **/
-extern AVPL* new_avpl_from_avpl(gchar* name, AVPL* avpl, gboolean copy_avps) {
+extern AVPL* new_avpl_from_avpl(const gchar* name, AVPL* avpl, gboolean copy_avps) {
        AVPL* newavpl = new_avpl(name);
        void* cookie = NULL;
        AVP* avp;
@@ -1043,7 +1043,7 @@ extern AVP* match_avp(AVP* src, AVP* op) {
  * Return value: a pointer to the newly created avpl containing the
  *                              matching avps.
  **/
-extern AVPL* new_avpl_loose_match(gchar* name,
+extern AVPL* new_avpl_loose_match(const gchar* name,
                                                                  AVPL* src,
                                                                  AVPL* op,
                                                                  gboolean copy_avps) {
@@ -1121,7 +1121,7 @@ extern AVPL* new_avpl_loose_match(gchar* name,
  * Return value: a pointer to the newly created avpl containing the
  *                              matching avps.
  **/
-extern AVPL* new_avpl_every_match(gchar* name, AVPL* src, AVPL* op, gboolean copy_avps) {
+extern AVPL* new_avpl_every_match(const gchar* name, AVPL* src, AVPL* op, gboolean copy_avps) {
        AVPL* newavpl;
        AVPN* co = NULL;
        AVPN* cs = NULL;
@@ -1212,7 +1212,7 @@ extern AVPL* new_avpl_every_match(gchar* name, AVPL* src, AVPL* op, gboolean cop
  * Return value: a pointer to the newly created avpl containing the
  *                              matching avps.
  **/
-extern AVPL* new_avpl_exact_match(gchar* name,AVPL* src, AVPL* op, gboolean copy_avps) {
+extern AVPL* new_avpl_exact_match(const gchar* name,AVPL* src, AVPL* op, gboolean copy_avps) {
        AVPL* newavpl = new_avpl(name);
        AVPN* co = NULL;
        AVPN* cs = NULL;
@@ -1283,7 +1283,7 @@ extern AVPL* new_avpl_exact_match(gchar* name,AVPL* src, AVPL* op, gboolean copy
        return NULL;
 }
 
-extern AVPL* new_avpl_from_match(avpl_match_mode mode, gchar* name,AVPL* src, AVPL* op, gboolean copy_avps) {
+extern AVPL* new_avpl_from_match(avpl_match_mode mode, const gchar* name,AVPL* src, AVPL* op, gboolean copy_avps) {
        AVPL* avpl = NULL;
        
        switch (mode) {
@@ -1435,7 +1435,7 @@ extern void avpl_transform(AVPL* src, AVPL_Transf* op) {
  *
  * Return value: a pointer to the newly created loal.
  **/
-extern LoAL* new_loal(gchar* name) {
+extern LoAL* new_loal(const gchar* name) {
        LoAL* new_loal = g_mem_chunk_alloc(avp_chunk);
 
        if (! name) {
@@ -1614,7 +1614,7 @@ extern void delete_loal(LoAL* loal, gboolean avpls_too, gboolean avps_too) {
  * load_loal_error:
  * Used by loal_from_file to handle errors while loading.
  **/
-LoAL* load_loal_error(FILE* fp, LoAL* loal, AVPL* curr, int linenum, gchar* fmt, ...) {
+LoAL* load_loal_error(FILE* fp, LoAL* loal, AVPL* curr, int linenum, const gchar* fmt, ...) {
        va_list list;
        gchar* desc;
        LoAL* ret = NULL;
index 27af4fdccb468087e0eff39521ee673ede140a31..01eb9fa9bb2670a05df69bd87cfb1d6a12eb2a0b 100644 (file)
@@ -56,7 +56,7 @@ typedef struct _scs_collection SCS_collection;
 
 extern void destroy_scs_collection(SCS_collection* c);
 extern SCS_collection* scs_init(void);
-extern gchar* scs_subscribe(SCS_collection* collection, gchar* s);
+extern gchar* scs_subscribe(SCS_collection* collection, const gchar* s);
 extern void scs_unsubscribe(SCS_collection* collection, gchar* s);
 extern gchar* scs_subscribe_printf(SCS_collection* collection, gchar* fmt, ...);
 
@@ -157,13 +157,13 @@ extern void setup_avp_debug(FILE* fp, int* general, int* avp, int* avp_op, int*
  */
 
 /* creates a new avp */
-extern AVP* new_avp(gchar* name, gchar* value, gchar op);
+extern AVP* new_avp(const gchar* name, const gchar* value, gchar op);
 
 /* creates a copy od an avp */
 extern AVP* avp_copy(AVP* from);
 
 /* creates an avp from a field_info record */
-extern AVP* new_avp_from_finfo(gchar* name, field_info* finfo);
+extern AVP* new_avp_from_finfo(const gchar* name, field_info* finfo);
 
 /*
  * avp destructor
@@ -185,26 +185,26 @@ extern AVP* match_avp(AVP* src, AVP* op);
  */
 
 /* creates an empty avp list */
-extern AVPL* new_avpl(gchar* name);
+extern AVPL* new_avpl(const gchar* name);
 
 
 /* creates a copy of an avp list */
-extern AVPL* new_avpl_from_avpl(gchar* name, AVPL* avpl, gboolean copy_avps);
+extern AVPL* new_avpl_from_avpl(const gchar* name, AVPL* avpl, gboolean copy_avps);
 
 /* creates an avp list containing any avps in src matching any avps in op
    it will eventually create an empty list in none match */
-extern AVPL* new_avpl_loose_match(gchar* name,AVPL* src, AVPL* op, gboolean copy_avps);
+extern AVPL* new_avpl_loose_match(const gchar* name,AVPL* src, AVPL* op, gboolean copy_avps);
 
 /* creates an avp list containing any avps in src matching every avp in op
   it will not create a list if there is not a match for every attribute in op */
-extern AVPL* new_avpl_every_match(gchar* name,AVPL* src, AVPL* op, gboolean copy_avps);
+extern AVPL* new_avpl_every_match(const gchar* name,AVPL* src, AVPL* op, gboolean copy_avps);
 
 /* creates an avp list containing every avp in src matching every avp in op
    it will not create a list unless every avp in op is matched only once to avery avp in op */
-extern AVPL* new_avpl_exact_match(gchar* name,AVPL* src, AVPL* op, gboolean copy_avps);
+extern AVPL* new_avpl_exact_match(const gchar* name,AVPL* src, AVPL* op, gboolean copy_avps);
 
 /* uses mode to call one of the former matches. NO_MATCH = merge(merge(copy(src),op)) */
-extern AVPL* new_avpl_from_match(avpl_match_mode mode, gchar* name,AVPL* src, AVPL* op, gboolean copy_avps);
+extern AVPL* new_avpl_from_match(avpl_match_mode mode, const gchar* name,AVPL* src, AVPL* op, gboolean copy_avps);
 
 
 
@@ -262,7 +262,7 @@ extern void avpl_transform(AVPL* src, AVPL_Transf* op);
  */
 
 /* creates an empty list of avp lists */
-extern LoAL* new_loal(gchar* name);
+extern LoAL* new_loal(const gchar* name);
 
 /* given a file loads all the avpls contained in it
    every line is formatted as it is the output of avplist_to_string */
index dbf749c0f2b89417b2a496218ecaaca273857b11..abd941f8ab1f27d405d1e61065d501b2d8971a2b 100644 (file)
@@ -37,8 +37,8 @@ static mate_config* mc = NULL;
 
 static int proto_mate = -1;
 
-static gchar* pref_mate_config_filename = "";
-static gchar* current_mate_config_filename = NULL;
+static const gchar* pref_mate_config_filename = "";
+static const gchar* current_mate_config_filename = NULL;
 
 static proto_item *mate_i = NULL;
 
@@ -196,8 +196,8 @@ void mate_gop_tree(proto_tree* tree, tvbuff_t *tvb, mate_gop* gop) {
        float  rel_time;
        float  gop_time;
        float pdu_rel_time;
-       gchar* pdu_str;
-       gchar* type_str;
+       const gchar* pdu_str;
+       const gchar* type_str;
        guint32 pdu_item;
        
        gop_item = proto_tree_add_uint(tree,gop->cfg->hfid,tvb,0,0,gop->id);
index cf2a7d0087f35a24ef4b3d6ede5f6530b44e05cc..e53b4b126e7f22570c8ed98b4ab931f57e25ef52 100644 (file)
@@ -268,7 +268,7 @@ static int callagent_tcp_port = 0;
 static int callagent_udp_port = 0;
 
 /* Some basic utility functions that are specific to this dissector */
-static gboolean is_mgcp_verb(tvbuff_t *tvb, gint offset, gint maxlength, gchar **verb_name);
+static gboolean is_mgcp_verb(tvbuff_t *tvb, gint offset, gint maxlength, const gchar **verb_name);
 static gboolean is_mgcp_rspcode(tvbuff_t *tvb, gint offset, gint maxlength);
 static gint tvb_parse_param(tvbuff_t *tvb, gint offset, gint maxlength, int** hf);
 
@@ -345,7 +345,7 @@ static void dissect_mgcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
        guint32 num_messages;
        gint tvb_sectionend,tvb_sectionbegin, tvb_len, tvb_current_len;
        proto_tree *mgcp_tree, *ti;
-       gchar *verb_name = "";
+       const gchar *verb_name = "";
 
        /* Initialize variables */
        tvb_sectionend = 0;
@@ -451,7 +451,7 @@ static void dissect_mgcp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
        gint sectionlen;
        gint tvb_sectionend,tvb_sectionbegin, tvb_len, tvb_current_len;
        tvbuff_t *next_tvb;
-       gchar *verb_name = "";
+       const gchar *verb_name = "";
 
        /* Initialise stat info for passing to tap */
        pi_current++;
@@ -950,7 +950,7 @@ void proto_reg_handoff_mgcp(void)
  *
  * Return: TRUE if there is an MGCP verb at offset in tvb, otherwise FALSE
  */
-static gboolean is_mgcp_verb(tvbuff_t *tvb, gint offset, gint maxlength, gchar **verb_name)
+static gboolean is_mgcp_verb(tvbuff_t *tvb, gint offset, gint maxlength, const gchar **verb_name)
 {
        int returnvalue = FALSE;
        guint8 word[5];
@@ -1321,7 +1321,7 @@ static void dissect_mgcp_firstline(tvbuff_t *tvb, packet_info *pinfo, proto_tree
        mgcp_call_t *mgcp_call = NULL;
        nstime_t delta;
        gint rspcode = 0;
-       gchar *verb_description = "";
+       const gchar *verb_description = "";
        char code_with_verb[64] = "";  /* To fit "<4-letter-code> (<longest-verb>)" */
 
        static address null_address = { AT_NONE, 0, NULL };
index 830dc5c34a97f46ce8f425dec3f9ec8d9477ba31..c83da77b35420d30c1949ea0993e1bf7dc83eddd 100644 (file)
 
 /* Internal structure to dissect attributes */
 typedef struct {
-       guint16 attribute_type;         /* attribute code */
-        char    *tree_text;             /* text for fold out */
-        gint    *tree_id;               /* id for add_item */
-        int*   hf_type_attribute;      /* id for seach option */
-        void    (*dissect)(tvbuff_t *tvb, proto_tree *tree, int* hfValue, int offset, int length);
+       guint16         attribute_type;         /* attribute code */
+        const char     *tree_text;             /* text for fold out */
+        gint           *tree_id;               /* id for add_item */
+        int*           hf_type_attribute;      /* id for seach option */
+        void           (*dissect)(tvbuff_t *tvb, proto_tree *tree, int* hfValue, int offset, int length);
 } opsi_attribute_handle_t;
 
 
index 4dcdafd79744835092731f980f6e336c27b3d000..9c94be0f33f3cf6aefaf795ce6066b7b885c40fa 100644 (file)
@@ -329,7 +329,7 @@ dissect_pn_padding(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
 
 /* append the given info text */
 static void
-pn_append_info(packet_info *pinfo, proto_item *dcp_item, char *text)
+pn_append_info(packet_info *pinfo, proto_item *dcp_item, const char *text)
 {
     if (check_col(pinfo->cinfo, COL_INFO))
         col_append_fstr(pinfo->cinfo, COL_INFO, text);
index 79d2e98caa3973e666d68e02ab4bb877ac260784..8c9d9c6a5cd8d982c388d6f8c9d32199da77a9e4 100644 (file)
@@ -120,7 +120,7 @@ dissect_rlm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
        proto_item *ti;
        proto_tree *rlm_tree;
        guint8 rlm_type, version;
-       char *type_str = NULL;
+       const char *type_str = NULL;
 
        if (pinfo->srcport < 3000 || pinfo->srcport > 3015
                        || pinfo->destport < 3000 || pinfo->destport > 3015
diff --git a/print.c b/print.c
index f07323579568eda64b7a626ebab14e8f03bdcc56..bef3745ab1dad8629542cc3fccef09eb3b0dedaf 100644 (file)
--- a/print.c
+++ b/print.c
@@ -228,7 +228,7 @@ proto_tree_write_node_pdml(proto_node *node, gpointer data)
 {
        field_info      *fi = PITEM_FINFO(node);
        write_pdml_data *pdata = (write_pdml_data*) data;
-       gchar           *label_ptr;
+       const gchar     *label_ptr;
        gchar           label_str[ITEM_LABEL_LENGTH];
        char            *dfilter_string;
        int             chop_len;
index bd3d3e7baeb8dee7229a53b6c5421c35ab1fe108..15a329818431f756554c63837eb8f67504bf76b1 100644 (file)
--- a/randpkt.c
+++ b/randpkt.c
@@ -74,12 +74,12 @@ enum {
 };
 
 typedef struct {
-       char    *abbrev;
-       char    *longname;
-       int     produceable_type;
-       guint8  *sample_buffer;
-       int     sample_wtap_encap;
-       int     sample_length;
+       const char      *abbrev;
+       const char      *longname;
+       int             produceable_type;
+       guint8          *sample_buffer;
+       int             sample_wtap_encap;
+       int             sample_length;
 } pkt_example;
 
 /* Ethernet, indicating ARP */
index f20137e816b80f83703139ac3255250b8b9f899f..1b1499ae123fb5a4ad22104e70983e70dad6dd69 100644 (file)
@@ -50,7 +50,7 @@
 #include <string.h>
 
 typedef struct _io_users_t {
-       char *type;
+       const char *type;
        char *filter;
        struct _io_users_item_t *items;
 } io_users_t;
@@ -582,7 +582,7 @@ void
 iousers_init(char *optarg)
 {
        char *filter=NULL;
-       char *tap_type, *tap_type_name;
+       const char *tap_type, *tap_type_name;
        tap_packet_cb packet_func;
        io_users_t *iu=NULL;
        GString *error_string;
index 5e499deb3a17ab3384801035395e82bef0822e6a..d69f3f4942fc761f1911e95759ac9eb5d138d13e 100644 (file)
@@ -197,7 +197,7 @@ static void show_print_file_io_error(int err);
 static gboolean write_preamble(capture_file *cf);
 static gboolean print_packet(capture_file *cf, epan_dissect_t *edt);
 static gboolean write_finale(void);
-static char *cf_open_error_message(int err, gchar *err_info,
+static const char *cf_open_error_message(int err, gchar *err_info,
     gboolean for_writing, int file_type);
 #ifdef HAVE_LIBPCAP
 #ifndef _WIN32
@@ -1470,7 +1470,7 @@ capture(char *save_file, int out_file_type)
 #ifndef _WIN32
   void        (*oldhandler)(int);
   static const char ppamsg[] = "can't find PPA for ";
-  char       *libpcap_warn;
+  const char  *libpcap_warn;
   volatile int pipe_fd = -1;
   struct pcap_hdr hdr;
   struct pcaprec_modified_hdr rechdr;
@@ -2853,11 +2853,11 @@ show_print_file_io_error(int err)
   }
 }
 
-static char *
+static const char *
 cf_open_error_message(int err, gchar *err_info, gboolean for_writing,
                       int file_type)
 {
-  char *errmsg;
+  const char *errmsg;
   static char errmsg_errno[1024+1];
 
   if (err < 0) {
index a1374af38f22573a33992b2566c38078a8d07b57..9c5bedbb572e2448c1bac37c07aa4f11de05e75f 100644 (file)
@@ -176,10 +176,10 @@ static guint32 ts_usec = 0;
 static char *ts_fmt = NULL;
 
 /* Input file */
-static char *input_filename;
+static const char *input_filename;
 static FILE *input_file = NULL;
 /* Output file */
-static char *output_filename;
+static const char *output_filename;
 static FILE *output_file = NULL;
 
 /* Offset base to parse */
@@ -330,7 +330,7 @@ static unsigned long pcap_link_type = 1;   /* Default is DLT-EN10MB */
  * Pass in TRUE if this is an offset, FALSE if not
  */
 static unsigned long
-parse_num (char *str, int offset)
+parse_num (const char *str, int offset)
 {
     unsigned long num;
     char *c;
@@ -347,7 +347,7 @@ parse_num (char *str, int offset)
  * Write this byte into current packet
  */
 static void
-write_byte (char *str)
+write_byte (const char *str)
 {
     unsigned long num;
 
index 507805be6ddf5e25dce89bdae8952162a41abc46..b14b4f32719c569888e7ccb5542ebda1f052176a 100644 (file)
@@ -182,7 +182,7 @@ void ParseTrace(FILE *TraceFILE, char *zTracePrompt){
 
 /* For tracing shifts, the names of all terminals and nonterminals
 ** are required.  The following table supplies these names */
-static char *yyTokenName[] = {
+static const char *yyTokenName[] = {
 %%
 };
 #define YYTRACE(X) if( yyTraceFILE ) fprintf(yyTraceFILE,"%sReduce [%s].\n",yyTracePrompt,X);