namespace declaration_ref and declaration_unref
authorJulien Desfossez <jdesfossez@efficios.com>
Thu, 24 Jan 2013 22:21:27 +0000 (17:21 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 24 Jan 2013 22:21:27 +0000 (17:21 -0500)
Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 files changed:
formats/ctf/metadata/ctf-visitor-generate-io-struct.c
formats/ctf/types/float.c
include/babeltrace/types.h
types/array.c
types/enum.c
types/float.c
types/integer.c
types/sequence.c
types/string.c
types/struct.c
types/types.c
types/variant.c

index 97d15e77ccddf08231906cf81182236876eebaf1..9693345649b5d68e6f9c437a1480baba41919960 100644 (file)
@@ -516,7 +516,7 @@ struct declaration *ctf_type_declarator_visit(FILE *fd, int depth,
                                fprintf(fd, "[error] %s: cannot create array declaration.\n", __func__);
                                return NULL;
                        }
-                       declaration_unref(nested_declaration);
+                       bt_declaration_unref(nested_declaration);
                        declaration = &array_declaration->p;
                        break;
                }
@@ -532,7 +532,7 @@ struct declaration *ctf_type_declarator_visit(FILE *fd, int depth,
                                g_free(length_name);
                                return NULL;
                        }
-                       declaration_unref(nested_declaration);
+                       bt_declaration_unref(nested_declaration);
                        declaration = &sequence_declaration->p;
                        g_free(length_name);
                        break;
@@ -583,7 +583,7 @@ int ctf_struct_type_declarators_visit(FILE *fd, int depth,
                struct_declaration_add_field(struct_declaration,
                                             g_quark_to_string(field_name),
                                             field_declaration);
-               declaration_unref(field_declaration);
+               bt_declaration_unref(field_declaration);
        }
        return 0;
 }
@@ -620,7 +620,7 @@ int ctf_variant_type_declarators_visit(FILE *fd, int depth,
                untagged_variant_declaration_add_field(untagged_variant_declaration,
                                              g_quark_to_string(field_name),
                                              field_declaration);
-               declaration_unref(field_declaration);
+               bt_declaration_unref(field_declaration);
        }
        return 0;
 }
@@ -652,7 +652,7 @@ int ctf_typedef_visit(FILE *fd, int depth, struct declaration_scope *scope,
                 */
                if (type_declaration->id == CTF_TYPE_UNTAGGED_VARIANT) {
                        fprintf(fd, "[error] %s: typedef of untagged variant is not permitted.\n", __func__);
-                       declaration_unref(type_declaration);
+                       bt_declaration_unref(type_declaration);
                        return -EPERM;
                }
                ret = register_declaration(identifier, type_declaration, scope);
@@ -660,7 +660,7 @@ int ctf_typedef_visit(FILE *fd, int depth, struct declaration_scope *scope,
                        type_declaration->declaration_free(type_declaration);
                        return ret;
                }
-               declaration_unref(type_declaration);
+               bt_declaration_unref(type_declaration);
        }
        return 0;
 }
