[vinagre] Fix compiler warnings
- From: Jonh Wendell <jwendell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vinagre] Fix compiler warnings
- Date: Thu, 15 Jul 2010 19:06:49 +0000 (UTC)
commit 06598f6c8ee4dc91361b1758be055b330e288279
Author: Jonh Wendell <jwendell gnome org>
Date: Thu Jul 15 16:06:08 2010 -0300
Fix compiler warnings
vinagre/pty_open.c | 3 +++
vinagre/vinagre-applet.c | 5 +----
vinagre/vinagre-bookmarks-migration.c | 21 ++++++++++-----------
vinagre/vinagre-bookmarks-tree.c | 4 ----
vinagre/vinagre-bookmarks-ui.c | 2 --
vinagre/vinagre-bookmarks.c | 11 ++++-------
vinagre/vinagre-commands.c | 2 +-
vinagre/vinagre-connect.c | 1 -
vinagre/vinagre-connection.c | 23 ++++++++++++-----------
vinagre/vinagre-fav.c | 12 ++++++------
vinagre/vinagre-main.c | 1 -
vinagre/vinagre-mdns.c | 3 +--
vinagre/vinagre-notebook.c | 6 +-----
vinagre/vinagre-options.c | 2 ++
vinagre/vinagre-prefs.c | 26 --------------------------
vinagre/vinagre-tab.c | 1 -
vinagre/vinagre-ui.h | 2 +-
vinagre/vinagre-window.c | 2 ++
18 files changed, 44 insertions(+), 83 deletions(-)
---
diff --git a/vinagre/pty_open.c b/vinagre/pty_open.c
index ec12624..aa24d44 100644
--- a/vinagre/pty_open.c
+++ b/vinagre/pty_open.c
@@ -40,6 +40,9 @@
/* Originally from vte */
+#define _XOPEN_SOURCE
+#define _GNU_SOURCE
+
#include "config.h"
#include <sys/types.h>
#include <sys/ioctl.h>
diff --git a/vinagre/vinagre-applet.c b/vinagre/vinagre-applet.c
index 6ca6c84..83e13d5 100644
--- a/vinagre/vinagre-applet.c
+++ b/vinagre/vinagre-applet.c
@@ -67,9 +67,6 @@ static void vinagre_applet_init (VinagreApplet *applet);
static void vinagre_applet_get_icon (VinagreApplet *applet);
static void vinagre_applet_check_size (VinagreApplet *applet);
static gboolean vinagre_applet_draw_cb (VinagreApplet *applet);
-static void vinagre_applet_update_tooltip (VinagreApplet *applet);
-static void vinagre_applet_dialog_about_cb (BonoboUIComponent *uic, gpointer data, const gchar *verbname);
-static gboolean vinagre_applet_bonobo_cb (PanelApplet *_applet, const gchar *iid, gpointer data);
static void vinagre_applet_destroy_cb (GtkObject *object);
G_DEFINE_TYPE (VinagreApplet, vinagre_applet, PANEL_TYPE_APPLET)
@@ -347,7 +344,7 @@ fill_recursive_menu (GSList *entries, GtkWidget *menu)
static void
fill_menu (GSList *all, GtkWidget *menu)
{
- GtkWidget *item, *image;
+ GtkWidget *item;
if (g_slist_length (all) == 0)
return;
diff --git a/vinagre/vinagre-bookmarks-migration.c b/vinagre/vinagre-bookmarks-migration.c
index 97ca7ab..a8139f1 100644
--- a/vinagre/vinagre-bookmarks-migration.c
+++ b/vinagre/vinagre-bookmarks-migration.c
@@ -24,6 +24,7 @@
*/
#include <glib.h>
+#include <glib/gstdio.h>
#include <gio/gio.h>
#include <glib/gi18n.h>
#include <libxml/parser.h>
@@ -36,6 +37,7 @@
#include "vinagre-plugin.h"
#include "vinagre-plugins-engine.h"
#include "vinagre-dirs.h"
+#include "vinagre-utils.h"
static void
fill_xml (GSList *list, xmlTextWriter *writer)
@@ -50,8 +52,8 @@ fill_xml (GSList *list, xmlTextWriter *writer)
switch (vinagre_bookmarks_entry_get_node (entry))
{
case VINAGRE_BOOKMARKS_ENTRY_NODE_FOLDER:
- xmlTextWriterStartElement (writer, "folder");
- xmlTextWriterWriteAttribute (writer, "name", vinagre_bookmarks_entry_get_name (entry));
+ xmlTextWriterStartElement (writer, (const xmlChar *)"folder");
+ xmlTextWriterWriteAttribute (writer, (const xmlChar *)"name", (const xmlChar *)vinagre_bookmarks_entry_get_name (entry));
fill_xml (vinagre_bookmarks_entry_get_children (entry), writer);
xmlTextWriterEndElement (writer);
@@ -60,13 +62,11 @@ fill_xml (GSList *list, xmlTextWriter *writer)
case VINAGRE_BOOKMARKS_ENTRY_NODE_CONN:
conn = vinagre_bookmarks_entry_get_conn (entry);
- xmlTextWriterStartElement (writer, "item");
- xmlTextWriterWriteElement (writer, "name", vinagre_connection_get_name (conn));
- xmlTextWriterWriteElement (writer, "host", vinagre_connection_get_host (conn));
- xmlTextWriterWriteFormatElement (writer, "port", "%d", vinagre_connection_get_port (conn));
- //xmlTextWriterWriteFormatElement (writer, "view_only", "%d", vinagre_connection_get_view_only (conn));
- //xmlTextWriterWriteFormatElement (writer, "scaling", "%d", vinagre_connection_get_scaling (conn));
- xmlTextWriterWriteFormatElement (writer, "fullscreen", "%d", vinagre_connection_get_fullscreen (conn));
+ xmlTextWriterStartElement (writer, (const xmlChar *)"item");
+ xmlTextWriterWriteElement (writer, (const xmlChar *)"name", (const xmlChar *)vinagre_connection_get_name (conn));
+ xmlTextWriterWriteElement (writer, (const xmlChar *)"host", (const xmlChar *)vinagre_connection_get_host (conn));
+ xmlTextWriterWriteFormatElement (writer, (const xmlChar *)"port", "%d", vinagre_connection_get_port (conn));
+ xmlTextWriterWriteFormatElement (writer, (const xmlChar *)"fullscreen", "%d", vinagre_connection_get_fullscreen (conn));
xmlTextWriterEndElement (writer);
break;
@@ -111,7 +111,7 @@ save_to_file (GSList *entries, const gchar *filename)
goto finalize;
}
- rc = xmlTextWriterStartElement (writer, "vinagre-bookmarks");
+ rc = xmlTextWriterStartElement (writer, (const xmlChar *)"vinagre-bookmarks");
if (rc < 0)
{
g_warning (_("Error while migrating bookmarks: Failed to initialize the XML structure"));
@@ -173,7 +173,6 @@ create_list (GKeyFile *kf)
VinagreConnection *conn;
gchar *s_value;
gint i_value;
- gboolean b_value;
s_value = g_key_file_get_string (kf, conns[i], "host", NULL);
if (!s_value)
diff --git a/vinagre/vinagre-bookmarks-tree.c b/vinagre/vinagre-bookmarks-tree.c
index c3d1eda..7f7419d 100644
--- a/vinagre/vinagre-bookmarks-tree.c
+++ b/vinagre/vinagre-bookmarks-tree.c
@@ -103,7 +103,6 @@ vinagre_bookmarks_tree_update_list (VinagreBookmarksTree *tree)
GdkPixbuf *pixbuf;
GtkIconTheme *icon_theme;
GtkTreeSelection *selection;
- GtkTreePath *path;
icon_theme = gtk_icon_theme_get_default ();
pixbuf = gtk_icon_theme_load_icon (icon_theme,
@@ -269,9 +268,6 @@ vinagre_bookmarks_tree_select_entry (VinagreBookmarksTree *tree,
VinagreBookmarksEntry *entry)
{
GtkTreeModel *model;
- GtkTreeIter iter;
- GtkTreePath *path;
- gboolean valid;
struct _find_entry f;
if (!entry)
diff --git a/vinagre/vinagre-bookmarks-ui.c b/vinagre/vinagre-bookmarks-ui.c
index 78474ed..17fd6bd 100644
--- a/vinagre/vinagre-bookmarks-ui.c
+++ b/vinagre/vinagre-bookmarks-ui.c
@@ -297,8 +297,6 @@ vinagre_bookmarks_del (VinagreBookmarks *book,
{
GtkWidget *dialog;
gchar *name, *title, *msg1, *msg2;
- GError *error = NULL;
- GSList *parent;
g_return_if_fail (VINAGRE_IS_BOOKMARKS (book));
g_return_if_fail (VINAGRE_IS_BOOKMARKS_ENTRY (entry));
diff --git a/vinagre/vinagre-bookmarks.c b/vinagre/vinagre-bookmarks.c
index 2db27cb..6bb04ba 100644
--- a/vinagre/vinagre-bookmarks.c
+++ b/vinagre/vinagre-bookmarks.c
@@ -194,9 +194,6 @@ vinagre_bookmarks_exists (VinagreBookmarks *book,
const gchar *host,
gint port)
{
- VinagreConnection *conn = NULL;
- GSList *l, *next;
-
g_return_val_if_fail (VINAGRE_IS_BOOKMARKS (book), NULL);
g_return_val_if_fail (host != NULL, NULL);
@@ -216,8 +213,8 @@ vinagre_bookmarks_save_fill_xml (GSList *list, xmlTextWriter *writer)
switch (vinagre_bookmarks_entry_get_node (entry))
{
case VINAGRE_BOOKMARKS_ENTRY_NODE_FOLDER:
- xmlTextWriterStartElement (writer, "folder");
- xmlTextWriterWriteAttribute (writer, "name", vinagre_bookmarks_entry_get_name (entry));
+ xmlTextWriterStartElement (writer, (const xmlChar *)"folder");
+ xmlTextWriterWriteAttribute (writer, (const xmlChar *)"name", (const xmlChar *)vinagre_bookmarks_entry_get_name (entry));
vinagre_bookmarks_save_fill_xml (vinagre_bookmarks_entry_get_children (entry), writer);
xmlTextWriterEndElement (writer);
@@ -226,7 +223,7 @@ vinagre_bookmarks_save_fill_xml (GSList *list, xmlTextWriter *writer)
case VINAGRE_BOOKMARKS_ENTRY_NODE_CONN:
conn = vinagre_bookmarks_entry_get_conn (entry);
- xmlTextWriterStartElement (writer, "item");
+ xmlTextWriterStartElement (writer, (const xmlChar *)"item");
vinagre_connection_fill_writer (conn, writer);
xmlTextWriterEndElement (writer);
break;
@@ -438,7 +435,7 @@ vinagre_bookmarks_save_to_file (VinagreBookmarks *book)
goto finalize;
}
- rc = xmlTextWriterStartElement (writer, "vinagre-bookmarks");
+ rc = xmlTextWriterStartElement (writer, (const xmlChar *)"vinagre-bookmarks");
if (rc < 0)
{
g_warning (_("Error while saving bookmarks: Failed to initialize the XML structure"));
diff --git a/vinagre/vinagre-commands.c b/vinagre/vinagre-commands.c
index 5bad101..a5d8161 100644
--- a/vinagre/vinagre-commands.c
+++ b/vinagre/vinagre-commands.c
@@ -43,6 +43,7 @@
#include "vinagre-plugin-info.h"
#include "vinagre-plugin-info-priv.h"
#include "vinagre-plugins-engine.h"
+#include "vinagre-plugin-dialog.h"
void
vinagre_cmd_direct_connect (VinagreConnection *conn,
@@ -294,7 +295,6 @@ vinagre_cmd_open_bookmark (VinagreWindow *window,
VinagreConnection *conn)
{
VinagreTab *tab;
- VinagreConnection *new_conn;
g_return_if_fail (VINAGRE_IS_WINDOW (window));
g_return_if_fail (VINAGRE_IS_CONNECTION (conn));
diff --git a/vinagre/vinagre-connect.c b/vinagre/vinagre-connect.c
index 660cb74..3ec88b0 100644
--- a/vinagre/vinagre-connect.c
+++ b/vinagre/vinagre-connect.c
@@ -238,7 +238,6 @@ static void
setup_combo (VinagreConnectDialog *dialog)
{
GtkListStore *store;
- GtkTreeIter iter;
GtkEntryCompletion *completion;
GPtrArray *history;
gint i, size;
diff --git a/vinagre/vinagre-connection.c b/vinagre/vinagre-connection.c
index 7b8e149..bcdca16 100644
--- a/vinagre/vinagre-connection.c
+++ b/vinagre/vinagre-connection.c
@@ -28,6 +28,7 @@
#include "vinagre-bookmarks.h"
#include "vinagre-plugin.h"
#include "vinagre-plugins-engine.h"
+#include "vinagre-utils.h"
struct _VinagreConnectionPrivate
{
@@ -183,12 +184,12 @@ static void
default_fill_writer (VinagreConnection *conn, xmlTextWriter *writer)
{
if (conn->priv->protocol)
- xmlTextWriterWriteElement (writer, "protocol", conn->priv->protocol);
- xmlTextWriterWriteElement (writer, "name", conn->priv->name);
- xmlTextWriterWriteElement (writer, "host", conn->priv->host);
- xmlTextWriterWriteElement (writer, "username", conn->priv->username ? conn->priv->username : "");
- xmlTextWriterWriteFormatElement (writer, "port", "%d", conn->priv->port);
- xmlTextWriterWriteFormatElement (writer, "fullscreen", "%d", conn->priv->fullscreen);
+ xmlTextWriterWriteElement (writer, (const xmlChar *)"protocol", (const xmlChar *)conn->priv->protocol);
+ xmlTextWriterWriteElement (writer, (const xmlChar *)"name", (const xmlChar *)conn->priv->name);
+ xmlTextWriterWriteElement (writer, (const xmlChar *)"host", (const xmlChar *)conn->priv->host);
+ xmlTextWriterWriteElement (writer, (const xmlChar *)"username", (const xmlChar *) (conn->priv->username ? conn->priv->username : ""));
+ xmlTextWriterWriteFormatElement (writer, (const xmlChar *)"port", "%d", conn->priv->port);
+ xmlTextWriterWriteFormatElement (writer, (const xmlChar *)"fullscreen", "%d", conn->priv->fullscreen);
}
static void
@@ -202,15 +203,15 @@ default_parse_item (VinagreConnection *conn, xmlNode *root)
s_value = xmlNodeGetContent (curr);
if (!xmlStrcmp(curr->name, (const xmlChar *)"host"))
- vinagre_connection_set_host (conn, s_value);
+ vinagre_connection_set_host (conn, (const gchar *)s_value);
else if (!xmlStrcmp(curr->name, (const xmlChar *)"name"))
- vinagre_connection_set_name (conn, s_value);
+ vinagre_connection_set_name (conn, (const gchar *)s_value);
else if (!xmlStrcmp(curr->name, (const xmlChar *)"username"))
- vinagre_connection_set_username (conn, s_value);
+ vinagre_connection_set_username (conn, (const gchar *)s_value);
else if (!xmlStrcmp(curr->name, (const xmlChar *)"port"))
- vinagre_connection_set_port (conn, atoi (s_value));
+ vinagre_connection_set_port (conn, atoi ((const char *)s_value));
else if (!xmlStrcmp(curr->name, (const xmlChar *)"fullscreen"))
- vinagre_connection_set_fullscreen (conn, vinagre_utils_parse_boolean (s_value));
+ vinagre_connection_set_fullscreen (conn, vinagre_utils_parse_boolean ((const gchar *)s_value));
xmlFree (s_value);
}
diff --git a/vinagre/vinagre-fav.c b/vinagre/vinagre-fav.c
index 436a7af..b92da9b 100644
--- a/vinagre/vinagre-fav.c
+++ b/vinagre/vinagre-fav.c
@@ -27,10 +27,12 @@
#include "vinagre-utils.h"
#include "vinagre-dnd.h"
#include "vinagre-bookmarks.h"
+#include "vinagre-bookmarks-ui.h"
#include "vinagre-window-private.h"
#include "vinagre-bookmarks-entry.h"
#include "vinagre-plugin.h"
#include "vinagre-plugins-engine.h"
+#include "vinagre-commands.h"
#ifdef VINAGRE_ENABLE_AVAHI
#include "vinagre-mdns.h"
@@ -585,7 +587,6 @@ vinagre_fav_create_toolbar (VinagreFav *fav)
{
GtkWidget *toolbar;
GtkActionGroup *action_group;
- GtkAction *action;
GtkUIManager *manager;
GError *error = NULL;
@@ -842,7 +843,7 @@ vinagre_fav_hide (GtkButton *button, VinagreFav *fav)
static void
vinagre_fav_create_title (VinagreFav *fav)
{
- GtkWidget *box, *label, *close_button, *image, *frame;
+ GtkWidget *box, *label, *close_button, *image;
box = gtk_hbox_new (FALSE, 0);
@@ -1023,10 +1024,9 @@ vinagre_fav_fill_bookmarks (GtkTreeStore *store, GSList *list, GtkTreeIter *pare
gboolean
vinagre_fav_update_list (VinagreFav *fav)
{
- GtkTreeIter iter, parent_iter;
- GtkTreeStore *store;
- GSList *list, *l, *next;
- GdkPixbuf *pixbuf;
+ GtkTreeIter parent_iter;
+ GtkTreeStore *store;
+ GSList *list;
g_return_val_if_fail (VINAGRE_IS_FAV (fav), FALSE);
diff --git a/vinagre/vinagre-main.c b/vinagre/vinagre-main.c
index 16ab153..d676cb2 100644
--- a/vinagre/vinagre-main.c
+++ b/vinagre/vinagre-main.c
@@ -81,7 +81,6 @@ int main (int argc, char **argv) {
for (l = plugins; l; l = l->next)
{
- GOptionGroup *group;
GSList *groups, *l2;
VinagrePluginInfo *info = VINAGRE_PLUGIN_INFO (l->data);
diff --git a/vinagre/vinagre-mdns.c b/vinagre/vinagre-mdns.c
index fc6ad19..30dc6bf 100644
--- a/vinagre/vinagre-mdns.c
+++ b/vinagre/vinagre-mdns.c
@@ -20,6 +20,7 @@
#include <avahi-gobject/ga-service-browser.h>
#include <avahi-gobject/ga-service-resolver.h>
+#include <avahi-common/malloc.h>
#include <glib/gi18n.h>
#include "vinagre-mdns.h"
@@ -202,7 +203,6 @@ vinagre_mdns_add_service (VinagrePluginInfo *info,
GError *error = NULL;
const gchar *service;
BrowserEntry *entry;
- VinagrePlugin *plugin;
if (!vinagre_plugin_info_is_active (info))
return;
@@ -367,7 +367,6 @@ static void
vinagre_mdns_class_init (VinagreMdnsClass *klass)
{
GObjectClass* object_class = G_OBJECT_CLASS (klass);
- GObjectClass* parent_class = G_OBJECT_CLASS (klass);
g_type_class_add_private (klass, sizeof (VinagreMdnsPrivate));
diff --git a/vinagre/vinagre-notebook.c b/vinagre/vinagre-notebook.c
index e0c6c7d..9aba469 100644
--- a/vinagre/vinagre-notebook.c
+++ b/vinagre/vinagre-notebook.c
@@ -380,13 +380,11 @@ vinagre_notebook_page_switched (GtkNotebook *notebook,
static void
vinagre_notebook_page_removed_cb (VinagreNotebook *nb)
{
- gint n;
-
if ((gtk_notebook_get_n_pages (GTK_NOTEBOOK (nb)) == 0) &&
(vinagre_window_is_fullscreen (nb->priv->window)))
vinagre_window_toggle_fullscreen (nb->priv->window);
-vinagre_notebook_show_hide_tabs (nb);
+ vinagre_notebook_show_hide_tabs (nb);
}
static void
@@ -610,7 +608,6 @@ vinagre_notebook_add_tab (VinagreNotebook *nb,
gint position)
{
GtkWidget *label;
- GtkActionGroup *action_group;
int pos;
g_return_if_fail (VINAGRE_IS_NOTEBOOK (nb));
@@ -664,7 +661,6 @@ vinagre_notebook_close_tab (VinagreNotebook *nb,
VinagreTab *tab)
{
gint position;
- GtkActionGroup *action_group;
GtkNotebook *notebook;
VinagreTab *previous_active_tab;
diff --git a/vinagre/vinagre-options.c b/vinagre/vinagre-options.c
index f07eeca..65e47f9 100644
--- a/vinagre/vinagre-options.c
+++ b/vinagre/vinagre-options.c
@@ -21,6 +21,8 @@
#include "vinagre-options.h"
#include "vinagre-connection.h"
#include "vinagre-window.h"
+#include "vinagre-commands.h"
+#include "vinagre-utils.h"
const GOptionEntry all_options [] =
{
diff --git a/vinagre/vinagre-prefs.c b/vinagre/vinagre-prefs.c
index ab16b06..b8a3bb8 100644
--- a/vinagre/vinagre-prefs.c
+++ b/vinagre/vinagre-prefs.c
@@ -113,18 +113,6 @@ vinagre_prefs_get_int (VinagrePrefs *prefs, const gchar* key, gint def)
return def;
}
-static gchar *
-vinagre_prefs_get_string (VinagrePrefs *prefs, const gchar *key, const gchar *def)
-{
- gchar *result;
-
- result = gconf_client_get_string (prefs->priv->gconf_client, key, NULL);
- if (!result)
- result = g_strdup (def);
-
- return result;
-}
-
static GSList *
vinagre_prefs_get_list (VinagrePrefs *prefs, const gchar* key)
{
@@ -159,18 +147,6 @@ vinagre_prefs_set_int (VinagrePrefs *prefs, const gchar* key, gint value)
}
static void
-vinagre_prefs_set_string (VinagrePrefs *prefs, const gchar *key, const gchar *value)
-{
- GError *error = NULL;
-
- if (!gconf_client_set_string (prefs->priv->gconf_client, key, value, &error))
- {
- g_warning ("Setting key %s failed: %s", key, error->message);
- g_error_free (error);
- }
-}
-
-static void
vinagre_prefs_set_list (VinagrePrefs *prefs, const gchar* key, GSList *list)
{
GError *error = NULL;
@@ -261,7 +237,6 @@ static void
vinagre_prefs_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
{
VinagrePrefs *prefs = VINAGRE_PREFS (object);
- gchar *str;
switch (prop_id)
{
@@ -311,7 +286,6 @@ static void
vinagre_prefs_class_init (VinagrePrefsClass *klass)
{
GObjectClass* object_class = G_OBJECT_CLASS (klass);
- GObjectClass* parent_class = G_OBJECT_CLASS (klass);
g_type_class_add_private (klass, sizeof (VinagrePrefsPrivate));
diff --git a/vinagre/vinagre-tab.c b/vinagre/vinagre-tab.c
index a5d7e1e..89ef902 100644
--- a/vinagre/vinagre-tab.c
+++ b/vinagre/vinagre-tab.c
@@ -525,7 +525,6 @@ GtkWidget *
vinagre_tab_new (VinagreConnection *conn, VinagreWindow *window)
{
VinagrePlugin *plugin;
- GtkWidget *tab;
const gchar *protocol = vinagre_connection_get_protocol (conn);
plugin = g_hash_table_lookup (vinagre_plugin_engine_get_plugins_by_protocol (vinagre_plugins_engine_get_default ()),
diff --git a/vinagre/vinagre-ui.h b/vinagre/vinagre-ui.h
index 775e0f9..4e512d7 100644
--- a/vinagre/vinagre-ui.h
+++ b/vinagre/vinagre-ui.h
@@ -99,7 +99,7 @@ static const GtkActionEntry vinagre_machine_initialized_entries[] =
static const GtkToggleActionEntry vinagre_machine_initialized_toggle_entries[] =
{
- 0,
+ {0,},
};
G_END_DECLS
diff --git a/vinagre/vinagre-window.c b/vinagre/vinagre-window.c
index 71af6c9..1da0e98 100644
--- a/vinagre/vinagre-window.c
+++ b/vinagre/vinagre-window.c
@@ -25,9 +25,11 @@
#include <errno.h>
#include <time.h>
#include <sys/types.h>
+#include <fcntl.h>
#include <string.h>
#include <glib/gi18n.h>
+#include <glib/gstdio.h>
#include <gdk/gdkkeysyms.h>
#include "vinagre-window.h"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]