projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Allow NULL (unset) packet, stream and event headers, contexts
[babeltrace.git]
/
formats
/
ctf
/
ir
/
event-class.c
diff --git
a/formats/ctf/ir/event-class.c
b/formats/ctf/ir/event-class.c
index fa5756d65930d1cc90276b97d3b7009b9dd76752..03f20a7e0c506c64cf9016eeabc0ef8986dc7b63 100644
(file)
--- a/
formats/ctf/ir/event-class.c
+++ b/
formats/ctf/ir/event-class.c
@@
-355,16
+355,19
@@
int bt_ctf_event_class_set_payload_type(struct bt_ctf_event_class *event_class,
{
int ret = 0;
{
int ret = 0;
- if (!event_class || !payload ||
- bt_ctf_field_type_get_type_id(payload) !=
- BT_CTF_TYPE_ID_STRUCT) {
+ if (!event_class) {
+ ret = -1;
+ goto end;
+ }
+
+ if (payload && bt_ctf_field_type_get_type_id(payload) !=
+ BT_CTF_TYPE_ID_STRUCT) {
ret = -1;
goto end;
}
ret = -1;
goto end;
}
- bt_get(payload);
bt_put(event_class->fields);
bt_put(event_class->fields);
- event_class->fields =
payload
;
+ event_class->fields =
bt_get(payload)
;
end:
return ret;
}
end:
return ret;
}
@@
-488,19
+491,19
@@
int bt_ctf_event_class_set_context_type(
{
int ret = 0;
{
int ret = 0;
- if (!event_class ||
!context ||
event_class->frozen) {
+ if (!event_class || event_class->frozen) {
ret = -1;
goto end;
}
ret = -1;
goto end;
}
- if (bt_ctf_field_type_get_type_id(context) != BT_CTF_TYPE_ID_STRUCT) {
+ if (context && bt_ctf_field_type_get_type_id(context) !=
+ BT_CTF_TYPE_ID_STRUCT) {
ret = -1;
goto end;
}
ret = -1;
goto end;
}
- bt_get(context);
bt_put(event_class->context);
bt_put(event_class->context);
- event_class->context =
context
;
+ event_class->context =
bt_get(context)
;
end:
return ret;
end:
return ret;
This page took
0.023523 seconds
and
4
git commands to generate.