@@ -702,7 +702,7 @@ int ctf_typealias_visit(FILE *fd, int depth, struct declaration_scope *scope,
         */
        if (type_declaration->id == CTF_TYPE_UNTAGGED_VARIANT) {
                fprintf(fd, "[error] %s: typedef of untagged variant is not permitted.\n", __func__);
-               declaration_unref(type_declaration);
+               bt_declaration_unref(type_declaration);
                return -EPERM;
        }
        /*
@@ -725,7 +725,7 @@ int ctf_typealias_visit(FILE *fd, int depth, struct declaration_scope *scope,
        err = register_declaration(alias_q, type_declaration, scope);
        if (err)
                goto error;
-       declaration_unref(type_declaration);
+       bt_declaration_unref(type_declaration);
        return 0;
 
 error:
@@ -842,7 +842,7 @@ struct declaration *ctf_declaration_struct_visit(FILE *fd,
                struct_declaration =
                        lookup_struct_declaration(g_quark_from_string(name),
                                                  declaration_scope);
-               declaration_ref(&struct_declaration->p);
+               bt_declaration_ref(&struct_declaration->p);
                return &struct_declaration->p;
        } else {
                uint64_t min_align_value = 0;
@@ -914,7 +914,7 @@ struct declaration *ctf_declaration_variant_visit(FILE *fd,
                untagged_variant_declaration =
                        lookup_variant_declaration(g_quark_from_string(name),
                                                   declaration_scope);
-               declaration_ref(&untagged_variant_declaration->p);
+               bt_declaration_ref(&untagged_variant_declaration->p);
        } else {
                /* For unnamed variant, create type */
                /* For named variant (with body), create type and add to declaration scope */
@@ -954,7 +954,7 @@ struct declaration *ctf_declaration_variant_visit(FILE *fd,
                variant_declaration = variant_declaration_new(untagged_variant_declaration, choice);
                if (!variant_declaration)
                        goto error;
-               declaration_unref(&untagged_variant_declaration->p);
+               bt_declaration_unref(&untagged_variant_declaration->p);
                return &variant_declaration->p;
        }
 error:
@@ -1078,7 +1078,7 @@ struct declaration *ctf_declaration_enum_visit(FILE *fd, int depth,
                enum_declaration =
                        lookup_enum_declaration(g_quark_from_string(name),
                                                declaration_scope);
-               declaration_ref(&enum_declaration->p);
+               bt_declaration_ref(&enum_declaration->p);
                return &enum_declaration->p;
        } else {
                /* For unnamed enum, create type */
@@ -1115,7 +1115,7 @@ struct declaration *ctf_declaration_enum_visit(FILE *fd, int depth,
                }
                integer_declaration = container_of(declaration, struct declaration_integer, p);
                enum_declaration = enum_declaration_new(integer_declaration);
-               declaration_unref(&integer_declaration->p);     /* leave ref to enum */
+               bt_declaration_unref(&integer_declaration->p);  /* leave ref to enum */
                if (enum_declaration->integer_declaration->signedness) {
                        last_value.u.s = 0;
                } else {
@@ -1136,7 +1136,7 @@ struct declaration *ctf_declaration_enum_visit(FILE *fd, int depth,
                                        enum_declaration,
                                        declaration_scope);
                        assert(!ret);
-                       declaration_unref(&enum_declaration->p);
+                       bt_declaration_unref(&enum_declaration->p);
                }
                return &enum_declaration->p;
        }
@@ -1164,7 +1164,7 @@ struct declaration *ctf_declaration_type_specifier_visit(FILE *fd, int depth,
        id_q = g_quark_from_string(str_c);
        g_free(str_c);
        declaration = lookup_declaration(id_q, declaration_scope);
-       declaration_ref(declaration);
+       bt_declaration_ref(declaration);
        return declaration;
 }
 
@@ -1864,9 +1864,9 @@ int ctf_event_visit(FILE *fd, int depth, struct ctf_node *node,
 
 error:
        if (event->fields_decl)
-               declaration_unref(&event->fields_decl->p);
+               bt_declaration_unref(&event->fields_decl->p);
        if (event->context_decl)
-               declaration_unref(&event->context_decl->p);
+               bt_declaration_unref(&event->context_decl->p);
        free_declaration_scope(event->declaration_scope);
        g_free(event_decl);
        return ret;
@@ -2040,11 +2040,11 @@ int ctf_stream_visit(FILE *fd, int depth, struct ctf_node *node,
 
 error:
        if (stream->event_header_decl)
-               declaration_unref(&stream->event_header_decl->p);
+               bt_declaration_unref(&stream->event_header_decl->p);
        if (stream->event_context_decl)
-               declaration_unref(&stream->event_context_decl->p);
+               bt_declaration_unref(&stream->event_context_decl->p);
        if (stream->packet_context_decl)
-               declaration_unref(&stream->packet_context_decl->p);
+               bt_declaration_unref(&stream->packet_context_decl->p);
        g_ptr_array_free(stream->streams, TRUE);
        g_ptr_array_free(stream->events_by_id, TRUE);
        g_hash_table_destroy(stream->event_quark_to_id);
@@ -2236,7 +2236,7 @@ int ctf_trace_visit(FILE *fd, int depth, struct ctf_node *node, struct ctf_trace
 
 error:
        if (trace->packet_header_decl) {
-               declaration_unref(&trace->packet_header_decl->p);
+               bt_declaration_unref(&trace->packet_header_decl->p);
                trace->packet_header_decl = NULL;
        }
        g_ptr_array_free(trace->streams, TRUE);
@@ -2851,7 +2851,7 @@ int ctf_root_declaration_visit(FILE *fd, int depth, struct ctf_node *node, struc
                        node, trace->root_declaration_scope, trace);
                if (!declaration)
                        return -ENOMEM;
-               declaration_unref(declaration);
+               bt_declaration_unref(declaration);
                break;
        }
        default:
@@ -3021,11 +3021,11 @@ int ctf_destroy_metadata(struct ctf_trace *trace)
                                g_free(stream_def);
                        }
                        if (stream->event_header_decl)
-                               declaration_unref(&stream->event_header_decl->p);
+                               bt_declaration_unref(&stream->event_header_decl->p);
                        if (stream->event_context_decl)
-                               declaration_unref(&stream->event_context_decl->p);
+                               bt_declaration_unref(&stream->event_context_decl->p);
                        if (stream->packet_context_decl)
-                               declaration_unref(&stream->packet_context_decl->p);
+                               bt_declaration_unref(&stream->packet_context_decl->p);
                        g_ptr_array_free(stream->streams, TRUE);
                        g_ptr_array_free(stream->events_by_id, TRUE);
                        g_hash_table_destroy(stream->event_quark_to_id);
@@ -3056,9 +3056,9 @@ int ctf_destroy_metadata(struct ctf_trace *trace)
 
                        event = &event_decl->parent;
                        if (event->fields_decl)
-                               declaration_unref(&event->fields_decl->p);
+                               bt_declaration_unref(&event->fields_decl->p);
                        if (event->context_decl)
-                               declaration_unref(&event->context_decl->p);
+                               bt_declaration_unref(&event->context_decl->p);
                        free_declaration_scope(event->declaration_scope);
 
                        g_free(event);
@@ -3066,7 +3066,7 @@ int ctf_destroy_metadata(struct ctf_trace *trace)
                g_ptr_array_free(trace->event_declarations, TRUE);
        }
        if (trace->packet_header_decl)
-               declaration_unref(&trace->packet_header_decl->p);
+               bt_declaration_unref(&trace->packet_header_decl->p);
 
        free_declaration_scope(trace->root_declaration_scope);
        free_declaration_scope(trace->declaration_scope);
index 054e262452dc5edae4661950b43429b75e73924d..d77cff53bea6676d9d3618366f0218f8beb93e54 100644 (file)
@@ -296,6 +296,6 @@ void __attribute__((constructor)) ctf_float_init(void)
 static
 void __attribute__((destructor)) ctf_float_fini(void)
 {
-       declaration_unref(&static_float_declaration->p);
-       declaration_unref(&static_double_declaration->p);
+       bt_declaration_unref(&static_float_declaration->p);
+       bt_declaration_unref(&static_double_declaration->p);
 }
index 3b45fd5596c858048ec64f8cded0bd697c5a5043..2348823f65b47dbaa6afea95f780d5b8561a5eff 100644 (file)
@@ -364,8 +364,8 @@ int compare_definition_path(struct definition *definition, GQuark path)
        return definition->path == path;
 }
 
