static
int is_align_valid(uint64_t align)
{
- return (align != 0) && !(align & (align - 1));
+ return (align != 0) && !(align & (align - 1ULL));
}
static
/* Do not allow typedef and typealias of untagged variants */
if (bt_ctf_field_type_is_variant(type_decl)) {
if (bt_ctf_field_type_variant_get_tag_name(type_decl)) {
- _BT_LOGE_NODE(node,
+ _BT_LOGE_NODE(target,
"Type definition of untagged variant field type is not allowed.");
ret = -EPERM;
goto end;
* abstract or not (if it has an identifier). Check it here.
*/
if (qdummy_field_name != 0) {
- _BT_LOGE_NODE(node,
+ _BT_LOGE_NODE(target,
"Expecting empty identifier: id=\"%s\"",
g_quark_to_string(qdummy_field_name));
ret = -EINVAL;
switch (stream_class_count) {
case 0:
/* Create implicit stream class if there's none */
+ stream_id = 0;
new_stream_class = create_reset_stream_class(ctx);
if (!new_stream_class) {
_BT_LOGE_NODE(node,
goto error;
}
- ret = bt_ctf_stream_class_set_id(new_stream_class, 0);
+ ret = bt_ctf_stream_class_set_id(new_stream_class,
+ stream_id);
if (ret) {
_BT_LOGE_NODE(node,
"Cannot set stream class's ID: "
goto error;
}
+ *new_stream_id = stream_id;
+
/* Move reference to visitor's context */
g_hash_table_insert(ctx->stream_classes,
new_stream_id, new_stream_class);