text.pretty: fix handle_notification()
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Mon, 24 Apr 2017 18:41:08 +0000 (14:41 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sun, 28 May 2017 16:57:41 +0000 (12:57 -0400)
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
plugins/text/pretty/pretty.c

index 87efe05aa1cb441801b29867389023fe6d237897..21272d41204ac92276e62543d9ff0bc67c9e435b 100644 (file)
@@ -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;
 }
 
This page took 0.025127 seconds and 4 git commands to generate.