-void declaration_ref(struct declaration *declaration);
-void declaration_unref(struct declaration *declaration);
+void bt_declaration_ref(struct declaration *declaration);
+void bt_declaration_unref(struct declaration *declaration);
 
 void definition_ref(struct definition *definition);
 void definition_unref(struct definition *definition);
index d2db46ff1306010bf6cf3a69002fe57295768b91..cc9a60085cbf167f155a47003b1ffce84838b2c5 100644 (file)
@@ -65,7 +65,7 @@ void _array_declaration_free(struct declaration *declaration)
                container_of(declaration, struct declaration_array, p);
 
        free_declaration_scope(array_declaration->scope);
-       declaration_unref(array_declaration->elem);
+       bt_declaration_unref(array_declaration->elem);
        g_free(array_declaration);
 }
 
@@ -80,7 +80,7 @@ struct declaration_array *
        array_declaration = g_new(struct declaration_array, 1);
        declaration = &array_declaration->p;
        array_declaration->len = len;
-       declaration_ref(elem_declaration);
+       bt_declaration_ref(elem_declaration);
        array_declaration->elem = elem_declaration;
        array_declaration->scope = new_declaration_scope(parent_scope);
        declaration->id = CTF_TYPE_ARRAY;
@@ -105,7 +105,7 @@ struct definition *
        int i;
 
        array = g_new(struct definition_array, 1);
