Port: Use glib portable macros to convert gpointer to int
authorMichael Jeanson <mjeanson@efficios.com>
Mon, 12 Sep 2016 20:01:27 +0000 (20:01 +0000)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 9 Jun 2017 20:58:14 +0000 (16:58 -0400)
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
cli/babeltrace.c
plugins/ctf/common/metadata/parser.y
plugins/ctf/common/metadata/visitor-generate-ir.c

index 8e4755a6f4204c6efce8061a6e556007d8f2552e..66c74df44b85ca8024f2ef99cc5e07bd3232bbd0 100644 (file)
@@ -1190,7 +1190,7 @@ int cmd_run_ctx_connect_upstream_port_to_downstream_component(
                cfg_conn->downstream_comp_name->str);
        assert(downstreamp_comp_name_quark > 0);
        downstream_comp = g_hash_table_lookup(ctx->components,
-               (gpointer) (long) downstreamp_comp_name_quark);
+               GUINT_TO_POINTER(downstreamp_comp_name_quark));
        if (!downstream_comp) {
                BT_LOGE("Cannot find downstream component:  comp-name=\"%s\", "
                        "conn-arg=\"%s\"", cfg_conn->downstream_comp_name->str,
@@ -1596,7 +1596,7 @@ int cmd_run_ctx_create_components_from_config_components(
                quark = g_quark_from_string(cfg_comp->instance_name->str);
                assert(quark > 0);
                g_hash_table_insert(ctx->components,
-                       (gpointer) (long) quark, comp);
+                       GUINT_TO_POINTER(quark), comp);
                comp = NULL;
                BT_PUT(comp_cls);
        }
index eb9c75543b239c4db0b6e403c283499f8f4469ef..24cc902a614ddc939d0693a00150471caf7648b9 100644 (file)
@@ -330,7 +330,7 @@ static int lookup_type(struct ctf_scanner_scope *s, const char *id)
 {
        int ret;
 
-       ret = (int) (long) g_hash_table_lookup(s->types, id);
+       ret = GPOINTER_TO_INT(g_hash_table_lookup(s->types, id));
        printf_debug("lookup %p %s %d\n", s, id, ret);
        return ret;
 }
index aa7075486e04c2098ad8416204200a46bb6ed2da..6fefc24d9b29e8d2ad5c1fed4f38dd1c7a6e9e6f 100644 (file)
@@ -384,7 +384,7 @@ struct bt_ctf_field_type *ctx_decl_scope_lookup_prefix_alias(
 
        while (cur_scope && cur_levels < levels) {
                decl = g_hash_table_lookup(cur_scope->decl_map,
-                       (gconstpointer) (unsigned long) qname);
+                       (gconstpointer) GUINT_TO_POINTER(qname));
                if (decl) {
                        /* Caller's reference */
                        bt_get(decl);
@@ -500,7 +500,7 @@ int ctx_decl_scope_register_prefix_alias(struct ctx_decl_scope *scope,
        }
 
        g_hash_table_insert(scope->decl_map,
-               (gpointer) (unsigned long) qname, decl);
+               GUINT_TO_POINTER(qname), decl);
 
        /* Hash table's reference */
        bt_get(decl);
This page took 0.029665 seconds and 4 git commands to generate.