X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=lib%2Fregistry.c;h=bc2be95ef739215648d5ab709e30dcc93515db1d;hb=5b44aff250d4510f7e96447ddc77f0e3ff3f1739;hp=28af184f8c5da58c7122637a0353a09cc13b5453;hpb=c462e188f3e7819c7bc74f671038cdbf36e8c3c0;p=babeltrace.git diff --git a/lib/registry.c b/lib/registry.c index 28af184f..bc2be95e 100644 --- a/lib/registry.c +++ b/lib/registry.c @@ -67,13 +67,13 @@ void format_refcount_dec(void) format_cleanup(); } -struct format *bt_lookup_format(bt_intern_str name) +struct bt_format *bt_lookup_format(bt_intern_str name) { if (!init_done) 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) @@ -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 ? ", " : "", - g_quark_to_string((GQuark) (unsigned long) key)); + g_quark_to_string((GQuark) GPOINTER_TO_UINT(key))); data->iter++; } @@ -103,7 +103,7 @@ void bt_fprintf_format_list(FILE *fp) fprintf(fp, ".\n"); } -int bt_register_format(struct format *format) +int bt_register_format(struct bt_format *format) { if (!format) return -EINVAL; @@ -116,16 +116,16 @@ int bt_register_format(struct format *format) format_refcount_inc(); g_hash_table_insert(format_registry, - (gpointer) (unsigned long) format->name, + GUINT_TO_POINTER(format->name), format); return 0; } -void bt_unregister_format(struct format *format) +void bt_unregister_format(struct bt_format *format) { 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(); }