[gtranslator] Fix some compiler warnings



commit b77593c97e15de25e2b15df55f98dd20659f63bc
Author: Jonh Wendell <jwendell gnome org>
Date:   Mon Feb 8 09:27:23 2010 -0300

    Fix some compiler warnings

 src/gtr-actions-edit.c      |    1 +
 src/gtr-actions-file.c      |    7 +-----
 src/gtr-actions-go.c        |    4 ---
 src/gtr-actions-help.c      |    2 +
 src/gtr-actions-search.c    |   33 ---------------------------
 src/gtr-header.c            |    2 -
 src/gtr-io-error-info-bar.c |    2 +-
 src/gtr-po.c                |   13 +++++-----
 src/gtr-prefs-manager.c     |    9 -------
 src/gtr-profile.c           |   52 +++++++++++++++++++++---------------------
 src/gtr-utils.c             |    6 ++--
 src/gtr-view.c              |    1 -
 src/gtr-window.c            |   37 +-----------------------------
 13 files changed, 42 insertions(+), 127 deletions(-)
---
diff --git a/src/gtr-actions-edit.c b/src/gtr-actions-edit.c
index 0281c3f..39380a6 100644
--- a/src/gtr-actions-edit.c
+++ b/src/gtr-actions-edit.c
@@ -26,6 +26,7 @@
 
 #include "dialogs/gtr-header-dialog.h"
 #include "dialogs/gtr-comment-dialog.h"
+#include "dialogs/gtr-preferences-dialog.h"
 #include "gtr-actions.h"
 #include "gtr-msg.h"
 #include "gtr-po.h"
diff --git a/src/gtr-actions-file.c b/src/gtr-actions-file.c
index 74bdbbf..289e24b 100644
--- a/src/gtr-actions-file.c
+++ b/src/gtr-actions-file.c
@@ -80,7 +80,7 @@ gtr_open (GFile * location, GtrWindow * window, GError ** error)
   /*
    * If not a crash/temporary file, add to the history.
    */
