From: Philippe Proulx Date: Mon, 24 Apr 2017 18:41:08 +0000 (-0400) Subject: text.pretty: fix handle_notification() X-Git-Tag: v2.0.0-pre1~358 X-Git-Url: http://git.efficios.com/?a=commitdiff_plain;h=b5e978f421236eab981ab2f4b3c3551ee8a1009a;p=babeltrace.git text.pretty: fix handle_notification() Signed-off-by: Philippe Proulx Signed-off-by: Jérémie Galarneau --- diff --git a/plugins/text/pretty/pretty.c b/plugins/text/pretty/pretty.c index 87efe05a..21272d41 100644 --- a/plugins/text/pretty/pretty.c +++ b/plugins/text/pretty/pretty.c @@ -127,30 +127,12 @@ enum bt_component_status handle_notification(struct pretty_component *pretty, { enum bt_component_status ret = BT_COMPONENT_STATUS_OK; - if (!pretty) { - ret = BT_COMPONENT_STATUS_ERROR; - goto end; - } + assert(pretty); - switch (bt_notification_get_type(notification)) { - case BT_NOTIFICATION_TYPE_PACKET_BEGIN: - break; - case BT_NOTIFICATION_TYPE_PACKET_END: - break; - case BT_NOTIFICATION_TYPE_EVENT: - { + if (bt_notification_get_type(notification) == BT_NOTIFICATION_TYPE_EVENT) { ret = pretty_print_event(pretty, notification); - if (ret != BT_COMPONENT_STATUS_OK) { - goto end; - } - break; } - case BT_NOTIFICATION_TYPE_STREAM_END: - break; - default: - puts("Unhandled notification type"); - } -end: + return ret; }