[gnome-commander/gcmd-1-3] gcc warnings cleanup



commit 1d6f98111c025238ac65d0ce48f7d85185e82b56
Author: Piotr Eljasiak <epiotr src gnome org>
Date:   Wed Dec 16 16:52:00 2009 +0100

    gcc warnings cleanup

 libgcmd/libgcmd-widget-factory.cc |   20 ++++++++++----------
 libgcmd/libgcmd-widget-factory.h  |   26 +++++++++++++-------------
 libgcmd/plugin-info.h             |   12 ++++++------
 plugins/test/test-plugin.xpm      |    2 +-
 src/gnome-cmd-convert.cc          |    2 +-
 src/gnome-cmd-main-win.cc         |    2 +-
 src/gnome-cmd-search-dialog.cc    |    2 +-
 src/plugin_manager.cc             |    4 ++--
 8 files changed, 35 insertions(+), 35 deletions(-)
---
diff --git a/libgcmd/libgcmd-widget-factory.cc b/libgcmd/libgcmd-widget-factory.cc
index 3cc4275..524c32e 100644
--- a/libgcmd/libgcmd-widget-factory.cc
+++ b/libgcmd/libgcmd-widget-factory.cc
@@ -221,7 +221,7 @@ GtkWidget *create_named_button_with_data (GtkWidget *parent, const gchar *label,
 }
 
 
