diff options
author | Philip Withnall <philip@tecnocode.co.uk> | 2010-02-18 13:24:34 +0000 |
---|---|---|
committer | Philip Withnall <philip@tecnocode.co.uk> | 2010-02-18 13:27:37 +0000 |
commit | 10f2485d2fcef546b90e3352091e21e6dbd18f20 (patch) | |
tree | a5b4e9f15411423385f46030ad4c446613778ce4 /browser-plugin | |
parent | e7d13ff52e591c030f0e4413e105e6ae79fcccaa (diff) |
Fix various compiler warnings
Various small compiler warnings (such as variable shadowing, constness, etc.)
fixed, plus some more serious ones which could've caused crashes:
* potentially passing 0 to g_source_remove() due to a bad comparison
* passing by value, not reference, to g_object_get()
Diffstat (limited to 'browser-plugin')
-rw-r--r-- | browser-plugin/totem-glow-button.c | 6 | ||||
-rw-r--r-- | browser-plugin/totem-glow-button.h | 2 | ||||
-rw-r--r-- | browser-plugin/totem-plugin-viewer.c | 14 |
3 files changed, 10 insertions, 12 deletions
diff --git a/browser-plugin/totem-glow-button.c b/browser-plugin/totem-glow-button.c index 9ace6907..4244ff9a 100644 --- a/browser-plugin/totem-glow-button.c +++ b/browser-plugin/totem-glow-button.c @@ -53,14 +53,12 @@ struct _TotemGlowButton { guint anim_finished :1; }; -static void totem_glow_button_class_init (TotemGlowButtonClass * klass); -static void totem_glow_button_init (TotemGlowButton * button); static void totem_glow_button_set_timeout (TotemGlowButton *button, gboolean set_timeout); static GtkButtonClass *parent_class; -G_DEFINE_TYPE(TotemGlowButton, totem_glow_button, GTK_TYPE_BUTTON); +G_DEFINE_TYPE (TotemGlowButton, totem_glow_button, GTK_TYPE_BUTTON); static void totem_glow_button_do_expose (TotemGlowButton *button) @@ -327,7 +325,7 @@ totem_glow_button_unmap (GtkWidget *buttonw) button = TOTEM_GLOW_BUTTON (buttonw); - if (button->button_glow >= 0) { + if (button->button_glow > 0) { g_source_remove (button->button_glow); button->button_glow = 0; } diff --git a/browser-plugin/totem-glow-button.h b/browser-plugin/totem-glow-button.h index 027ab46c..138f8c44 100644 --- a/browser-plugin/totem-glow-button.h +++ b/browser-plugin/totem-glow-button.h @@ -41,7 +41,7 @@ typedef struct _TotemGlowButtonClass { gpointer __bla[4]; } TotemGlowButtonClass; -GType totem_glow_button_get_type (void); +GType totem_glow_button_get_type (void) G_GNUC_CONST; GtkWidget * totem_glow_button_new (void); void totem_glow_button_set_glow (TotemGlowButton *button, gboolean glow); diff --git a/browser-plugin/totem-plugin-viewer.c b/browser-plugin/totem-plugin-viewer.c index 0c363b2d..e81b08a1 100644 --- a/browser-plugin/totem-plugin-viewer.c +++ b/browser-plugin/totem-plugin-viewer.c @@ -330,7 +330,7 @@ static void totem_embedded_set_state (TotemEmbedded *emb, TotemStates state) { GtkWidget *image; - gchar *id; + const gchar *id; if (state == emb->state) return; @@ -949,7 +949,7 @@ totem_embedded_set_playlist (TotemEmbedded *emb, GError **error) { char *file_uri; - char *tmpfile; + char *tmp_file; GError *err = NULL; GFile *src, *dst; int fd; @@ -963,7 +963,7 @@ totem_embedded_set_playlist (TotemEmbedded *emb, * parse from memory or * https://bugzilla.gnome.org/show_bug.cgi?id=598702 is fixed */ fd = g_file_open_tmp ("totem-browser-plugin-playlist-XXXXXX", - &tmpfile, + &tmp_file, &err); if (fd < 0) { g_warning ("Couldn't open temporary file for playlist: %s", @@ -972,18 +972,18 @@ totem_embedded_set_playlist (TotemEmbedded *emb, return TRUE; } src = g_file_new_for_path (path); - dst = g_file_new_for_path (tmpfile); + dst = g_file_new_for_path (tmp_file); if (g_file_copy (src, dst, G_FILE_COPY_OVERWRITE | G_FILE_COPY_TARGET_DEFAULT_PERMS, NULL, NULL, NULL, &err) == FALSE) { g_warning ("Failed to copy playlist '%s' to '%s': %s", - path, tmpfile, err->message); + path, tmp_file, err->message); g_error_free (err); g_object_unref (src); g_object_unref (dst); - g_free (tmpfile); + g_free (tmp_file); close (fd); return TRUE; } - g_free (tmpfile); + g_free (tmp_file); file_uri = g_file_get_uri (dst); |