ir: do not create empty structure for optional scope field types
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 1 Jun 2017 21:05:11 +0000 (17:05 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 9 Jun 2017 20:58:14 +0000 (16:58 -0400)
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
lib/ctf-ir/event-class.c
lib/ctf-ir/stream-class.c
lib/ctf-ir/trace.c

index 3fc60603103bdda8f4d63e7aaf732b8c294fdbb0..9f82e176dcd286f0a6cf4f7aa20d1ac0ce45043d 100644 (file)
@@ -79,12 +79,6 @@ struct bt_ctf_event_class *bt_ctf_event_class_create(const char *name)
                goto error;
        }
 
-       event_class->context = bt_ctf_field_type_structure_create();
-       if (!event_class->context) {
-               BT_LOGE_STR("Cannot create event class's initial context field type object.");
-               goto error;
-       }
-
        event_class->attributes = bt_ctf_attributes_create();
        if (!event_class->attributes) {
                BT_LOGE_STR("Cannot create event class's attributes object.");
index a9f1c12a01cb88d184a771766b62e99b24093d4d..52be6fcda02e4eb7c12a6192b7a31ed98b2fe621 100644 (file)
@@ -124,24 +124,6 @@ struct bt_ctf_stream_class *bt_ctf_stream_class_create_empty(const char *name)
                goto error;
        }
 
-       stream_class->packet_context_type = bt_ctf_field_type_structure_create();
-       if (!stream_class->packet_context_type) {
-               BT_LOGE_STR("Cannot create stream class's initial packet context field type.");
-               goto error;
-       }
-
-       stream_class->event_header_type = bt_ctf_field_type_structure_create();
-       if (!stream_class->event_header_type) {
-               BT_LOGE_STR("Cannot create stream class's initial event header field type.");
-               goto error;
-       }
-
-       stream_class->event_context_type = bt_ctf_field_type_structure_create();
-       if (!stream_class->event_context_type) {
-               BT_LOGE_STR("Cannot create stream class's initial event context field type.");
-               goto error;
-       }
-
        bt_object_init(stream_class, bt_ctf_stream_class_destroy);
        BT_LOGD("Created empty stream class object: addr=%p, name=\"%s\"",
                stream_class, name);
index 6515dfe8ceb3387eadf957baafe21d954bf29c40..34b459df7137cc1b23e4592bcf9fad1cf67d197d 100644 (file)
@@ -93,7 +93,6 @@ const unsigned int field_type_aliases_sizes[] = {
 struct bt_ctf_trace *bt_ctf_trace_create(void)
 {
        struct bt_ctf_trace *trace = NULL;
-       struct bt_ctf_field_type *packet_header_type = NULL;
 
        trace = g_new0(struct bt_ctf_trace, 1);
        if (!trace) {
@@ -125,13 +124,6 @@ struct bt_ctf_trace *bt_ctf_trace_create(void)
                goto error;
        }
 
-       packet_header_type = bt_ctf_field_type_structure_create();
-       if (!packet_header_type) {
-               goto error;
-       }
-
-       BT_MOVE(trace->packet_header_type, packet_header_type);
-
        /* Create the environment array object */
        trace->environment = bt_ctf_attributes_create();
        if (!trace->environment) {
@@ -158,7 +150,6 @@ struct bt_ctf_trace *bt_ctf_trace_create(void)
 
 error:
        BT_PUT(trace);
-       bt_put(packet_header_type);
        return trace;
 }
 
This page took 0.028072 seconds and 4 git commands to generate.