[network-manager-applet] editor: use GSIZE_TO_POINTER and GPOINTER_TO_SIZE for GType (rh #1245789)



commit ca9bed776b1c69b78c42f8c025e3d4f7d548762f
Author: Jiří Klimeš <jklimes redhat com>
Date:   Thu Aug 20 16:33:10 2015 +0200

    editor: use GSIZE_TO_POINTER and GPOINTER_TO_SIZE for GType (rh #1245789)
    
    GPOINTER_TO_UINT may truncate the GType (actually gsize, i.e. unsigned long).
    Use rather GPOINTER_TO_SIZE() to be safe. And GSIZE_TO_POINTER() for the
    opposite conversion.

 src/connection-editor/main.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/connection-editor/main.c b/src/connection-editor/main.c
index 8a0dd16..d2e3110 100644
--- a/src/connection-editor/main.c
+++ b/src/connection-editor/main.c
@@ -138,7 +138,7 @@ static gboolean
 idle_create_connection (gpointer user_data)
 {
        NMConnectionList *list = user_data;
-       GType ctype = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (list), "nm-connection-editor-ctype"));
+       GType ctype = (GType) GPOINTER_TO_SIZE (g_object_get_data (G_OBJECT (list), 
"nm-connection-editor-ctype"));
        char *detail = g_object_get_data (G_OBJECT (list), "nm-connection-editor-detail");
 
        nm_connection_list_create (list, ctype, detail);
@@ -190,7 +190,7 @@ handle_arguments (NMConnectionList *list,
                 */
                g_idle_add (idle_create_connection, list);
                g_object_set_data (G_OBJECT (list), "nm-connection-editor-ctype",
-                                  GUINT_TO_POINTER (ctype));
+                                  GSIZE_TO_POINTER (ctype));
                g_object_set_data_full (G_OBJECT (list), "nm-connection-editor-detail",
                                        g_strdup (detail), g_free);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]