-GtkWidget * create_named_stock_button_with_data (GtkWidget *parent, gconstpointer stock, gchar *name, GtkSignalFunc func, gpointer data)
+GtkWidget * create_named_stock_button_with_data (GtkWidget *parent, gconstpointer stock, const gchar *name, GtkSignalFunc func, gpointer data)
 {
     GtkWidget *w = gtk_button_new_from_stock ((const gchar *) stock);
     gtk_widget_ref (w);
@@ -246,7 +246,7 @@ GtkWidget *create_entry (GtkWidget *parent, const gchar *name, const gchar *valu
 }
 
 
-GtkWidget *create_check (GtkWidget *parent, gchar *text, gchar *name)
+GtkWidget *create_check (GtkWidget *parent, const gchar *text, const gchar *name)
 {
     GtkWidget *btn = gtk_check_button_new_with_label (text);
     gtk_widget_ref (btn);
@@ -270,7 +270,7 @@ GtkWidget *create_radio (GtkWidget *parent, GSList *group, const gchar *text, co
 }
 
 
-GtkWidget *create_spin (GtkWidget *parent, gchar *name, gint min, gint max, gint value)
+GtkWidget *create_spin (GtkWidget *parent, const gchar *name, gint min, gint max, gint value)
 {
     GtkObject *adj;
     GtkWidget *spin;
@@ -286,7 +286,7 @@ GtkWidget *create_spin (GtkWidget *parent, gchar *name, gint min, gint max, gint
 }
 
 
-GtkWidget *create_color_button (GtkWidget *parent, gchar *name)
+GtkWidget *create_color_button (GtkWidget *parent, const gchar *name)
 {
     GtkWidget *w = gtk_color_button_new ();
     gtk_widget_ref (w);
@@ -296,7 +296,7 @@ GtkWidget *create_color_button (GtkWidget *parent, gchar *name)
 }
 
 
-GtkWidget *create_icon_entry (GtkWidget *parent, gchar *name, const gchar *icon_path)
+GtkWidget *create_icon_entry (GtkWidget *parent, const gchar *name, const gchar *icon_path)
 {
     GtkWidget *icon_entry = gnome_icon_entry_new (NULL, NULL);
     gtk_widget_ref (icon_entry);
@@ -308,7 +308,7 @@ GtkWidget *create_icon_entry (GtkWidget *parent, gchar *name, const gchar *icon_
 }
 
 
-GtkWidget *create_scale (GtkWidget *parent, gchar *name, gint value, gint min, gint max)
+GtkWidget *create_scale (GtkWidget *parent, const gchar *name, gint value, gint min, gint max)
 {
     GtkWidget *scale = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (value, min, max, 0, 0, 0)));
 
@@ -321,7 +321,7 @@ GtkWidget *create_scale (GtkWidget *parent, gchar *name, gint value, gint min, g
 }
 
 
-GtkWidget *create_file_entry (GtkWidget *parent, gchar *name, const gchar *value)
+GtkWidget *create_file_entry (GtkWidget *parent, const gchar *name, const gchar *value)
 {
     GtkWidget *fentry, *entry;
 
@@ -341,7 +341,7 @@ GtkWidget *create_file_entry (GtkWidget *parent, gchar *name, const gchar *value
 }
 
 
-GtkWidget *create_clist (GtkWidget *parent, gchar *name, gint cols, gint rowh, GtkSignalFunc on_row_selected, GtkSignalFunc on_row_moved)
+GtkWidget *create_clist (GtkWidget *parent, const gchar *name, gint cols, gint rowh, GtkSignalFunc on_row_selected, GtkSignalFunc on_row_moved)
 {
     GtkWidget *sw, *clist;
 
@@ -368,7 +368,7 @@ GtkWidget *create_clist (GtkWidget *parent, gchar *name, gint cols, gint rowh, G
 }
 
 
-void create_clist_column (GtkWidget *sw, gint col, gint width, gchar *label)
+void create_clist_column (GtkWidget *sw, gint col, gint width, const gchar *label)
 {
     GtkWidget *clist = (GtkWidget *) gtk_object_get_data (GTK_OBJECT (sw), "clist");
     gtk_clist_set_column_width (GTK_CLIST (clist), col, width);
@@ -480,7 +480,7 @@ void progress_bar_update (GtkWidget *pbar, gint max)
 }
 
 
-const char *get_entry_text (GtkWidget *parent, gchar *entry_name)
+const char *get_entry_text (GtkWidget *parent, const gchar *entry_name)
 {
     GtkWidget *entry = lookup_widget (parent, entry_name);
     if (!entry) return NULL;
diff --git a/libgcmd/libgcmd-widget-factory.h b/libgcmd/libgcmd-widget-factory.h
index eec0506..5e199ea 100644
--- a/libgcmd/libgcmd-widget-factory.h
+++ b/libgcmd/libgcmd-widget-factory.h
@@ -64,24 +64,24 @@ inline GtkWidget *create_button_with_data (GtkWidget *parent, const gchar *label
     return create_named_button_with_data (parent, label, "button", func, data);
 }
 
-inline GtkWidget *create_button (GtkWidget *parent, gchar *label, GtkSignalFunc func)
+inline GtkWidget *create_button (GtkWidget *parent, const gchar *label, GtkSignalFunc func)
 {
     return create_button_with_data (parent, label, func, parent);
 }
 
-inline GtkWidget *create_named_button (GtkWidget *parent, gchar *label, gchar *name, GtkSignalFunc func)
+inline GtkWidget *create_named_button (GtkWidget *parent, const gchar *label, const gchar *name, GtkSignalFunc func)
 {
     return create_named_button_with_data (parent, label, name, func, parent);
 }
 
-GtkWidget *create_named_stock_button_with_data (GtkWidget *parent, gconstpointer stock, gchar *name, GtkSignalFunc func, gpointer data);
+GtkWidget *create_named_stock_button_with_data (GtkWidget *parent, gconstpointer stock, const gchar *name, GtkSignalFunc func, gpointer data);
 
 inline GtkWidget *create_stock_button_with_data (GtkWidget *parent, gconstpointer stock, GtkSignalFunc func, gpointer data)
 {
     return create_named_stock_button_with_data (parent, stock, "button", func, data);
 }
 
-inline GtkWidget *create_named_stock_button (GtkWidget *parent, gconstpointer stock, gchar *name, GtkSignalFunc func)
+inline GtkWidget *create_named_stock_button (GtkWidget *parent, gconstpointer stock, const gchar *name, GtkSignalFunc func)
 {
     return create_named_stock_button_with_data (parent, stock, name, func, parent);
 }
@@ -93,23 +93,23 @@ inline GtkWidget *create_stock_button (GtkWidget *parent, gconstpointer stock, G
 
 GtkWidget *create_entry (GtkWidget *parent, const gchar *name, const gchar *value);
 
-GtkWidget *create_check (GtkWidget *parent, gchar *text, gchar *name);
+GtkWidget *create_check (GtkWidget *parent, const gchar *text, const gchar *name);
 
 GtkWidget *create_radio (GtkWidget *parent, GSList *group, const gchar *text, const gchar *name);
 
-GtkWidget *create_spin (GtkWidget *parent, gchar *name, gint min, gint max, gint value);
+GtkWidget *create_spin (GtkWidget *parent, const gchar *name, gint min, gint max, gint value);
 
-GtkWidget *create_color_button (GtkWidget *parent, gchar *name);
+GtkWidget *create_color_button (GtkWidget *parent, const gchar *name);
 
-GtkWidget *create_icon_entry (GtkWidget *parent, gchar *name, const gchar *icon_path);
+GtkWidget *create_icon_entry (GtkWidget *parent, const gchar *name, const gchar *icon_path);
 
-GtkWidget *create_scale (GtkWidget *parent, gchar *name, gint value, gint min, gint max);
+GtkWidget *create_scale (GtkWidget *parent, const gchar *name, gint value, gint min, gint max);
 
-GtkWidget *create_file_entry (GtkWidget *parent, gchar *name, const gchar *value);
+GtkWidget *create_file_entry (GtkWidget *parent, const gchar *name, const gchar *value);
 
-GtkWidget *create_clist (GtkWidget *parent, gchar *name, gint cols, gint rowh, GtkSignalFunc on_row_selected, GtkSignalFunc on_row_moved);
+GtkWidget *create_clist (GtkWidget *parent, const gchar *name, gint cols, gint rowh, GtkSignalFunc on_row_selected, GtkSignalFunc on_row_moved);
 
-void create_clist_column (GtkWidget *sw, gint col, gint width, gchar *label);
+void create_clist_column (GtkWidget *sw, gint col, gint width, const gchar *label);
 
 GtkWidget *create_vbuttonbox (GtkWidget *parent);
 
@@ -144,7 +144,7 @@ GtkWidget *create_sw (GtkWidget *parent);
 
 void progress_bar_update (GtkWidget *pbar, gint max);
 
-const char *get_entry_text (GtkWidget *parent, gchar *entry_name);
+const char *get_entry_text (GtkWidget *parent, const gchar *entry_name);
 
 void create_error_dialog (const gchar *msg, ...);
 
diff --git a/libgcmd/plugin-info.h b/libgcmd/plugin-info.h
index 52bfc38..f005254 100644
--- a/libgcmd/plugin-info.h
+++ b/libgcmd/plugin-info.h
@@ -34,14 +34,14 @@
 typedef struct {
     gint plugin_system_version;
 
-    gchar *name;
-    gchar *version;
-    gchar *copyright;
-    gchar *comments;
+    const gchar *name;
+    const gchar *version;
+    const gchar *copyright;
+    const gchar *comments;
     gchar **authors;
     gchar **documenters;
-    gchar *translator;
-    gchar *webpage;
+    const gchar *translator;
+    const gchar *webpage;
 } PluginInfo;
 
 
diff --git a/plugins/test/test-plugin.xpm b/plugins/test/test-plugin.xpm
index be504d5..5b743b8 100644
--- a/plugins/test/test-plugin.xpm
+++ b/plugins/test/test-plugin.xpm
@@ -1,5 +1,5 @@
 /* XPM */
-static char * test_plugin_xpm[] = {
+static const char * test_plugin_xpm[] = {
 "16 16 2 1",
 " 	c None",
 ".	c #000000",
diff --git a/src/gnome-cmd-convert.cc b/src/gnome-cmd-convert.cc
index 38af334..3f689e7 100644
--- a/src/gnome-cmd-convert.cc
+++ b/src/gnome-cmd-convert.cc
@@ -143,7 +143,7 @@ gchar *gcmd_convert_sentence_case (gchar *string)
     gunichar c;
     // There have to be space at the end of words to seperate them from prefix
     // Chicago Manual of Style "Heading caps" Capitalization Rules (CMS 1993, 282) (http://www.docstyles.com/cmscrib.htm#Note2)
-    static gchar *exempt[] =
+    static const gchar *exempt[] =
     {
         "a ",       "a_",
         "against ", "against_",
diff --git a/src/gnome-cmd-main-win.cc b/src/gnome-cmd-main-win.cc
index dc3548d..5acf84d 100644
--- a/src/gnome-cmd-main-win.cc
+++ b/src/gnome-cmd-main-win.cc
@@ -170,7 +170,7 @@ gint gnome_cmd_key_snooper(GtkWidget *grab_widget, GdkEventKey *event, GnomeCmdM
 
 inline GtkWidget *add_buttonbar_button (char *label,
                                         GnomeCmdMainWin *mw,
-                                        char *data_label,
+                                        const char *data_label,
                                         GtkAccelGroup *accel_group,
                                         gint accel_signal_id)
 {
diff --git a/src/gnome-cmd-search-dialog.cc b/src/gnome-cmd-search-dialog.cc
index fffdedd..8b749a7 100644
--- a/src/gnome-cmd-search-dialog.cc
+++ b/src/gnome-cmd-search-dialog.cc
@@ -739,7 +739,7 @@ inline GtkWidget *create_label_with_mnemonic (GtkWidget *parent, const gchar *te
 /*
  * create a check_box_button with keyboard shortcut
  */
-inline GtkWidget *create_check_with_mnemonic (GtkWidget *parent, gchar *text, gchar *name)
+inline GtkWidget *create_check_with_mnemonic (GtkWidget *parent, const gchar *text, const gchar *name)
 {
     GtkWidget *btn = gtk_check_button_new_with_mnemonic (text);
 
diff --git a/src/plugin_manager.cc b/src/plugin_manager.cc
index 246d4a6..0dc890e 100644
--- a/src/plugin_manager.cc
+++ b/src/plugin_manager.cc
@@ -281,8 +281,8 @@ static void update_plugin_list (GtkCList *list, GtkWidget *dialog)
         gchar *text[5];
 
         text[0] = NULL;
-        text[1] = data->info->name;
-        text[2] = data->info->version;
+        text[1] = (gchar *) data->info->name;
+        text[2] = (gchar *) data->info->version;
         text[3] = data->fname;
         text[4] = NULL;
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]