-  _gtr_recent_add (window, location, project_id);
+  _gtr_recent_add (window, location, (gchar *)project_id);
 
   /*
    * Create a page to add to our list of open files
@@ -741,11 +741,6 @@ close_all_documents (GtrWindow * window, gboolean logout_mode)
 void
 gtr_file_quit (GtkAction * action, GtrWindow * window)
 {
-  GtrNotebook *nb;
-  GtrTab *tab;
-  GtrPo *po;
-  gint pages;
-  GList *list = NULL;
   GList *profiles_list = NULL;
   gchar *config_folder;
   gchar *filename, *filename_temp;
diff --git a/src/gtr-actions-go.c b/src/gtr-actions-go.c
index d16a3bd..6a8bffa 100644
--- a/src/gtr-actions-go.c
+++ b/src/gtr-actions-go.c
@@ -108,7 +108,6 @@ gtr_message_go_to_next_untranslated (GtkAction * action, GtrWindow * window)
 {
   GtrTab *current;
   GtrPo *po;
-  GList *msg;
 
   current = gtr_window_get_active_tab (window);
   po = gtr_tab_get_po (current);
@@ -121,7 +120,6 @@ gtr_message_go_to_prev_untranslated (GtkAction * action, GtrWindow * window)
 {
   GtrTab *current;
   GtrPo *po;
-  GList *msg;
 
   current = gtr_window_get_active_tab (window);
   po = gtr_tab_get_po (current);
@@ -135,7 +133,6 @@ gtr_message_go_to_next_fuzzy_or_untranslated (GtkAction * action,
 {
   GtrTab *current;
   GtrPo *po;
-  GList *msg;
 
   current = gtr_window_get_active_tab (window);
   po = gtr_tab_get_po (current);
@@ -149,7 +146,6 @@ gtr_message_go_to_prev_fuzzy_or_untranslated (GtkAction * action,
 {
   GtrTab *current;
   GtrPo *po;
-  GList *msg;
 
   current = gtr_window_get_active_tab (window);
   po = gtr_tab_get_po (current);
diff --git a/src/gtr-actions-help.c b/src/gtr-actions-help.c
index 86aa4ff..70ce85b 100644
--- a/src/gtr-actions-help.c
+++ b/src/gtr-actions-help.c
@@ -23,7 +23,9 @@
 #include <config.h>
 #endif
 
+#include "gtr-actions.h"
 #include "gtr-dirs.h"
+#include "gtr-utils.h"
 #include "gtr-window.h"
 
 #include <glib.h>
diff --git a/src/gtr-actions-search.c b/src/gtr-actions-search.c
index fa8d47e..4186e56 100644
--- a/src/gtr-actions-search.c
+++ b/src/gtr-actions-search.c
@@ -730,36 +730,3 @@ _gtr_actions_search_replace (GtkAction * action, GtrWindow * window)
 
   gtk_widget_show (replace_dialog);
 }
-
-static void
-do_find_again (GtrWindow * window, gboolean backward)
-{
-  GtrView *active_view;
-  GtkTextBuffer *buffer;
-  gboolean wrap_around = TRUE;
-  LastSearchData *data;
-
-  active_view = gtr_window_get_active_view (window);
-  g_return_if_fail (active_view != NULL);
-
-  buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (active_view));
-
-  data = g_object_get_data (G_OBJECT (buffer), GTR_LAST_SEARCH_DATA_KEY);
-
-  if (data != NULL)
-    wrap_around = data->wrap_around;
-
-  //run_search (active_view);
-}
-
-void
-_gtr_actions_search_find_next (GtkAction * action, GtrWindow * window)
-{
-  do_find_again (window, FALSE);
-}
-
-void
-_gtr_actions_search_find_prev (GtkAction * action, GtrWindow * window)
-{
-  do_find_again (window, TRUE);
-}
diff --git a/src/gtr-header.c b/src/gtr-header.c
index b94b7fc..cc77a67 100644
--- a/src/gtr-header.c
+++ b/src/gtr-header.c
@@ -484,8 +484,6 @@ gtr_header_set_plural_forms (GtrHeader * header, const gchar * plural_forms)
 gint
 gtr_header_get_nplurals (GtrHeader * header)
 {
-  const gchar *plural_form;
-
   g_return_val_if_fail (GTR_IS_HEADER (header), 1);
 
   if (header->priv->nplurals > -1)
diff --git a/src/gtr-io-error-info-bar.c b/src/gtr-io-error-info-bar.c
index 7f8434c..7d8179e 100644
--- a/src/gtr-io-error-info-bar.c
+++ b/src/gtr-io-error-info-bar.c
@@ -100,7 +100,7 @@ set_info_bar_text_and_icon (GtkInfoBar * infobar,
 /*
  * Callback func called when warning button is clicked
  */
