namespace definition_ref and definition_unref
authorJulien Desfossez <jdesfossez@efficios.com>
Thu, 24 Jan 2013 22:22:14 +0000 (17:22 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 24 Jan 2013 22:22:43 +0000 (17:22 -0500)
Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
formats/ctf/ctf.c
formats/ctf/metadata/ctf-visitor-generate-io-struct.c
formats/ctf/types/float.c
include/babeltrace/types.h
types/enum.c
types/float.c
types/sequence.c
types/struct.c
types/types.c
types/variant.c

index e18fffb1fa43030bb725f62cca380c8f51748f69..6a24087447b6fb5738f643ef6f24f51df0211904 100644 (file)
@@ -1168,9 +1168,9 @@ struct ctf_event_definition *create_event_definitions(struct ctf_trace *td,
 
 error:
        if (stream_event->event_fields)
-               definition_unref(&stream_event->event_fields->p);
+               bt_definition_unref(&stream_event->event_fields->p);
        if (stream_event->event_context)
-               definition_unref(&stream_event->event_context->p);
+               bt_definition_unref(&stream_event->event_context->p);
        return NULL;
 }
 
@@ -1246,11 +1246,11 @@ error_event:
        g_ptr_array_free(stream->events_by_id, TRUE);
 error:
        if (stream->stream_event_context)
-               definition_unref(&stream->stream_event_context->p);
+               bt_definition_unref(&stream->stream_event_context->p);
        if (stream->stream_event_header)
-               definition_unref(&stream->stream_event_header->p);
+               bt_definition_unref(&stream->stream_event_header->p);
        if (stream->stream_packet_context)
-               definition_unref(&stream->stream_packet_context->p);
+               bt_definition_unref(&stream->stream_packet_context->p);
        return ret;
 }
 
@@ -1572,7 +1572,7 @@ int ctf_open_file_stream_read(struct ctf_trace *td, const char *path, int flags,
 
 error_index:
        if (file_stream->parent.trace_packet_header)
-               definition_unref(&file_stream->parent.trace_packet_header->p);
+               bt_definition_unref(&file_stream->parent.trace_packet_header->p);
 error_def:
        closeret = ctf_fini_pos(&file_stream->pos);
        if (closeret) {
@@ -1811,7 +1811,7 @@ int ctf_open_mmap_stream_read(struct ctf_trace *td,
 
 error_index:
        if (file_stream->parent.trace_packet_header)
-               definition_unref(&file_stream->parent.trace_packet_header->p);
+               bt_definition_unref(&file_stream->parent.trace_packet_header->p);
 error_def:
        g_free(file_stream);
        return ret;
index 9693345649b5d68e6f9c437a1480baba41919960..9ade8c48fd679dcb1ec094a26604065cb7322301 100644 (file)
@@ -3004,19 +3004,19 @@ int ctf_destroy_metadata(struct ctf_trace *trace)
                                        if (!event)
                                                continue;
                                        if (&event->event_fields->p)
-                                               definition_unref(&event->event_fields->p);
+                                               bt_definition_unref(&event->event_fields->p);
                                        if (&event->event_context->p)
-                                               definition_unref(&event->event_context->p);
+                                               bt_definition_unref(&event->event_context->p);
                                        g_free(event);
                                }
                                if (&stream_def->trace_packet_header->p)
-                                       definition_unref(&stream_def->trace_packet_header->p);
+                                       bt_definition_unref(&stream_def->trace_packet_header->p);
                                if (&stream_def->stream_event_header->p)
-                                       definition_unref(&stream_def->stream_event_header->p);
+                                       bt_definition_unref(&stream_def->stream_event_header->p);
                                if (&stream_def->stream_packet_context->p)
-                                       definition_unref(&stream_def->stream_packet_context->p);
+                                       bt_definition_unref(&stream_def->stream_packet_context->p);
                                if (&stream_def->stream_event_context->p)
-                                       definition_unref(&stream_def->stream_event_context->p);
+                                       bt_definition_unref(&stream_def->stream_event_context->p);
                                g_ptr_array_free(stream_def->events_by_id, TRUE);
                                g_free(stream_def);
                        }
index d77cff53bea6676d9d3618366f0218f8beb93e54..fc7c39c1b412f794151ae34cc6678489dc543d07 100644 (file)
@@ -216,7 +216,7 @@ int ctf_float_read(struct stream_pos *ppos, struct definition *definition)
        }
 
 end_unref:
-       definition_unref(tmpdef);
+       bt_definition_unref(tmpdef);
 end:
        float_unlock();
        return ret;
@@ -272,7 +272,7 @@ int ctf_float_write(struct stream_pos *ppos, struct definition *definition)
        ret = _ctf_float_copy(ppos, float_definition, &srcp.parent, tmpfloat);
 
 end_unref:
-       definition_unref(tmpdef);
+       bt_definition_unref(tmpdef);
 end:
        float_unlock();
        return ret;
index 2348823f65b47dbaa6afea95f780d5b8561a5eff..1b0cd2bd35524f7e207ffcd0a49adc22f75c5ccc 100644 (file)
@@ -367,8 +367,8 @@ int compare_definition_path(struct definition *definition, GQuark path)
 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);