-       declaration_ref(&array_declaration->p);
+       bt_declaration_ref(&array_declaration->p);
        array->p.declaration = declaration;
        array->declaration = array_declaration;
        array->p.ref = 1;
@@ -170,7 +170,7 @@ error:
        }
        (void) g_ptr_array_free(array->elems, TRUE);
        free_definition_scope(array->p.scope);
-       declaration_unref(array->p.declaration);
+       bt_declaration_unref(array->p.declaration);
        g_free(array);
        return NULL;
 }
@@ -194,7 +194,7 @@ void _array_definition_free(struct definition *definition)
                (void) g_ptr_array_free(array->elems, TRUE);
        }
        free_definition_scope(array->p.scope);
-       declaration_unref(array->p.declaration);
+       bt_declaration_unref(array->p.declaration);
        g_free(array);
 }
 
index ca0143d4f5a53849136b7195bde96c2a62b93240..2ea40ba482449885355ae3dd95f30476e6dc8cb6 100644 (file)
@@ -386,7 +386,7 @@ void _enum_declaration_free(struct declaration *declaration)
                g_free(iter);
        }
        g_hash_table_destroy(enum_declaration->table.quark_to_range_set);
-       declaration_unref(&enum_declaration->integer_declaration->p);
+       bt_declaration_unref(&enum_declaration->integer_declaration->p);
        g_free(enum_declaration);
 }
 
@@ -405,7 +405,7 @@ struct declaration_enum *
        enum_declaration->table.quark_to_range_set = g_hash_table_new_full(g_direct_hash,
                                                        g_direct_equal,
                                                        NULL, enum_range_set_free);
-       declaration_ref(&integer_declaration->p);
+       bt_declaration_ref(&integer_declaration->p);
        enum_declaration->integer_declaration = integer_declaration;
        enum_declaration->p.id = CTF_TYPE_ENUM;
        enum_declaration->p.alignment = 1;
@@ -430,7 +430,7 @@ struct definition *
        int ret;
 
        _enum = g_new(struct definition_enum, 1);
-       declaration_ref(&enum_declaration->p);
+       bt_declaration_ref(&enum_declaration->p);
        _enum->p.declaration = declaration;
        _enum->declaration = enum_declaration;
        _enum->p.ref = 1;
@@ -463,7 +463,7 @@ void _enum_definition_free(struct definition *definition)
 
        definition_unref(&_enum->integer->p);
        free_definition_scope(_enum->p.scope);
-       declaration_unref(_enum->p.declaration);
+       bt_declaration_unref(_enum->p.declaration);
        if (_enum->value)
                g_array_unref(_enum->value);
        g_free(_enum);
index 028749bc92a177f91237283797a234a65fd21284..5c80312d457a191dbfa66b07c41e84922ffcaeae 100644 (file)
@@ -45,9 +45,9 @@ void _float_declaration_free(struct declaration *declaration)
        struct declaration_float *float_declaration =
                container_of(declaration, struct declaration_float, p);
 
-       declaration_unref(&float_declaration->exp->p);
-       declaration_unref(&float_declaration->mantissa->p);
-       declaration_unref(&float_declaration->sign->p);
+       bt_declaration_unref(&float_declaration->exp->p);
+       bt_declaration_unref(&float_declaration->mantissa->p);
+       bt_declaration_unref(&float_declaration->sign->p);
        g_free(float_declaration);
 }
 
@@ -93,7 +93,7 @@ struct definition *
        struct definition *tmp;
 
        _float = g_new(struct definition_float, 1);
-       declaration_ref(&float_declaration->p);
+       bt_declaration_ref(&float_declaration->p);
        _float->p.declaration = declaration;
        _float->declaration = float_declaration;
        _float->p.scope = new_definition_scope(parent_scope, field_name, root_name);
@@ -147,6 +147,6 @@ void _float_definition_free(struct definition *definition)
        definition_unref(&_float->exp->p);
        definition_unref(&_float->mantissa->p);
        free_definition_scope(_float->p.scope);
