Commit 06598f6c authored by Jonh Wendell's avatar Jonh Wendell
Browse files

Fix compiler warnings

parent 63a984c9
......@@ -40,6 +40,9 @@
/* Originally from vte */
#define _XOPEN_SOURCE
#define _GNU_SOURCE
#include "config.h"
#include <sys/types.h>
#include <sys/ioctl.h>
......
......@@ -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;
......
......@@ -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)
......
......@@ -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)
......
......@@ -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));
......
......@@ -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"));
......
......@@ -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));
......
......@@ -238,7 +238,6 @@ static void
setup_combo (VinagreConnectDialog *dialog)
{
GtkListStore *store;
GtkTreeIter iter;
GtkEntryCompletion *completion;
GPtrArray *history;
gint i, size;
......
......@@ -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);
}
......
......@@ -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);
......
......@@ -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);
......
......@@ -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));
......
......@@ -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;
......
......@@ -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 [] =
{
......
......@@ -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)
{
......@@ -158,18 +146,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)
{
......@@ -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));
......
......@@ -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 ()),
......
......@@ -99,7 +99,7 @@ static const GtkActionEntry vinagre_machine_initialized_entries[] =
static const GtkToggleActionEntry vinagre_machine_initialized_toggle_entries[] =
{
0,
{0,},
};
G_END_DECLS
......
......@@ -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"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment