Use glib portable macros to convert gpointer to int
[babeltrace.git] / lib / registry.c
index bdce0c6d01e9cf306753791f44a588ed5cbe15a8..bc2be95ef739215648d5ab709e30dcc93515db1d 100644 (file)
@@ -73,7 +73,7 @@ struct bt_format *bt_lookup_format(bt_intern_str name)
                return NULL;
 
        return g_hash_table_lookup(format_registry,
                return NULL;
 
        return g_hash_table_lookup(format_registry,
-                                  (gconstpointer) (unsigned long) name);
+                                  (gconstpointer) GUINT_TO_POINTER(name));
 }
 
 static void show_format(gpointer key, gpointer value, gpointer user_data)
 }
 
 static void show_format(gpointer key, gpointer value, gpointer user_data)
@@ -81,7 +81,7 @@ static void show_format(gpointer key, gpointer value, gpointer user_data)
        struct walk_data *data = user_data;
 
        fprintf(data->fp, "%s%s", data->iter ? ", " : "",
        struct walk_data *data = user_data;
 
        fprintf(data->fp, "%s%s", data->iter ? ", " : "",
-               g_quark_to_string((GQuark) (unsigned long) key));
+               g_quark_to_string((GQuark) GPOINTER_TO_UINT(key)));
        data->iter++;
 }
 
        data->iter++;
 }
 
@@ -116,7 +116,7 @@ int bt_register_format(struct bt_format *format)
 
        format_refcount_inc();
        g_hash_table_insert(format_registry,
 
        format_refcount_inc();
        g_hash_table_insert(format_registry,
-                           (gpointer) (unsigned long) format->name,
+                           GUINT_TO_POINTER(format->name),
                            format);
        return 0;
 }
                            format);
        return 0;
 }
@@ -125,7 +125,7 @@ void bt_unregister_format(struct bt_format *format)
 {
        assert(bt_lookup_format(format->name));
        g_hash_table_remove(format_registry,
 {
        assert(bt_lookup_format(format->name));
        g_hash_table_remove(format_registry,
-                           (gpointer) (unsigned long) format->name);
+                           GUINT_TO_POINTER(format->name));
        format_refcount_dec();
 }
 
        format_refcount_dec();
 }
 
This page took 0.023463 seconds and 4 git commands to generate.