+void bt_definition_ref(struct definition *definition);
+void bt_definition_unref(struct definition *definition);
 
 struct declaration_integer *integer_declaration_new(size_t len, int byte_order,
                                  int signedness, size_t alignment,
index 2ea40ba482449885355ae3dd95f30476e6dc8cb6..43df4eb4098326819c4f0a298ae523b90e1afa35 100644 (file)
@@ -461,7 +461,7 @@ void _enum_definition_free(struct definition *definition)
        struct definition_enum *_enum =
                container_of(definition, struct definition_enum, p);
 
-       definition_unref(&_enum->integer->p);
+       bt_definition_unref(&_enum->integer->p);
        free_definition_scope(_enum->p.scope);
        bt_declaration_unref(_enum->p.declaration);
        if (_enum->value)
index 5c80312d457a191dbfa66b07c41e84922ffcaeae..0fc137f7522b1e8c51d38db2b7ae0a40a682f940 100644 (file)
@@ -143,9 +143,9 @@ void _float_definition_free(struct definition *definition)
        struct definition_float *_float =
                container_of(definition, struct definition_float, p);
 
-       definition_unref(&_float->sign->p);
-       definition_unref(&_float->exp->p);
-       definition_unref(&_float->mantissa->p);
+       bt_definition_unref(&_float->sign->p);
+       bt_definition_unref(&_float->exp->p);
+       bt_definition_unref(&_float->mantissa->p);
        free_definition_scope(_float->p.scope);
        bt_declaration_unref(_float->p.declaration);
        g_free(_float);
index 18d7e350abbb3b69273fddd937e1a3a30b63d17d..736e866439bfbcf90b17df5be9a6ffe000da2eec 100644 (file)
@@ -166,7 +166,7 @@ struct definition *_sequence_definition_new(struct declaration *declaration,
                printf("[error] Sequence length field should be unsigned.\n");
                goto error;
        }
-       definition_ref(len_parent);
+       bt_definition_ref(len_parent);
 
        sequence->string = NULL;
        sequence->elems = NULL;
@@ -216,7 +216,7 @@ void _sequence_definition_free(struct definition *definition)
                }
                (void) g_ptr_array_free(sequence->elems, TRUE);
        }
-       definition_unref(len_definition);
+       bt_definition_unref(len_definition);
        free_definition_scope(sequence->p.scope);
        bt_declaration_unref(sequence->p.declaration);
        g_free(sequence);
index 5cc0849f55cdc344690161f1d130120996b37485..cf8fef6bd6812306d69985dc43efe26194c7deeb 100644 (file)
@@ -155,7 +155,7 @@ struct definition *
 error:
        for (i--; i >= 0; i--) {
                struct definition *field = g_ptr_array_index(_struct->fields, i);
-               definition_unref(field);
+               bt_definition_unref(field);
        }
        free_definition_scope(_struct->p.scope);
        bt_declaration_unref(&struct_declaration->p);
@@ -173,7 +173,7 @@ void _struct_definition_free(struct definition *definition)
        assert(_struct->fields->len == _struct->declaration->fields->len);
        for (i = 0; i < _struct->fields->len; i++) {
                struct definition *field = g_ptr_array_index(_struct->fields, i);
-               definition_unref(field);
+               bt_definition_unref(field);
        }
        free_definition_scope(_struct->p.scope);
        bt_declaration_unref(_struct->p.declaration);
index 5bb051f5bf1b0f593162a3f6e8fe727d05be2e28..a6c8abe6e2c5ce642090118ef6cbc99b516b87d7 100644 (file)
@@ -292,12 +292,12 @@ void bt_declaration_unref(struct declaration *declaration)
                declaration->declaration_free(declaration);
 }
 
-void definition_ref(struct definition *definition)
+void bt_definition_ref(struct definition *definition)
 {
        definition->ref++;
 }
 
-void definition_unref(struct definition *definition)
+void bt_definition_unref(struct definition *definition)
 {
        if (!definition)
                return;
index 4d00a3b3e1f5ebc3231d6c3ca26b876ec471050c..a58c17ffab5ec2a498855cf6c67a609f5c26ec73 100644 (file)
@@ -209,7 +209,7 @@ struct definition *
        if (!variant->enum_tag
            || check_enum_tag(variant, variant->enum_tag) < 0)
                goto error;
-       definition_ref(variant->enum_tag);
+       bt_definition_ref(variant->enum_tag);
        variant->fields = g_ptr_array_sized_new(variant_declaration->untagged_variant->fields->len);
        g_ptr_array_set_size(variant->fields, variant_declaration->untagged_variant->fields->len);
        for (i = 0; i < variant_declaration->untagged_variant->fields->len; i++) {
@@ -248,9 +248,9 @@ void _variant_definition_free(struct definition *definition)
        assert(variant->fields->len == variant->declaration->untagged_variant->fields->len);
        for (i = 0; i < variant->fields->len; i++) {
                struct definition *field = g_ptr_array_index(variant->fields, i);
-               definition_unref(field);
+               bt_definition_unref(field);
        }
-       definition_unref(variant->enum_tag);
+       bt_definition_unref(variant->enum_tag);
        free_definition_scope(variant->p.scope);
        bt_declaration_unref(variant->p.declaration);
        g_ptr_array_free(variant->fields, TRUE);
This page took 0.046383 seconds and 4 git commands to generate.