[Xfce4-commits] [apps/xfce4-terminal] 01/01: Resolve clang's -Wcast-align warning

noreply at xfce.org noreply at xfce.org
Sun Sep 16 04:22:00 CEST 2018


This is an automated email from the git hooks/post-receive script.

f   2   4   0   4       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository apps/xfce4-terminal.

commit 4ce27291029322a00c4feb076aa6a5b8db298bc5
Author: Igor <f2404 at yandex.ru>
Date:   Sat Sep 15 22:21:54 2018 -0400

    Resolve clang's -Wcast-align warning
---
 terminal/terminal-window.c | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/terminal/terminal-window.c b/terminal/terminal-window.c
index 8840efc..994d649 100644
--- a/terminal/terminal-window.c
+++ b/terminal/terminal-window.c
@@ -1411,10 +1411,10 @@ terminal_window_notebook_drag_data_received (GtkWidget        *widget,
                                              guint             time,
                                              TerminalWindow   *window)
 {
-  GtkWidget  *notebook;
-  GtkWidget **screen;
-  gint        i, n_pages;
-  gboolean    succeed = FALSE;
+  GtkWidget *notebook;
+  GtkWidget *screen;
+  gint       i, n_pages;
+  gboolean   succeed = FALSE;
 
   terminal_return_if_fail (TERMINAL_IS_WINDOW (window));
   terminal_return_if_fail (TERMINAL_IS_SCREEN (widget));
@@ -1426,14 +1426,14 @@ terminal_window_notebook_drag_data_received (GtkWidget        *widget,
       notebook = gtk_drag_get_source_widget (context);
       terminal_return_if_fail (GTK_IS_NOTEBOOK (notebook));
 
-      /* get the dragged screen */
-      screen = (GtkWidget **) gtk_selection_data_get_data (selection_data);
-      if (!TERMINAL_IS_SCREEN (*screen))
+      /* get the dragged screen: selection_data's data is a (GtkWidget **) screen */
+      memcpy (&screen, gtk_selection_data_get_data (selection_data), sizeof (screen));
+      if (!TERMINAL_IS_SCREEN (screen))
         goto leave;
 
       /* leave if we dropped in the same screen and there is only one
        * page in the notebook (window will close before we insert) */
-      if (gtk_notebook_get_n_pages (GTK_NOTEBOOK (notebook)) < 2 && *screen == widget)
+      if (gtk_notebook_get_n_pages (GTK_NOTEBOOK (notebook)) < 2 && screen == widget)
         goto leave;
 
       /* figure out where to insert the tab in the notebook */
@@ -1455,25 +1455,25 @@ terminal_window_notebook_drag_data_received (GtkWidget        *widget,
         {
           /* if we're in the same notebook, don't risk anything and do a
            * simple reorder */
-          gtk_notebook_reorder_child (GTK_NOTEBOOK (notebook), *screen, i);
+          gtk_notebook_reorder_child (GTK_NOTEBOOK (notebook), screen, i);
         }
       else
         {
           /* take a reference */
-          g_object_ref (G_OBJECT (*screen));
+          g_object_ref (G_OBJECT (screen));
           g_object_ref (G_OBJECT (window));
 
           /* remove the document from the source notebook */
-          gtk_notebook_detach_tab (GTK_NOTEBOOK (notebook), *screen);
+          gtk_notebook_detach_tab (GTK_NOTEBOOK (notebook), screen);
 
           /* add the screen to the new window */
-          terminal_window_add (window, TERMINAL_SCREEN (*screen));
+          terminal_window_add (window, TERMINAL_SCREEN (screen));
 
           /* move the child to the correct position */
-          gtk_notebook_reorder_child (GTK_NOTEBOOK (window->priv->notebook), *screen, i);
+          gtk_notebook_reorder_child (GTK_NOTEBOOK (window->priv->notebook), screen, i);
 
           /* release reference */
-          g_object_unref (G_OBJECT (*screen));
+          g_object_unref (G_OBJECT (screen));
           g_object_unref (G_OBJECT (window));
         }
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list