lib: remove BT_NOTIFICATION_TYPE_{UNKNOWN,NR}
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 30 Nov 2018 22:00:02 +0000 (17:00 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 3 May 2019 22:19:36 +0000 (18:19 -0400)
`BT_NOTIFICATION_TYPE_UNKNOWN` is not needed because we never return it.
`BT_NOTIFICATION_TYPE_NR` is an implementation detail, so we use the
last value instead.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
include/babeltrace/graph/notification-internal.h
include/babeltrace/graph/notification.h
lib/graph/notification/notification.c

index 662ffdeecb01d7d8242318ccb648851fb7a54688..33debfd00c847972b7354e72e6eb5e295cd6d369 100644 (file)
@@ -115,8 +115,6 @@ static inline
 const char *bt_notification_type_string(enum bt_notification_type type)
 {
        switch (type) {
-       case BT_NOTIFICATION_TYPE_UNKNOWN:
-               return "BT_NOTIFICATION_TYPE_UNKNOWN";
        case BT_NOTIFICATION_TYPE_EVENT:
                return "BT_NOTIFICATION_TYPE_EVENT";
        case BT_NOTIFICATION_TYPE_INACTIVITY:
index ba3d23576b1f876ac6b138e796b63e56e18c7a92..658fe0e8c7a5f1909953563d1f2c268c0f1af46b 100644 (file)
@@ -37,14 +37,12 @@ typedef struct bt_notification **bt_notification_array;
  * Notification types. Unhandled notification types should be ignored.
  */
 enum bt_notification_type {
-       BT_NOTIFICATION_TYPE_UNKNOWN =                  -1,
        BT_NOTIFICATION_TYPE_EVENT =                    0,
        BT_NOTIFICATION_TYPE_INACTIVITY =               1,
        BT_NOTIFICATION_TYPE_STREAM_BEGIN =             2,
        BT_NOTIFICATION_TYPE_STREAM_END =               3,
        BT_NOTIFICATION_TYPE_PACKET_BEGIN =             4,
        BT_NOTIFICATION_TYPE_PACKET_END =               5,
-       BT_NOTIFICATION_TYPE_NR, /* Not part of ABI. */
 };
 
 /**
index 2b8c12d77ffcbacd2a503af35dbbc654885ab5ab..5a835092001e48528857b4d46d0b6ae32b5712e5 100644 (file)
@@ -49,7 +49,8 @@ void bt_notification_init(struct bt_notification *notification,
                bt_object_release_func release,
                struct bt_graph *graph)
 {
-       BT_ASSERT(type >= 0 && type < BT_NOTIFICATION_TYPE_NR);
+       BT_ASSERT(type >= 0 &&
+               type <= BT_NOTIFICATION_TYPE_PACKET_END);
        notification->type = type;
        init_seq_num(notification);
        bt_object_init_shared(&notification->base, release);
This page took 0.027672 seconds and 4 git commands to generate.