aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-François Rameau <jframeau@cvs.gnome.org>2006-03-03 05:23:34 +0800
committerJean-François Rameau <jframeau@src.gnome.org>2006-03-03 05:23:34 +0800
commit8dc95a5c584d8fdb99afec102702bd8801b95266 (patch)
tree2b0682233b70018437c4bc140a3d32f1ad45d9d6
parent4f2b380361e6bf153a04cc80dba762733a5963c1 (diff)
downloadgsoc2013-epiphany-8dc95a5c584d8fdb99afec102702bd8801b95266.tar
gsoc2013-epiphany-8dc95a5c584d8fdb99afec102702bd8801b95266.tar.gz
gsoc2013-epiphany-8dc95a5c584d8fdb99afec102702bd8801b95266.tar.bz2
gsoc2013-epiphany-8dc95a5c584d8fdb99afec102702bd8801b95266.tar.lz
gsoc2013-epiphany-8dc95a5c584d8fdb99afec102702bd8801b95266.tar.xz
gsoc2013-epiphany-8dc95a5c584d8fdb99afec102702bd8801b95266.tar.zst
gsoc2013-epiphany-8dc95a5c584d8fdb99afec102702bd8801b95266.zip
Fix gcc 4.1 warnings (dereferencing type-punned pointer will break
2006-03-02 Jean-François Rameau <jframeau@cvs.gnome.org> * embed/ephy-embed-shell.c:(ephy_embed_shell_dispose): * src/ephy-encoding-menu.c: (ephy_encoding_menu_view_dialog_cb): * src/ephy-history-window.c: (cmd_clear), (ephy_history_window_finalize): * src/ephy-shell.c: (ephy_shell_get_pdm_dialog),(ephy_shell_get_prefs_dialog), (ephy_shell_get_print_setup_dialog): * src/prefs-dialog.c: (prefs_dialog_finalize), (font_prefs_button_clicked_cb), (language_editor_add_button_clicked_cb): * src/bookmarks/ephy-bookmarks-editor.c: (ephy_bookmarks_editor_finalize): Fix gcc 4.1 warnings (dereferencing type-punned pointer will break strict-aliasing rules).
-rw-r--r--ChangeLog13
-rw-r--r--embed/ephy-embed-shell.c7
-rw-r--r--src/bookmarks/ephy-bookmarks-editor.c10
-rw-r--r--src/ephy-encoding-menu.c3
-rw-r--r--src/ephy-history-window.c15
-rw-r--r--src/ephy-shell.c18
-rw-r--r--src/prefs-dialog.c20
7 files changed, 69 insertions, 17 deletions
diff --git a/ChangeLog b/ChangeLog
index c67ee3b49..baf4c436a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2006-03-02 Jean-François Rameau <jframeau@cvs.gnome.org>
+
+ * embed/ephy-embed-shell.c:(ephy_embed_shell_dispose):
+ * src/ephy-encoding-menu.c: (ephy_encoding_menu_view_dialog_cb):
+ * src/ephy-history-window.c: (cmd_clear), (ephy_history_window_finalize):
+ * src/ephy-shell.c: (ephy_shell_get_pdm_dialog),(ephy_shell_get_prefs_dialog),
+ (ephy_shell_get_print_setup_dialog):
+ * src/prefs-dialog.c: (prefs_dialog_finalize), (font_prefs_button_clicked_cb),
+ (language_editor_add_button_clicked_cb):
+ * src/bookmarks/ephy-bookmarks-editor.c: (ephy_bookmarks_editor_finalize):
+
+ Fix gcc 4.1 warnings (dereferencing type-punned pointer will break strict-aliasing rules).
+
2006-03-02 Christian Persch <chpe@cvs.gnome.org>
* embed/mozilla/GtkNSSDialogs.cpp:
diff --git a/embed/ephy-embed-shell.c b/embed/ephy-embed-shell.c
index 6474fb2ed..1ce52db44 100644
--- a/embed/ephy-embed-shell.c
+++ b/embed/ephy-embed-shell.c
@@ -100,10 +100,11 @@ ephy_embed_shell_dispose (GObject *object)
if (priv->downloader_view != NULL)
{
+ DownloaderView **downloader_view = &priv->downloader_view;
LOG ("Unref downloader");
g_object_remove_weak_pointer
(G_OBJECT (priv->downloader_view),
- (gpointer *) &priv->downloader_view);
+ (gpointer *) downloader_view);
g_object_unref (priv->downloader_view);
priv->downloader_view = NULL;
}
@@ -193,10 +194,12 @@ ephy_embed_shell_get_downloader_view (EphyEmbedShell *shell)
if (shell->priv->downloader_view == NULL)
{
+ DownloaderView **downloader_view;
shell->priv->downloader_view = downloader_view_new ();
+ downloader_view = &shell->priv->downloader_view;
g_object_add_weak_pointer
(G_OBJECT(shell->priv->downloader_view),
- (gpointer *)&shell->priv->downloader_view);
+ (gpointer *) downloader_view);
}
return G_OBJECT (shell->priv->downloader_view);
diff --git a/src/bookmarks/ephy-bookmarks-editor.c b/src/bookmarks/ephy-bookmarks-editor.c
index badf962b8..6f5778105 100644
--- a/src/bookmarks/ephy-bookmarks-editor.c
+++ b/src/bookmarks/ephy-bookmarks-editor.c
@@ -1250,9 +1250,10 @@ ephy_bookmarks_editor_finalize (GObject *object)
if (editor->priv->window)
{
+ GtkWidget **window = &editor->priv->window;
g_object_remove_weak_pointer
(G_OBJECT(editor->priv->window),
- (gpointer *)&editor->priv->window);
+ (gpointer *)window);
}
G_OBJECT_CLASS (parent_class)->finalize (object);
@@ -1939,18 +1940,21 @@ void
ephy_bookmarks_editor_set_parent (EphyBookmarksEditor *ebe,
GtkWidget *window)
{
+ GtkWidget **w;
if (ebe->priv->window)
{
+ w = &ebe->priv->window;
g_object_remove_weak_pointer
(G_OBJECT(ebe->priv->window),
- (gpointer *)&ebe->priv->window);
+ (gpointer *)w);
}
ebe->priv->window = window;
+ w = &ebe->priv->window;
g_object_add_weak_pointer
(G_OBJECT(ebe->priv->window),
- (gpointer *)&ebe->priv->window);
+ (gpointer *)w);
}
diff --git a/src/ephy-encoding-menu.c b/src/ephy-encoding-menu.c
index 80dd7de4a..1d566cf67 100644
--- a/src/ephy-encoding-menu.c
+++ b/src/ephy-encoding-menu.c
@@ -318,11 +318,12 @@ ephy_encoding_menu_view_dialog_cb (GtkAction *action, EphyEncodingMenu *menu)
{
if (menu->priv->dialog == NULL)
{
+ EphyEncodingDialog **dialog = &menu->priv->dialog;
menu->priv->dialog = ephy_encoding_dialog_new
(menu->priv->window);
g_object_add_weak_pointer(G_OBJECT (menu->priv->dialog),
- (gpointer *) &menu->priv->dialog);
+ (gpointer *)dialog);
}
ephy_dialog_show (EPHY_DIALOG (menu->priv->dialog));
diff --git a/src/ephy-history-window.c b/src/ephy-history-window.c
index 7b36b261f..8d9c0acec 100644
--- a/src/ephy-history-window.c
+++ b/src/ephy-history-window.c
@@ -283,9 +283,12 @@ cmd_clear (GtkAction *action,
{
if (editor->priv->confirmation_dialog == NULL)
{
+ GtkWidget **confirmation_dialog;
+
editor->priv->confirmation_dialog = confirmation_dialog_construct (editor);
+ confirmation_dialog = &editor->priv->confirmation_dialog;
g_object_add_weak_pointer (G_OBJECT (editor->priv->confirmation_dialog),
- (gpointer *) &editor->priv->confirmation_dialog);
+ (gpointer *) confirmation_dialog);
}
gtk_widget_show (editor->priv->confirmation_dialog);
@@ -628,9 +631,10 @@ ephy_history_window_finalize (GObject *object)
if (editor->priv->window)
{
+ GtkWidget **window = &editor->priv->window;
g_object_remove_weak_pointer
(G_OBJECT(editor->priv->window),
- (gpointer *)&editor->priv->window);
+ (gpointer *)window);
}
G_OBJECT_CLASS (parent_class)->finalize (object);
@@ -1356,18 +1360,21 @@ void
ephy_history_window_set_parent (EphyHistoryWindow *ebe,
GtkWidget *window)
{
+ GtkWindow **widget;
if (ebe->priv->window)
{
+ widget = &ebe->priv->window;
g_object_remove_weak_pointer
(G_OBJECT(ebe->priv->window),
- (gpointer *)&ebe->priv->window);
+ (gpointer *)widget);
}
ebe->priv->window = window;
+ widget = &ebe->priv->window;
g_object_add_weak_pointer
(G_OBJECT(ebe->priv->window),
- (gpointer *)&ebe->priv->window);
+ (gpointer *)widget);
}
diff --git a/src/ephy-shell.c b/src/ephy-shell.c
index 3938d5eb2..aa88aa11d 100644
--- a/src/ephy-shell.c
+++ b/src/ephy-shell.c
@@ -815,10 +815,14 @@ ephy_shell_get_pdm_dialog (EphyShell *shell)
{
if (shell->priv->pdm_dialog == NULL)
{
+ GObject **dialog;
+
shell->priv->pdm_dialog = g_object_new (EPHY_TYPE_PDM_DIALOG, NULL);
+ dialog = &shell->priv->pdm_dialog;
+
g_object_add_weak_pointer (shell->priv->pdm_dialog,
- (gpointer *) &shell->priv->pdm_dialog);
+ (gpointer *) dialog);
}
return shell->priv->pdm_dialog;
@@ -829,10 +833,14 @@ ephy_shell_get_prefs_dialog (EphyShell *shell)
{
if (shell->priv->prefs_dialog == NULL)
{
+ GObject **dialog;
+
shell->priv->prefs_dialog = g_object_new (EPHY_TYPE_PREFS_DIALOG, NULL);
+ dialog = &shell->priv->prefs_dialog;
+
g_object_add_weak_pointer (shell->priv->prefs_dialog,
- (gpointer *) &shell->priv->prefs_dialog);
+ (gpointer *) dialog);
}
return shell->priv->prefs_dialog;
@@ -843,10 +851,14 @@ ephy_shell_get_print_setup_dialog (EphyShell *shell)
{
if (shell->priv->print_setup_dialog == NULL)
{
+ GObject **dialog;
+
shell->priv->print_setup_dialog = G_OBJECT (ephy_print_setup_dialog_new ());
+ dialog = &shell->priv->print_setup_dialog;
+
g_object_add_weak_pointer (shell->priv->print_setup_dialog,
- (gpointer *) &shell->priv->print_setup_dialog);
+ (gpointer *) dialog);
}
return shell->priv->print_setup_dialog;
diff --git a/src/prefs-dialog.c b/src/prefs-dialog.c
index ca4bb6eb5..b0b518f70 100644
--- a/src/prefs-dialog.c
+++ b/src/prefs-dialog.c
@@ -329,17 +329,21 @@ prefs_dialog_finalize (GObject *object)
if (priv->fonts_dialog != NULL)
{
+ EphyDialog **fonts_dialog = &priv->fonts_dialog;
+
g_object_remove_weak_pointer
(G_OBJECT (priv->fonts_dialog),
- (gpointer *) &priv->fonts_dialog);
+ (gpointer *) fonts_dialog);
g_object_unref (priv->fonts_dialog);
}
if (priv->add_lang_dialog != NULL)
{
+ EphyDialog **add_lang_dialog = &priv->add_lang_dialog;
+
g_object_remove_weak_pointer
(G_OBJECT (priv->add_lang_dialog),
- (gpointer *) &priv->add_lang_dialog);
+ (gpointer *) add_lang_dialog);
g_object_unref (priv->add_lang_dialog);
}
@@ -616,11 +620,15 @@ font_prefs_button_clicked_cb (GtkWidget *button,
if (priv->fonts_dialog == NULL)
{
+ EphyDialog **fonts_dialog;
+
priv->fonts_dialog = setup_fonts_dialog (pd);
+ fonts_dialog = &priv->fonts_dialog;
+
g_object_add_weak_pointer
(G_OBJECT (priv->fonts_dialog),
- (gpointer *) &priv->fonts_dialog);
+ (gpointer *) fonts_dialog);
}
ephy_dialog_show (priv->fonts_dialog);
@@ -1143,11 +1151,15 @@ language_editor_add_button_clicked_cb (GtkWidget *button,
{
if (pd->priv->add_lang_dialog == NULL)
{
+ EphyDialog **add_lang_dialog;
+
pd->priv->add_lang_dialog = setup_add_language_dialog (pd);
+ add_lang_dialog = &pd->priv->add_lang_dialog;
+
g_object_add_weak_pointer
(G_OBJECT (pd->priv->add_lang_dialog),
- (gpointer *) &pd->priv->add_lang_dialog);
+ (gpointer *) add_lang_dialog);
}
ephy_dialog_show (pd->priv->add_lang_dialog);