-       declaration_unref(_float->p.declaration);
+       bt_declaration_unref(_float->p.declaration);
        g_free(_float);
 }
index 337641d7a3123018f14fc3f933285da8d35484ad..20e7688d80ebb17fe91a36eff3280776c109982b 100644 (file)
@@ -85,7 +85,7 @@ struct definition *
        int ret;
 
        integer = g_new(struct definition_integer, 1);
-       declaration_ref(&integer_declaration->p);
+       bt_declaration_ref(&integer_declaration->p);
        integer->p.declaration = declaration;
        integer->declaration = integer_declaration;
        integer->p.ref = 1;
@@ -111,7 +111,7 @@ void _integer_definition_free(struct definition *definition)
        struct definition_integer *integer =
                container_of(definition, struct definition_integer, p);
 
-       declaration_unref(integer->p.declaration);
+       bt_declaration_unref(integer->p.declaration);
        g_free(integer);
 }
 
index 3967f977a105b6fc815940a6702291f7cb443e98..18d7e350abbb3b69273fddd937e1a3a30b63d17d 100644 (file)
@@ -95,7 +95,7 @@ void _sequence_declaration_free(struct declaration *declaration)
 
        free_declaration_scope(sequence_declaration->scope);
        g_array_free(sequence_declaration->length_name, TRUE);
-       declaration_unref(sequence_declaration->elem);
+       bt_declaration_unref(sequence_declaration->elem);
        g_free(sequence_declaration);
 }
 
@@ -113,7 +113,7 @@ struct declaration_sequence *
        sequence_declaration->length_name = g_array_new(FALSE, TRUE, sizeof(GQuark));
        bt_append_scope_path(length, sequence_declaration->length_name);
 
-       declaration_ref(elem_declaration);
+       bt_declaration_ref(elem_declaration);
        sequence_declaration->elem = elem_declaration;
        sequence_declaration->scope = new_declaration_scope(parent_scope);
        declaration->id = CTF_TYPE_SEQUENCE;
@@ -138,7 +138,7 @@ struct definition *_sequence_definition_new(struct declaration *declaration,
        int ret;
 
        sequence = g_new(struct definition_sequence, 1);
-       declaration_ref(&sequence_declaration->p);
+       bt_declaration_ref(&sequence_declaration->p);
        sequence->p.declaration = declaration;
        sequence->declaration = sequence_declaration;
        sequence->p.ref = 1;
@@ -192,7 +192,7 @@ struct definition *_sequence_definition_new(struct declaration *declaration,
 
 error:
        free_definition_scope(sequence->p.scope);
-       declaration_unref(&sequence_declaration->p);
+       bt_declaration_unref(&sequence_declaration->p);
        g_free(sequence);
        return NULL;
 }
@@ -218,7 +218,7 @@ void _sequence_definition_free(struct definition *definition)
        }
        definition_unref(len_definition);
        free_definition_scope(sequence->p.scope);
-       declaration_unref(sequence->p.declaration);
+       bt_declaration_unref(sequence->p.declaration);
        g_free(sequence);
 }
 
index 4860740616ae97631c1a0c61ffd6f61a10ef8220..cebce12d9df897e9d7303058987c85af29ea58f0 100644 (file)
@@ -76,7 +76,7 @@ struct definition *
        int ret;
 
        string = g_new(struct definition_string, 1);
-       declaration_ref(&string_declaration->p);
+       bt_declaration_ref(&string_declaration->p);
        string->p.declaration = declaration;
        string->declaration = string_declaration;
        string->p.ref = 1;
@@ -104,7 +104,7 @@ void _string_definition_free(struct definition *definition)
        struct definition_string *string =
                container_of(definition, struct definition_string, p);
 
-       declaration_unref(string->p.declaration);
+       bt_declaration_unref(string->p.declaration);
        g_free(string->value);
        g_free(string);
 }
index 138da167509ae25c8cf0f218b4ca5ccfeaf63978..5cc0849f55cdc344690161f1d130120996b37485 100644 (file)
@@ -74,7 +74,7 @@ void _struct_declaration_free(struct declaration *declaration)
                struct declaration_field *declaration_field =
                        &g_array_index(struct_declaration->fields,
                                       struct declaration_field, i);
