X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=formats%2Fctf%2Fir%2Fstream.c;h=d4dbc447ca6a6b1fe16d6004c90e408c97f1ee61;hb=835b2d10c5c80ebad6427ba3794d712dd44ef145;hp=8c5a9877fb3dceae1aadf01aae9476a868d93a0a;hpb=c44c3e709f9e95a847e9502c5297234aa1f01577;p=babeltrace.git diff --git a/formats/ctf/ir/stream.c b/formats/ctf/ir/stream.c index 8c5a9877..d4dbc447 100644 --- a/formats/ctf/ir/stream.c +++ b/formats/ctf/ir/stream.c @@ -61,7 +61,7 @@ int set_packet_header_magic(struct bt_ctf_stream *stream) goto end; } - if (!bt_ctf_field_validate(magic_field)) { + if (bt_ctf_field_is_set(magic_field)) { /* Value already set. Not an error, skip. */ goto end; } @@ -113,7 +113,7 @@ int set_packet_header_uuid(struct bt_ctf_stream *stream) goto end; } - if (!bt_ctf_field_validate(uuid_field)) { + if (bt_ctf_field_is_set(uuid_field)) { /* Value already set. Not an error, skip. */ goto end; } @@ -186,7 +186,7 @@ int set_packet_header_stream_id(struct bt_ctf_stream *stream) goto end; } - if (!bt_ctf_field_validate(stream_id_field)) { + if (bt_ctf_field_is_set(stream_id_field)) { /* Value already set. Not an error, skip. */ goto end; } @@ -636,7 +636,7 @@ int bt_ctf_stream_set_packet_context(struct bt_ctf_stream *stream, int ret = 0; struct bt_ctf_field_type *field_type; - if (!stream || !field || stream->pos.fd < 0) { + if (!stream || stream->pos.fd < 0) { ret = -1; goto end; } @@ -649,9 +649,8 @@ int bt_ctf_stream_set_packet_context(struct bt_ctf_stream *stream, } bt_put(field_type); - bt_get(field); bt_put(stream->packet_context); - stream->packet_context = field; + stream->packet_context = bt_get(field); end: return ret; } @@ -680,7 +679,7 @@ int bt_ctf_stream_set_packet_header(struct bt_ctf_stream *stream, struct bt_ctf_trace *trace = NULL; struct bt_ctf_field_type *field_type = NULL; - if (!stream || !field || stream->pos.fd < 0) { + if (!stream || stream->pos.fd < 0) { ret = -1; goto end; } @@ -692,9 +691,8 @@ int bt_ctf_stream_set_packet_header(struct bt_ctf_stream *stream, goto end; } - bt_get(field); bt_put(stream->packet_header); - stream->packet_header = field; + stream->packet_header = bt_get(field); end: BT_PUT(trace); bt_put(field_type); @@ -959,7 +957,7 @@ int set_structure_field_integer(struct bt_ctf_field *structure, char *name, } /* Make sure the payload has not already been set. */ - if (!bt_ctf_field_validate(integer)) { + if (bt_ctf_field_is_set(integer)) { /* Payload already set, not an error */ goto end; }