[nautilus/wip/ernestask/build-fixes-and-much-much-more: 3/3] tag-manager: fix use of pointer as integer



commit 08795580ce1648b2b60dffedc48becac2fa41c33
Author: Ernestas Kulik <ernestask gnome org>
Date:   Mon Mar 5 23:29:50 2018 +0200

    tag-manager: fix use of pointer as integer
    
    Pointers to IDs are stored in the hash table, not IDs themselves.
    
    Fixes https://gitlab.gnome.org/GNOME/nautilus/issues/283

 src/nautilus-tag-manager.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/nautilus-tag-manager.c b/src/nautilus-tag-manager.c
index 542c16f5a..754a1c68d 100644
--- a/src/nautilus-tag-manager.c
+++ b/src/nautilus-tag-manager.c
@@ -80,7 +80,7 @@ nautilus_tag_manager_file_with_id_changed_url (GHashTable  *hash_table,
     g_hash_table_iter_init (&iter, hash_table);
     while (g_hash_table_iter_next (&iter, &key, &value))
     {
-        if ((gint64) value == id && g_strcmp0 (url, key) != 0)
+        if (*((gint64 *) value) == id && g_strcmp0 (url, key) != 0)
         {
             return key;
         }
@@ -256,7 +256,7 @@ on_update_callback (GObject      *object,
                 {
                     id = g_new0 (gint64, 1);
 
-                    *id = (gint64) g_hash_table_lookup (data->ids, uri);
+                    *id = *((gint64 *) g_hash_table_lookup (data->ids, uri));
                     g_hash_table_insert (data->tag_manager->starred_files,
                                          nautilus_file_get_uri (NAUTILUS_FILE (l->data)),
                                          id);


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