-               declaration_unref(declaration_field->declaration);
+               bt_declaration_unref(declaration_field->declaration);
        }
        g_array_free(struct_declaration->fields, true);
        g_free(struct_declaration);
@@ -118,7 +118,7 @@ struct definition *
        int ret;
 
        _struct = g_new(struct definition_struct, 1);
-       declaration_ref(&struct_declaration->p);
+       bt_declaration_ref(&struct_declaration->p);
        _struct->p.declaration = declaration;
        _struct->declaration = struct_declaration;
        _struct->p.ref = 1;
@@ -158,7 +158,7 @@ error:
                definition_unref(field);
        }
        free_definition_scope(_struct->p.scope);
-       declaration_unref(&struct_declaration->p);
+       bt_declaration_unref(&struct_declaration->p);
        g_free(_struct);
        return NULL;
 }
@@ -176,7 +176,7 @@ void _struct_definition_free(struct definition *definition)
                definition_unref(field);
        }
        free_definition_scope(_struct->p.scope);
-       declaration_unref(_struct->p.declaration);
+       bt_declaration_unref(_struct->p.declaration);
        g_ptr_array_free(_struct->fields, TRUE);
        g_free(_struct);
 }
@@ -192,7 +192,7 @@ void struct_declaration_add_field(struct declaration_struct *struct_declaration,
        index = struct_declaration->fields->len - 1;    /* last field (new) */
        field = &g_array_index(struct_declaration->fields, struct declaration_field, index);
        field->name = g_quark_from_string(field_name);
-       declaration_ref(field_declaration);
+       bt_declaration_ref(field_declaration);
        field->declaration = field_declaration;
        /* Keep index in hash rather than pointer, because array can relocate */
        g_hash_table_insert(struct_declaration->fields_by_name,
index 9c5cfca3a3941be044abf68e4c4d90a35d560945..5bb051f5bf1b0f593162a3f6e8fe727d05be2e28 100644 (file)
@@ -87,7 +87,7 @@ int register_declaration(GQuark name, struct declaration *declaration,
        g_hash_table_insert(scope->typedef_declarations,
                            (gpointer) (unsigned long) name,
                            declaration);
-       declaration_ref(declaration);
+       bt_declaration_ref(declaration);
        return 0;
 }
 
@@ -279,12 +279,12 @@ int register_field_definition(GQuark field_name, struct definition *definition,
        return 0;
 }
 
-void declaration_ref(struct declaration *declaration)
+void bt_declaration_ref(struct declaration *declaration)
 {
        declaration->ref++;
 }
 
-void declaration_unref(struct declaration *declaration)
+void bt_declaration_unref(struct declaration *declaration)
 {
        if (!declaration)
                return;
@@ -312,16 +312,16 @@ struct declaration_scope *
 
        scope->typedef_declarations = g_hash_table_new_full(g_direct_hash,
                                        g_direct_equal, NULL,
-                                       (GDestroyNotify) declaration_unref);
+                                       (GDestroyNotify) bt_declaration_unref);
        scope->struct_declarations = g_hash_table_new_full(g_direct_hash,
                                        g_direct_equal, NULL,
-                                       (GDestroyNotify) declaration_unref);
+                                       (GDestroyNotify) bt_declaration_unref);
        scope->variant_declarations = g_hash_table_new_full(g_direct_hash,
                                        g_direct_equal, NULL,
-                                       (GDestroyNotify) declaration_unref);
+                                       (GDestroyNotify) bt_declaration_unref);
        scope->enum_declarations = g_hash_table_new_full(g_direct_hash,
                                        g_direct_equal, NULL,
-                                       (GDestroyNotify) declaration_unref);
+                                       (GDestroyNotify) bt_declaration_unref);
        scope->parent_scope = parent_scope;
        return scope;
 }