-void
+static void
 warning_message_button_clicked (GtkWidget * widget,
                                 gint response_id, gpointer data)
 {
diff --git a/src/gtr-po.c b/src/gtr-po.c
index 35e9729..1e0c230 100644
--- a/src/gtr-po.c
+++ b/src/gtr-po.c
@@ -505,7 +505,6 @@ void
 gtr_po_save_file (GtrPo * po, GError ** error)
 {
   struct po_xerror_handler handler;
-  gchar *msg_error;
   gchar *filename;
   GtrHeader *header;
 
@@ -755,7 +754,7 @@ gtr_po_get_next_fuzzy (GtrPo * po)
   GList *msg;
 
   msg = po->priv->current;
-  while (msg = g_list_next (msg))
+  while ((msg = g_list_next (msg)))
     {
       if (gtr_msg_is_fuzzy (msg->data))
         return msg;
@@ -777,7 +776,7 @@ gtr_po_get_prev_fuzzy (GtrPo * po)
   GList *msg;
 
   msg = po->priv->current;
-  while (msg = g_list_previous (msg))
+  while ((msg = g_list_previous (msg)))
     {
       if (gtr_msg_is_fuzzy (msg->data))
         return msg;
@@ -799,7 +798,7 @@ gtr_po_get_next_untrans (GtrPo * po)
   GList *msg;
 
   msg = po->priv->current;
-  while (msg = g_list_next (msg))
+  while ((msg = g_list_next (msg)))
     {
       if (!gtr_msg_is_translated (msg->data))
         return msg;
@@ -822,7 +821,7 @@ gtr_po_get_prev_untrans (GtrPo * po)
   GList *msg;
 
   msg = po->priv->current;
-  while (msg = g_list_previous (msg))
+  while ((msg = g_list_previous (msg)))
     {
       if (!gtr_msg_is_translated (msg->data))
         return msg;
@@ -844,7 +843,7 @@ gtr_po_get_next_fuzzy_or_untrans (GtrPo * po)
   GList *msg;
 
   msg = po->priv->current;
-  while (msg = g_list_next (msg))
+  while ((msg = g_list_next (msg)))
     {
       if (gtr_msg_is_fuzzy (msg->data) || !gtr_msg_is_translated (msg->data))
         return msg;
@@ -866,7 +865,7 @@ gtr_po_get_prev_fuzzy_or_untrans (GtrPo * po)
   GList *msg;
 
   msg = po->priv->current;
-  while (msg = g_list_previous (msg))
+  while ((msg = g_list_previous (msg)))
     {
       if (gtr_msg_is_fuzzy (msg->data) || !gtr_msg_is_translated (msg->data))
         return msg;
diff --git a/src/gtr-prefs-manager.c b/src/gtr-prefs-manager.c
index ff3cd03..c4362a8 100644
--- a/src/gtr-prefs-manager.c
+++ b/src/gtr-prefs-manager.c
@@ -186,15 +186,6 @@ gtr_prefs_manager_set_string (const gchar * key, const gchar * value)
   gconf_client_set_string (gtr_prefs_manager->gconf_client, key, value, NULL);
 }
 
-static gboolean
-gtr_prefs_manager_key_is_writable (const gchar * key)
-{
-  //gtr_debug (DEBUG_PREFS);
-
-  return gconf_client_key_is_writable (gtr_prefs_manager->gconf_client, key,
-                                       NULL);
-}
-
 /* Files */
 DEFINE_BOOL_PREF (warn_if_contains_fuzzy,
                   GPM_WARN_IF_CONTAINS_FUZZY)
diff --git a/src/gtr-profile.c b/src/gtr-profile.c
index 995a67d..c13673c 100644
--- a/src/gtr-profile.c
+++ b/src/gtr-profile.c
@@ -279,21 +279,21 @@ gtr_profile_xml_new_entry (xmlDocPtr doc, GtrProfile * profile)
   xmlNodePtr profile_node;
 
   root = xmlDocGetRootElement (doc);
-  profile_node = xmlNewChild (root, NULL, "profile", NULL);
-  xmlNewTextChild (profile_node, NULL, "profile_name", profile->priv->name);
-  xmlNewTextChild (profile_node, NULL, "author_name",
-                   profile->priv->author_name);
-  xmlNewTextChild (profile_node, NULL, "author_email",
-                   profile->priv->author_email);
-  xmlNewTextChild (profile_node, NULL, "language_name",
-                   profile->priv->language_name);
-  xmlNewTextChild (profile_node, NULL, "language_code",
-                   profile->priv->language_code);
-  xmlNewTextChild (profile_node, NULL, "charset", profile->priv->charset);
-  xmlNewTextChild (profile_node, NULL, "encoding", profile->priv->encoding);
-  xmlNewTextChild (profile_node, NULL, "group_email",
-                   profile->priv->group_email);
-  xmlNewTextChild (profile_node, NULL, "plurals", profile->priv->plurals);
+  profile_node = xmlNewChild (root, NULL, (const xmlChar *)"profile", NULL);
+  xmlNewTextChild (profile_node, NULL, (const xmlChar *)"profile_name", (const xmlChar *)profile->priv->name);
+  xmlNewTextChild (profile_node, NULL, (const xmlChar *)"author_name",
+                   (const xmlChar *)profile->priv->author_name);
+  xmlNewTextChild (profile_node, NULL, (const xmlChar *)"author_email",
+                   (const xmlChar *)profile->priv->author_email);
+  xmlNewTextChild (profile_node, NULL, (const xmlChar *)"language_name",
+                   (const xmlChar *)profile->priv->language_name);
+  xmlNewTextChild (profile_node, NULL, (const xmlChar *)"language_code",
+                   (const xmlChar *)profile->priv->language_code);
+  xmlNewTextChild (profile_node, NULL, (const xmlChar *)"charset", (const xmlChar *)profile->priv->charset);
+  xmlNewTextChild (profile_node, NULL, (const xmlChar *)"encoding", (const xmlChar *)profile->priv->encoding);
+  xmlNewTextChild (profile_node, NULL, (const xmlChar *)"group_email",
+                   (const xmlChar *)profile->priv->group_email);
+  xmlNewTextChild (profile_node, NULL, (const xmlChar *)"plurals", (const xmlChar *)profile->priv->plurals);
 }
 
 /**
@@ -315,23 +315,23 @@ gtr_profile_xml_get_entry (xmlNodePtr child)
 
   node = child->xmlChildrenNode;
 
-  profile->priv->name = xmlNodeGetContent (node);
+  profile->priv->name = (gchar *)xmlNodeGetContent (node);
   node = node->next;
-  profile->priv->author_name = xmlNodeGetContent (node);
+  profile->priv->author_name = (gchar *)xmlNodeGetContent (node);
   node = node->next;
-  profile->priv->author_email = xmlNodeGetContent (node);
+  profile->priv->author_email = (gchar *)xmlNodeGetContent (node);
   node = node->next;
-  profile->priv->language_name = xmlNodeGetContent (node);
+  profile->priv->language_name = (gchar *)xmlNodeGetContent (node);
   node = node->next;
-  profile->priv->language_code = xmlNodeGetContent (node);
+  profile->priv->language_code = (gchar *)xmlNodeGetContent (node);
   node = node->next;
-  profile->priv->charset = xmlNodeGetContent (node);
+  profile->priv->charset = (gchar *)xmlNodeGetContent (node);
   node = node->next;
-  profile->priv->encoding = xmlNodeGetContent (node);
+  profile->priv->encoding = (gchar *)xmlNodeGetContent (node);
   node = node->next;
-  profile->priv->group_email = xmlNodeGetContent (node);
+  profile->priv->group_email = (gchar *)xmlNodeGetContent (node);
   node = node->next;
-  profile->priv->plurals = xmlNodeGetContent (node);
+  profile->priv->plurals = (gchar *)xmlNodeGetContent (node);
 
   return profile;
 }
@@ -361,7 +361,7 @@ gtr_profile_get_profiles_from_xml_file (gchar * filename)
   child = root->xmlChildrenNode;
   active = child->xmlChildrenNode;
 
-  active_profile = xmlNodeGetContent (active);
+  active_profile = (gchar *)xmlNodeGetContent (active);
   child = child->next;
 
   while (child != NULL)
@@ -398,7 +398,7 @@ gtr_profile_save_profiles_in_xml (gchar * filename)
 
   root = xmlDocGetRootElement (doc);
 
-  xmlNewChild (root, NULL, "active", gtr_profile_get_name (active_profile));
+  xmlNewChild (root, NULL, (const xmlChar *)"active", (const xmlChar *)gtr_profile_get_name (active_profile));
 
   for (l = profiles_list; l; l = l->next)
     {
diff --git a/src/gtr-utils.c b/src/gtr-utils.c
index ea3fd99..18b7ecd 100644
--- a/src/gtr-utils.c
+++ b/src/gtr-utils.c
@@ -159,8 +159,8 @@ gtr_xml_new_doc (const gchar * name)
 {
   xmlNodePtr root;
   xmlDocPtr doc;
-  doc = xmlNewDoc ("1.0");
-  root = xmlNewDocNode (doc, NULL, name, NULL);
+  doc = xmlNewDoc ((const xmlChar *)"1.0");
+  root = xmlNewDocNode (doc, NULL, (const xmlChar *)name, NULL);
   xmlDocSetRootElement (doc, root);
   return doc;
 }
@@ -439,7 +439,7 @@ has_valid_scheme (const gchar * uri)
   return *p == ':';
 }
 
-gboolean
+static gboolean
 gtr_utils_is_valid_uri (const gchar * uri)
 {
   const guchar *p;
diff --git a/src/gtr-view.c b/src/gtr-view.c
index 46874ad..dadca33 100644
--- a/src/gtr-view.c
+++ b/src/gtr-view.c
@@ -69,7 +69,6 @@ struct _GtrViewPrivate
 static void
 gtr_attach_gtkspell (GtrView * view)
 {
-  gint i;
   GError *error = NULL;
   gchar *errortext = NULL;
   view->priv->spell = NULL;
diff --git a/src/gtr-window.c b/src/gtr-window.c
index c588394..46459ec 100644
--- a/src/gtr-window.c
+++ b/src/gtr-window.c
@@ -532,41 +532,6 @@ remove_widget (GtrWindow * window, GtkWidget * widget, GError ** error)
   g_object_unref (widget);
 }
 
-static void
-gtr_app_present_widget (GtrWindow * window,
-                        GtkWidget * widget, GError ** error)
-{
-  GdlDockItem *dock_item;
-  GtkWidget *parent;
-
-  g_return_if_fail (GTR_IS_WINDOW (window));
-  g_return_if_fail (GTK_IS_WIDGET (widget));
-
-  g_return_if_fail (window->priv->widgets != NULL);
-
-  dock_item = g_object_get_data (G_OBJECT (widget), "dockitem");
-  g_return_if_fail (dock_item != NULL);
-
-  /* Hack to present the dock item if it's in a notebook dock item */
-  parent = gtk_widget_get_parent (GTK_WIDGET (dock_item));
-  if (GTK_IS_NOTEBOOK (parent))
-    {
-      gint pagenum;
-      pagenum =
-        gtk_notebook_page_num (GTK_NOTEBOOK (parent), GTK_WIDGET (dock_item));
-      gtk_notebook_set_current_page (GTK_NOTEBOOK (parent), pagenum);
-    }
-  else if (!GDL_DOCK_OBJECT_ATTACHED (dock_item))
-    {
-      gdl_dock_item_show_item (GDL_DOCK_ITEM (dock_item));
-    }
-
-  /* FIXME: If the item is floating, present the window */
-  /* FIXME: There is no way to detect if a widget was floating before it was
-     detached since it no longer has a parent there is no way to access the
-     floating property of the GdlDock structure. */
-}
-
 void
 set_sensitive_according_to_message (GtrWindow * window, GtrPo * po)
 {
@@ -1233,6 +1198,7 @@ _gtr_recent_add (GtrWindow * window, GFile * location, gchar * project_id)
   g_slice_free (GtkRecentData, recent_data);
 }
 
+/*
 static void
 gtr_recent_remove (GtrWindow * window, const gchar * path)
 {
@@ -1258,6 +1224,7 @@ gtr_recent_remove (GtrWindow * window, const gchar * path)
 
   g_free (uri);
 }
+*/
 
 static void
 gtr_recent_chooser_item_activated_cb (GtkRecentChooser * chooser,



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