Last set of char -> const char trivial warning fixes.
authorjmayer <jmayer@f5534014-38df-0310-8fa8-9805f1628bb7>
Sat, 6 Aug 2005 14:03:14 +0000 (14:03 +0000)
committerjmayer <jmayer@f5534014-38df-0310-8fa8-9805f1628bb7>
Sat, 6 Aug 2005 14:03:14 +0000 (14:03 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15244 f5534014-38df-0310-8fa8-9805f1628bb7

18 files changed:
capture_loop.c
capture_sync.c
file.c
filters.c
filters.h
gtk/io_stat.c
gtk/mtp3_stat.c
gtk/mtp3_summary.c
gtk/progress_dlg.c
gtk/rtp_analysis.c
gtk/sctp_chunk_stat_dlg.c
gtk/sctp_stat_dlg.c
gtk/tcp_graph.c
gtk/voip_calls_dlg.c
progress_dlg.h
tap-iostat.c
util.c
util.h

index 8b6e82a0ca9516401318aef382484607a382faf8..8421e73a322162c4efe0e5776d735c1d65a6fa60 100644 (file)
@@ -523,7 +523,7 @@ static int capture_loop_open_input(capture_options *capture_opts, loop_data *ld,
   WSADATA     wsaData;
 #else
   static const char ppamsg[] = "can't find PPA for ";
-  char       *libpcap_warn;
+  const char  *libpcap_warn;
 #endif
 
 
index 9c177afe67076081e36e6c14ddf4348abb838856..1d1750b09fe87f39d0204f9c1200002fcfceac16 100644 (file)
 
 
 #ifndef _WIN32
-static char *sync_pipe_signame(int);
+static const char *sync_pipe_signame(int);
 #endif
 
 
@@ -280,8 +280,8 @@ signal_pipe_capquit_to_child(capture_options *capture_opts)
 
 
 /* Add a string pointer to a NULL-terminated array of string pointers. */
-static char **
-sync_pipe_add_arg(char **args, int *argc, char *arg)
+static const char **
+sync_pipe_add_arg(const char **args, int *argc, const char *arg)
 {
   /* Grow the array; "*argc" currently contains the number of string
      pointers, *not* counting the NULL pointer at the end, so we have
@@ -344,7 +344,7 @@ sync_pipe_start(capture_options *capture_opts) {
     char errmsg[1024+1];
 #endif
     int argc;
-    char **argv;
+    const char **argv;
     enum PIPES { PIPE_READ, PIPE_WRITE };   /* Constants 0 and 1 for PIPE_READ and PIPE_WRITE */
     int sync_pipe[2];                       /* pipe used to send messages from child to parent */
 
@@ -727,10 +727,10 @@ sync_pipe_wait_for_child(capture_options *capture_opts)
 
 #ifndef _WIN32
 /* convert signal to corresponding name */
-static char *
+static const char *
 sync_pipe_signame(int sig)
 {
-  char *sigmsg;
+  const char *sigmsg;
   static char sigmsg_buf[6+1+3+1];
 
   switch (sig) {
diff --git a/file.c b/file.c
index bb1a963a4bc22f243a823fd6fb2088189fc1038e..b9960e7bdf8376d669053aaf92304aa15f5c6e73 100644 (file)
--- a/file.c
+++ b/file.c
@@ -126,7 +126,7 @@ static gboolean find_packet(capture_file *cf,
 static void cf_open_failure_alert_box(const char *filename, int err,
                                      gchar *err_info, gboolean for_writing,
                                      int file_type);
-static char *file_rename_error_message(int err);
+static const char *file_rename_error_message(int err);
 static void cf_write_failure_alert_box(const char *filename, int err);
 static void cf_close_failure_alert_box(const char *filename, int err);
 static   gboolean copy_binary_file(const char *from_filename, const char *to_filename);
@@ -331,8 +331,8 @@ cf_read(capture_file *cf)
   int         err;
   gchar       *err_info;
   const gchar *name_ptr;
-  gchar       *load_msg, *load_fmt = "%s";
-  char        *errmsg;
+  const gchar *load_msg, *load_fmt = "%s";
+  const char  *errmsg;
   char         errmsg_errno[1024+1];
   gchar        err_str[2048+1];
   long         data_offset;
@@ -933,7 +933,7 @@ cf_merge_files(char **out_filenamep, int in_file_count,
   int               i;
   char              errmsg_errno[1024+1];
   gchar             err_str[2048+1];
-  char             *errmsg;
+  const char       *errmsg;
   gboolean          got_read_error = FALSE, got_write_error = FALSE;
   long              data_offset;
   progdlg_t        *progbar = NULL;
@@ -1127,9 +1127,9 @@ cf_merge_files(char **out_filenamep, int in_file_count,
 cf_status_t
 cf_filter_packets(capture_file *cf, gchar *dftext, gboolean force)
 {
-  dfilter_t *dfcode;
-  char      *filter_new = dftext ? dftext : "";
-  char      *filter_old = cf->dfilter ? cf->dfilter : "";
+  dfilter_t  *dfcode;
+  const char *filter_new = dftext ? dftext : "";
+  const char *filter_old = cf->dfilter ? cf->dfilter : "";
 
   /* if new filter equals old one, do nothing unless told to do so */
   if (!force && strcmp(filter_new, filter_old) == 0) {
@@ -3084,7 +3084,7 @@ cf_save(capture_file *cf, const char *fname, packet_range_t *range, guint save_f
   wtap_dumper  *pdh;
   save_callback_args_t callback_args;
 
-  cf_callback_invoke(cf_cb_file_safe_started, (gpointer) fname);
+  cf_callback_invoke(cf_cb_file_safe_started, fname);
 
   /* don't write over an existing file. */
   /* this should've been already checked by our caller, just to be sure... */
@@ -3368,10 +3368,10 @@ cf_open_failure_alert_box(const char *filename, int err, gchar *err_info,
   }
 }
 
-static char *
+static const char *
 file_rename_error_message(int err)
 {
-  char *errmsg;
+  const char *errmsg;
   static char errmsg_errno[1024+1];
 
   switch (err) {
index 66174442e65da4284cdab91eb105c37029727f8d..86f570c520ad1e86740eab97d62602384e934d91 100644 (file)
--- a/filters.c
+++ b/filters.c
@@ -78,10 +78,11 @@ static GList *display_filters = NULL;
 #define INIT_BUF_SIZE  128
 
 void
-read_filter_list(filter_list_type_t list, char **pref_path_return,
+read_filter_list(filter_list_type_t list, const char **pref_path_return,
     int *errno_return)
 {
-  char       *ff_path, *ff_name;
+  const char *ff_name;
+  char       *ff_path;
   FILE       *ff;
   GList      **flp;
   GList      *fl_ent;
@@ -422,10 +423,11 @@ remove_from_filter_list(filter_list_type_t list, GList *fl_entry)
  * and "*errno_return" is set to the error.
  */
 void
-save_filter_list(filter_list_type_t list, char **pref_path_return,
+save_filter_list(filter_list_type_t list, const char **pref_path_return,
     int *errno_return)
 {
-  gchar      *ff_path, *ff_path_new, *ff_name;
+  const gchar *ff_name;
+  gchar      *ff_path, *ff_path_new;
   GList      *fl;
   GList      *flp;
   filter_def *filt;
index d059c8cc8027207d6818e78999143aeef4204ced..239b775679b164f433ca2e9f23a6027467de68cd 100644 (file)
--- a/filters.h
+++ b/filters.h
@@ -47,7 +47,7 @@ typedef struct {
  * the file we tried to read - it should be freed by our caller -
  * and "*errno_return" is set to the error.
  */
-void read_filter_list(filter_list_type_t list, char **pref_path_return,
+void read_filter_list(filter_list_type_t list, const char **pref_path_return,
     int *errno_return);
 
 /*
@@ -75,5 +75,5 @@ void remove_from_filter_list(filter_list_type_t list, GList *fl_entry);
  * the file we tried to read - it should be freed by our caller -
  * and "*errno_return" is set to the error.
  */
-void save_filter_list(filter_list_type_t list, char **pref_path_return,
+void save_filter_list(filter_list_type_t list, const char **pref_path_return,
     int *errno_return);
index d1f5d6fc0dfcd55ba6968a78d57712805f461781..c75b71c7099e888ad790b05b844c8dd48948784a 100644 (file)
@@ -73,7 +73,7 @@ static guint32 pixels_per_tick[MAX_PIXELS_PER_TICK] = {1, 2, 5, 10};
 #define PLOT_STYLE_IMPULSE     1
 #define PLOT_STYLE_FILLED_BAR  2
 #define MAX_PLOT_STYLES                3
-static char *plot_style_name[MAX_PLOT_STYLES] = {
+static const char *plot_style_name[MAX_PLOT_STYLES] = {
        "Line",
        "Impulse",
        "FBar",
@@ -84,12 +84,12 @@ static char *plot_style_name[MAX_PLOT_STYLES] = {
 #define COUNT_TYPE_BYTES    1
 #define COUNT_TYPE_ADVANCED 2
 #define MAX_COUNT_TYPES 3
-static char *count_type_names[MAX_COUNT_TYPES] = {"Packets/Tick", "Bytes/Tick", "Advanced..."};
+static const char *count_type_names[MAX_COUNT_TYPES] = {"Packets/Tick", "Bytes/Tick", "Advanced..."};
 
 /* unit is in ms */
 #define MAX_TICK_VALUES 5
 #define DEFAULT_TICK_VALUE 3
-static guint tick_interval_values[MAX_TICK_VALUES] = { 1, 10, 100, 1000, 10000 };
+static const guint tick_interval_values[MAX_TICK_VALUES] = { 1, 10, 100, 1000, 10000 };
 
 #define CALC_TYPE_SUM  0
 #define CALC_TYPE_COUNT        1
@@ -98,7 +98,7 @@ static guint tick_interval_values[MAX_TICK_VALUES] = { 1, 10, 100, 1000, 10000 }
 #define CALC_TYPE_AVG  4
 #define CALC_TYPE_LOAD 5
 #define MAX_CALC_TYPES 6
-static char *calc_type_names[MAX_CALC_TYPES] = {"SUM(*)", "COUNT(*)", "MAX(*)", "MIN(*)", "AVG(*)", "LOAD(*)"};
+static const char *calc_type_names[MAX_CALC_TYPES] = {"SUM(*)", "COUNT(*)", "MAX(*)", "MIN(*)", "AVG(*)", "LOAD(*)"};
 
 
 typedef struct _io_stat_calc_type_t {
@@ -1443,7 +1443,7 @@ create_frames_or_bytes_menu_items(io_stat_t *io, GtkWidget *menu)
 }
 
 static void
-create_ctrl_menu(io_stat_t *io, GtkWidget *box, char *name, void (*func)(io_stat_t *io, GtkWidget *menu))
+create_ctrl_menu(io_stat_t *io, GtkWidget *box, const char *name, void (*func)(io_stat_t *io, GtkWidget *menu))
 {
        GtkWidget *hbox;
        GtkWidget *label;
@@ -1678,7 +1678,7 @@ create_calc_types_menu_items(io_stat_graph_t *gio, GtkWidget *menu)
 
 
 static void
-create_advanced_menu(io_stat_graph_t *gio, GtkWidget *box, char *name, void (*func)(io_stat_graph_t *io, GtkWidget *menu))
+create_advanced_menu(io_stat_graph_t *gio, GtkWidget *box, const char *name, void (*func)(io_stat_graph_t *io, GtkWidget *menu))
 {
        GtkWidget *hbox;
        GtkWidget *label;
index 68c768ba6533af56229c8c9fee0aca2ffa883a19..398578997ea3dd94eb3a34569c2020623c1fc651 100644 (file)
@@ -65,7 +65,7 @@ typedef struct column_arrows {
 
 typedef struct _my_columns_t {
     guint32            value;
-    gchar              *strptr;
+    const gchar                *strptr;
     GtkJustification   just;
 } my_columns_t;
 
@@ -316,7 +316,7 @@ mtp3_stat_gtk_win_destroy_cb(
 static void
 mtp3_stat_gtk_win_create(
     mtp3_stat_dlg_t    *dlg_p,
-    char               *title)
+    const char         *title)
 {
     int                        i;
     column_arrows      *col_arrows;
index 51d31e8dad05b2fb2f304e7d597544dd8404cf13..8fd2d629ba676b0e5e06dfec7a2841fac549eebd 100644 (file)
@@ -65,7 +65,7 @@ typedef struct column_arrows {
 
 typedef struct _my_columns_t {
     guint32            value;
-    gchar              *strptr;
+    const gchar                *strptr;
     GtkJustification   just;
 } my_columns_t;
 
@@ -185,7 +185,7 @@ mtp3_sum_draw(
     int                        *tot_num_msus_p,
     double             *tot_num_bytes_p)
 {
-    char               *entries[MTP3_SUM_INIT_TABLE_NUM_COLUMNS];
+    const char         *entries[MTP3_SUM_INIT_TABLE_NUM_COLUMNS];
     int                        i, j;
     int                        num_msus;
     double             num_bytes;
index 85231aed5072b0774d03f8b9cb621a98e83db330..120763774f0083ab6a085166824d06c06b19217a 100644 (file)
@@ -326,7 +326,7 @@ stop_cb(GtkWidget *w _U_, gpointer data)
  * Update the progress information of the progress dialog box.
  */
 void
-update_progress_dlg(progdlg_t *dlg, gfloat percentage, gchar *status)
+update_progress_dlg(progdlg_t *dlg, gfloat percentage, const gchar *status)
 {
        GtkWidget *dlg_w = dlg->dlg_w;
        GtkWidget *prog_bar;
index 17712eb06171c3ca7152f02f6aadd17e1bffe4bc..cb724e0ed0de38451ebc46ca32045dfa5aa16171 100644 (file)
@@ -120,7 +120,7 @@ static guint32 yscale_max[MAX_YSCALE] = {AUTO_MAX_YSCALE, 1000, 2000, 5000, 1000
 #define MAX_PIXELS_PER_TICK 4
 #define DEFAULT_PIXELS_PER_TICK 1
 static guint32 pixels_per_tick[MAX_PIXELS_PER_TICK] = {1, 2, 5, 10};
-static char *graph_descr[4] = {"Fwd Jitter", "Fwd Difference", "Rvr Jitter", "Rvr Difference"};
+static const char *graph_descr[4] = {"Fwd Jitter", "Fwd Difference", "Rvr Jitter", "Rvr Difference"};
 /* unit is in ms */
 #define MAX_TICK_VALUES 5
 #define DEFAULT_TICK_VALUE 1
@@ -301,7 +301,7 @@ typedef struct _user_data_t {
 
 
 /* Column titles. */
-static gchar *titles[9] =  {
+static const gchar *titles[9] =  {
        "Packet",
        "Sequence",
        "Delta (ms)",
@@ -1998,7 +1998,7 @@ static void create_tick_interval_menu_items(user_data_t* user_data, GtkWidget *m
 }
 
 /****************************************************************************/
-static void create_ctrl_menu(user_data_t* user_data, GtkWidget *box, char *name, void (*func)(user_data_t* user_data, GtkWidget *menu))
+static void create_ctrl_menu(user_data_t* user_data, GtkWidget *box, const char *name, void (*func)(user_data_t* user_data, GtkWidget *menu))
 {
         GtkWidget *hbox;
         GtkWidget *label;
@@ -3113,11 +3113,11 @@ column_arrows* add_sort_by_column(GtkWidget* window, GtkWidget* clist,
        ascend_pm = gdk_pixmap_create_from_xpm_d(window->window,
                        &ascend_bm,
                        &win_style->bg[GTK_STATE_NORMAL],
-                       (gchar **)clist_ascend_xpm);
+                       (const gchar **)clist_ascend_xpm);
        descend_pm = gdk_pixmap_create_from_xpm_d(window->window,
                        &descend_bm,
                        &win_style->bg[GTK_STATE_NORMAL],
-                       (gchar **)clist_descend_xpm);
+                       (const gchar **)clist_descend_xpm);
 
        for (i=0; i<NUM_COLS; i++) {
                col_arrows[i].table = gtk_table_new(2, 2, FALSE);
@@ -3342,7 +3342,7 @@ void create_rtp_dialog(user_data_t* user_data)
 
 /****************************************************************************/
 static gboolean process_node(proto_node *ptree_node, header_field_info *hfinformation,
-                                                       gchar* proto_field, guint32* p_result)
+                                                       const gchar* proto_field, guint32* p_result)
 {
        field_info            *finfo;
        proto_node            *proto_sibling_node;
@@ -3382,9 +3382,9 @@ static gboolean process_node(proto_node *ptree_node, header_field_info *hfinform
 
 /****************************************************************************/
 static gboolean get_int_value_from_proto_tree(proto_tree *protocol_tree,
-                                                                                        gchar* proto_name,
-                                                                                        gchar* proto_field,
-                                                                                        guint32* p_result)
+                                                const gchar* proto_name,
+                                                const gchar* proto_field,
+                                                guint32* p_result)
 {
        proto_node      *ptree_node;
        header_field_info     *hfinformation;
index 8a74afe5a6f353aa690028aa65129a2d587820b9..023960d7ee851a3c307de8c2956c3335bd0613db 100644 (file)
@@ -68,10 +68,10 @@ enum chunk_types {
        COOKIE_ACK    = 11
 };
 
-char *chunk_name(int type)
+const char *chunk_name(int type)
 {
 #define CASE(x) case x: s=#x; break
-       char *s = "unknown";
+       const char *s = "unknown";
        switch (type)
        {
                CASE(DATA);
@@ -215,7 +215,7 @@ gtk_sctpstat_dlg(struct sctp_udata *u_data, unsigned int direction)
        GtkWidget *hbuttonbox2;
        GtkWidget *bt_close;
 
-       gchar *titles[NUM_COLS] =  {"IP Address", "DATA", "INIT", "INIT_ACK", "SACK", "HEARTBEAT", "HEARTBEAT_ACK", "ABORT", "SHUTDOWN", "SHUTDOWN_ACK", "ERROR", "COOKIE_ECHO", "COOKIE_ACK", "Others"};
+       const gchar *titles[NUM_COLS] =  {"IP Address", "DATA", "INIT", "INIT_ACK", "SACK", "HEARTBEAT", "HEARTBEAT_ACK", "ABORT", "SHUTDOWN", "SHUTDOWN_ACK", "ERROR", "COOKIE_ECHO", "COOKIE_ACK", "Others"};
        column_arrows *col_arrows;
        GdkBitmap *ascend_bm, *descend_bm;
        GdkPixmap *ascend_pm, *descend_pm;
@@ -286,11 +286,11 @@ gtk_sctpstat_dlg(struct sctp_udata *u_data, unsigned int direction)
        ascend_pm = gdk_pixmap_create_from_xpm_d(scrolledwindow1->window,
                                                 &ascend_bm,
                                                 &win_style->bg[GTK_STATE_NORMAL],
-                                                (gchar **)clist_ascend_xpm);
+                                                (const gchar **)clist_ascend_xpm);
        descend_pm = gdk_pixmap_create_from_xpm_d(scrolledwindow1->window,
                                                  &descend_bm,
                                                  &win_style->bg[GTK_STATE_NORMAL],
-                                                 (gchar **)clist_descend_xpm);
+                                                 (const gchar **)clist_descend_xpm);
        for (i=0; i<NUM_COLS; i++)
        {
                col_arrows[i].table = gtk_table_new(2, 2, FALSE);
index 9a91147c9407d143ae2015ce53aead3bf8a3a1b9..39455c7158a481705d20ac2c743118c7ea81245a 100644 (file)
@@ -438,7 +438,7 @@ gtk_sctpstat_dlg(void)
        GtkWidget *hbuttonbox2;
        GtkWidget *bt_close;
 
-       gchar *titles[NUM_COLS] =  {"Port 1","Port 2", "No of Packets", "Checksum", "No of Errors", "Data Chunks", "Data Bytes"};
+       const gchar *titles[NUM_COLS] =  {"Port 1","Port 2", "No of Packets", "Checksum", "No of Errors", "Data Chunks", "Data Bytes"};
        column_arrows *col_arrows;
        GdkBitmap *ascend_bm, *descend_bm;
        GdkPixmap *ascend_pm, *descend_pm;
@@ -495,11 +495,11 @@ gtk_sctpstat_dlg(void)
        ascend_pm = gdk_pixmap_create_from_xpm_d(scrolledwindow1->window,
                                                 &ascend_bm,
                                                 &win_style->bg[GTK_STATE_NORMAL],
-                                                (gchar **)clist_ascend_xpm);
+                                                (const gchar **)clist_ascend_xpm);
        descend_pm = gdk_pixmap_create_from_xpm_d(scrolledwindow1->window,
                                                  &descend_bm,
                                                  &win_style->bg[GTK_STATE_NORMAL],
-                                                 (gchar **)clist_descend_xpm);
+                                                 (const gchar **)clist_descend_xpm);
        for (i=0; i<NUM_COLS; i++)
        {
                col_arrows[i].table = gtk_table_new(2, 2, FALSE);
index c79ca601b2909be60df98dced7f389d22fb07b8a..5cb0ac1e6a311b0ea3f124114408ad4cbee9ff54 100644 (file)
@@ -159,7 +159,7 @@ struct axis {
        struct irect s;
        gdouble min, max;
        gdouble major, minor;           /* major and minor ticks */
-       char **label;
+       const char **label;
 };
 
 #define HAXIS_INIT_HEIGHT      70
@@ -292,7 +292,7 @@ struct graph {
                /* this belongs to style structs of graph types that make use of it */
                GtkToggleButton *time_orig_conn, *seq_orig_isn;
        } gui;
-       char **title;
+       const char **title;
        /* Next 4 attribs describe the graph in natural units, before any scaling.
         * For example, if we want to display graph of TCP conversation that
         * started 112.309845 s after beginning of the capture and ran until
@@ -3297,14 +3297,14 @@ static void tseq_stevens_read_config (struct graph *g)
        g->s.tseq_stevens.seq_height = 4;
        g->s.tseq_stevens.flags = 0;
 
-       g->title = (char ** )g_malloc (2 * sizeof (char *));
+       g->title = (const char ** )g_malloc (2 * sizeof (char *));
        g->title[0] = "Time/Sequence Graph";
        g->title[1] = NULL;
-       g->y_axis->label = (char ** )g_malloc (3 * sizeof (char * ));
+       g->y_axis->label = (const char ** )g_malloc (3 * sizeof (char * ));
        g->y_axis->label[0] = "number[B]";
        g->y_axis->label[1] = "Sequence";
        g->y_axis->label[2] = NULL;
-       g->x_axis->label = (char ** )g_malloc (2 * sizeof (char * ));
+       g->x_axis->label = (const char ** )g_malloc (2 * sizeof (char * ));
        g->x_axis->label[0] = "Time[s]";
        g->x_axis->label[1] = NULL;
 }
@@ -3512,18 +3512,18 @@ static void tseq_tcptrace_read_config (struct graph *g)
        gdk_gc_set_foreground (g->s.tseq_tcptrace.gc_ack[1], &color);
 
        g->elists->next = (struct element_list * )
-                                                                               g_malloc (sizeof (struct element_list));
+                               g_malloc (sizeof (struct element_list));
        g->elists->next->next = NULL;
        g->elists->next->elements = NULL;
 
-       g->title = (char ** )g_malloc (2 * sizeof (char *));
+       g->title = (const char ** )g_malloc (2 * sizeof (char *));
        g->title[0] = "Time/Sequence Graph";
        g->title[1] = NULL;
-       g->y_axis->label = (char ** )g_malloc (3 * sizeof (char * ));
+       g->y_axis->label = (const char ** )g_malloc (3 * sizeof (char * ));
        g->y_axis->label[0] = "number[B]";
        g->y_axis->label[1] = "Sequence";
        g->y_axis->label[2] = NULL;
-       g->x_axis->label = (char ** )g_malloc (2 * sizeof (char * ));
+       g->x_axis->label = (const char ** )g_malloc (2 * sizeof (char * ));
        g->x_axis->label[0] = "Time[s]";
        g->x_axis->label[1] = NULL;
 }
@@ -3788,14 +3788,14 @@ static void tput_read_config (struct graph *g)
        g->s.tput.height = 4;
        g->s.tput.nsegs = 20;
 
-       g->title = (char ** )g_malloc (2 * sizeof (char *));
+       g->title = (const char ** )g_malloc (2 * sizeof (char *));
        g->title[0] = "Throughput Graph";
        g->title[1] = NULL;
-       g->y_axis->label = (char ** )g_malloc (3 * sizeof (char * ));
+       g->y_axis->label = (const char ** )g_malloc (3 * sizeof (char * ));
        g->y_axis->label[0] = "[B/s]";
        g->y_axis->label[1] = "Throughput";
        g->y_axis->label[2] = NULL;
-       g->x_axis->label = (char ** )g_malloc (2 * sizeof (char * ));
+       g->x_axis->label = (const char ** )g_malloc (2 * sizeof (char * ));
        g->x_axis->label[0] = "Time[s]";
        g->x_axis->label[1] = NULL;
        g->s.tput.flags = 0;
@@ -3821,13 +3821,13 @@ static void rtt_read_config (struct graph *g)
        g->s.rtt.height = 4;
        g->s.rtt.flags = 0;
 
-       g->title = (char ** )g_malloc (2 * sizeof (char *));
+       g->title = (const char ** )g_malloc (2 * sizeof (char *));
        g->title[0] = "Round Trip Time Graph";
        g->title[1] = NULL;
-       g->y_axis->label = (char ** )g_malloc (3 * sizeof (char * ));
+       g->y_axis->label = (const char ** )g_malloc (3 * sizeof (char * ));
        g->y_axis->label[0] = "RTT [s]";
        g->y_axis->label[1] = NULL;
-       g->x_axis->label = (char ** )g_malloc (2 * sizeof (char * ));
+       g->x_axis->label = (const char ** )g_malloc (2 * sizeof (char * ));
        g->x_axis->label[0] = "Sequence Number[B]";
        g->x_axis->label[1] = NULL;
 }
index a24adef296f7693f2852d68180c51c8dee40b01c..b77562ac06f1afdd819a709a1aeb56aeadf08b56 100644 (file)
@@ -239,7 +239,7 @@ voip_calls_on_filter                    (GtkButton       *button _U_,
        const gchar *filter_string;
        gchar c;
        GString *filter_string_fwd;
-       gchar *filter_prepend;
+       const gchar *filter_prepend;
        gboolean isFirst = TRUE;
        GList* list;
        guint filter_length = 0;
@@ -547,7 +547,7 @@ static void voip_calls_dlg_create (void)
        GtkWidget *bt_close;
        GtkTooltips *tooltips = gtk_tooltips_new();
 
-       gchar *titles[NUM_COLS] =  {"Start Time", "Stop Time", "Initial Speaker", "From",  "To", "Protocol", "Packets", "State", "Comments"};
+       const gchar *titles[NUM_COLS] =  {"Start Time", "Stop Time", "Initial Speaker", "From",  "To", "Protocol", "Packets", "State", "Comments"};
        column_arrows *col_arrows;
        GtkWidget *column_lb;
        int i;
index c50108b2b25e6096c822ab761a57401e601124b8..158b491356d9567dff08dd27708c402ded173b20 100644 (file)
@@ -75,7 +75,7 @@ delayed_create_progress_dlg(const gchar *task_title, const gchar *item_title,
  * @param percentage the current percentage value (0..1)
  * @param status the new status string to show, e.g. "3000KB of 6000KB"
  */
-void update_progress_dlg(progdlg_t *dlg, gfloat percentage, gchar *status);
+void update_progress_dlg(progdlg_t *dlg, gfloat percentage, const gchar *status);
 
 /**
  * Destroy the progress bar.
index 4a261f90adc924c243619f0a414b2595a4858fb0..c25f430108adc26caedc1ba31a588e268581990e 100644 (file)
@@ -43,7 +43,7 @@ typedef struct _io_stat_t {
        gint32 interval;        /* unit is ms */
        guint32 num_items;
        struct _io_stat_item_t *items;
-       char **filters;
+       const char **filters;
 } io_stat_t;   
 
 #define CALC_TYPE_BYTES        0
@@ -429,7 +429,7 @@ iostat_draw(void *arg)
 
 
 static int
-get_calc_field(char *filter, char **flt)
+get_calc_field(const char *filter, const char **flt)
 {
        char field[256];
        int i;
@@ -461,10 +461,10 @@ get_calc_field(char *filter, char **flt)
 }
 
 static void
-register_io_tap(io_stat_t *io, int i, char *filter)
+register_io_tap(io_stat_t *io, int i, const char *filter)
 {
        GString *error_string;
-       char *flt;
+       const char *flt;
 
        io->items[i].prev=&io->items[i];
        io->items[i].next=NULL;
diff --git a/util.c b/util.c
index 7b61d1b3f1e35967f664f10a32b309e8195b6e94..63050a54c7ab49f11f33d0cd8e9504b04e963115 100644 (file)
--- a/util.c
+++ b/util.c
@@ -112,7 +112,7 @@ get_args_as_string(int argc, char **argv, int optind)
 }
 
 static char *
-setup_tmpdir(char *dir)
+setup_tmpdir(const char *dir)
 {
        int len = strlen(dir);
        char *newdir;
@@ -266,7 +266,7 @@ compute_timestamp_diff(gint *diffsec, gint *diffusec,
    CLIENTNAME (terminal server): <remote name>
  */
 
-gchar *get_conn_cfilter(void) {
+const gchar *get_conn_cfilter(void) {
        static GString *filter_str = NULL;
        gchar *env, **tokens;
 
diff --git a/util.h b/util.h
index eadf6b9e686025ad7da5ed1fac89993ffcd0bb15..4da1a0c68bdbb5e5b7404565c62a94bd6d629edc 100644 (file)
--- a/util.h
+++ b/util.h
@@ -41,7 +41,7 @@ char *get_args_as_string(int, char **, int);
 void compute_timestamp_diff(gint *, gint *, guint32, guint32, guint32, guint32);
 
 /* Create a capture filter for the connection */
-char *get_conn_cfilter(void);
+const char *get_conn_cfilter(void);
 
 #ifdef __cplusplus
 }