@@ -374,7 +374,7 @@ int register_struct_declaration(GQuark struct_name,
        g_hash_table_insert(scope->struct_declarations,
                            (gpointer) (unsigned long) struct_name,
                            struct_declaration);
-       declaration_ref(&struct_declaration->p);
+       bt_declaration_ref(&struct_declaration->p);
 
        /* Also add in typedef/typealias scopes */
        prefix_name = prefix_quark("struct ", struct_name);
@@ -424,7 +424,7 @@ int register_variant_declaration(GQuark variant_name,
        g_hash_table_insert(scope->variant_declarations,
                            (gpointer) (unsigned long) variant_name,
                            untagged_variant_declaration);
-       declaration_ref(&untagged_variant_declaration->p);
+       bt_declaration_ref(&untagged_variant_declaration->p);
 
        /* Also add in typedef/typealias scopes */
        prefix_name = prefix_quark("variant ", variant_name);
@@ -475,7 +475,7 @@ int register_enum_declaration(GQuark enum_name,
        g_hash_table_insert(scope->enum_declarations,
                            (gpointer) (unsigned long) enum_name,
                            enum_declaration);
-       declaration_ref(&enum_declaration->p);
+       bt_declaration_ref(&enum_declaration->p);
 
        /* Also add in typedef/typealias scopes */
        prefix_name = prefix_quark("enum ", enum_name);
index 4f1e524ba608b4f0b3853ae7735fa0c2371f914f..4d00a3b3e1f5ebc3231d6c3ca26b876ec471050c 100644 (file)
@@ -63,7 +63,7 @@ void _untagged_variant_declaration_free(struct declaration *declaration)
                struct declaration_field *declaration_field =
                        &g_array_index(untagged_variant_declaration->fields,
                                       struct declaration_field, i);
-               declaration_unref(declaration_field->declaration);
+               bt_declaration_unref(declaration_field->declaration);
        }
        g_array_free(untagged_variant_declaration->fields, true);
        g_free(untagged_variant_declaration);
@@ -98,7 +98,7 @@ void _variant_declaration_free(struct declaration *declaration)
        struct declaration_variant *variant_declaration =
                container_of(declaration, struct declaration_variant, p);
 
-       declaration_unref(&variant_declaration->untagged_variant->p);
+       bt_declaration_unref(&variant_declaration->untagged_variant->p);
        g_array_free(variant_declaration->tag_name, TRUE);
        g_free(variant_declaration);
 }
@@ -112,7 +112,7 @@ struct declaration_variant *
        variant_declaration = g_new(struct declaration_variant, 1);
        declaration = &variant_declaration->p;
        variant_declaration->untagged_variant = untagged_variant;
-       declaration_ref(&untagged_variant->p);
+       bt_declaration_ref(&untagged_variant->p);
        variant_declaration->tag_name = g_array_new(FALSE, TRUE, sizeof(GQuark));
        bt_append_scope_path(tag, variant_declaration->tag_name);
        declaration->id = CTF_TYPE_VARIANT;
@@ -185,7 +185,7 @@ struct definition *
        int ret;
 
        variant = g_new(struct definition_variant, 1);
-       declaration_ref(&variant_declaration->p);
+       bt_declaration_ref(&variant_declaration->p);
        variant->p.declaration = declaration;
        variant->declaration = variant_declaration;
        variant->p.ref = 1;
@@ -233,7 +233,7 @@ struct definition *
        return &variant->p;
 error:
        free_definition_scope(variant->p.scope);
-       declaration_unref(&variant_declaration->p);
+       bt_declaration_unref(&variant_declaration->p);
        g_free(variant);
        return NULL;
 }
@@ -252,7 +252,7 @@ void _variant_definition_free(struct definition *definition)
        }
        definition_unref(variant->enum_tag);
        free_definition_scope(variant->p.scope);
-       declaration_unref(variant->p.declaration);
+       bt_declaration_unref(variant->p.declaration);
        g_ptr_array_free(variant->fields, TRUE);
        g_free(variant);
 }
@@ -268,7 +268,7 @@ void untagged_variant_declaration_add_field(struct declaration_untagged_variant
        index = untagged_variant_declaration->fields->len - 1;  /* last field (new) */
        field = &g_array_index(untagged_variant_declaration->fields, struct declaration_field, index);
        field->name = g_quark_from_string(field_name);
-       declaration_ref(field_declaration);
+       bt_declaration_ref(field_declaration);
        field->declaration = field_declaration;
        /* Keep index in hash rather than pointer, because array can relocate */
        g_hash_table_insert(untagged_variant_declaration->fields_by_tag,
This page took 0.05846 seconds and 4 git commands to generate.