From 8dc95a5c584d8fdb99afec102702bd8801b95266 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Rameau?= Date: Thu, 2 Mar 2006 21:23:34 +0000 Subject: Fix gcc 4.1 warnings (dereferencing type-punned pointer will break MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2006-03-02 Jean-François Rameau * 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). --- src/ephy-shell.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src/ephy-shell.c') 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; -- cgit v1.2.1