[network-manager-applet/nma-1-0] editor: use GSIZE_TO_POINTER and GPOINTER_TO_SIZE for GType (rh #1245789)
- From: Jiří Klimeš <jklimes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-applet/nma-1-0] editor: use GSIZE_TO_POINTER and GPOINTER_TO_SIZE for GType (rh #1245789)
- Date: Thu, 20 Aug 2015 15:12:46 +0000 (UTC)
commit 562c0cd0365ce1a70fda9cecdf52be68013169db
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.
(cherry picked from commit ca9bed776b1c69b78c42f8c025e3d4f7d548762f)
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 d552201..c6e157a 100644
--- a/src/connection-editor/main.c
+++ b/src/connection-editor/main.c
@@ -141,7 +141,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);
@@ -193,7 +193,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]