From: Philippe Proulx Date: Fri, 30 Nov 2018 22:00:02 +0000 (-0500) Subject: lib: remove BT_NOTIFICATION_TYPE_{UNKNOWN,NR} X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=56a092f550dc7a9b6de7fd8ecf0fff30825a2177;p=deliverable%2Fbabeltrace.git lib: remove BT_NOTIFICATION_TYPE_{UNKNOWN,NR} `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 --- diff --git a/include/babeltrace/graph/notification-internal.h b/include/babeltrace/graph/notification-internal.h index 662ffdeec..33debfd00 100644 --- a/include/babeltrace/graph/notification-internal.h +++ b/include/babeltrace/graph/notification-internal.h @@ -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: diff --git a/include/babeltrace/graph/notification.h b/include/babeltrace/graph/notification.h index ba3d23576..658fe0e8c 100644 --- a/include/babeltrace/graph/notification.h +++ b/include/babeltrace/graph/notification.h @@ -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. */ }; /** diff --git a/lib/graph/notification/notification.c b/lib/graph/notification/notification.c index 2b8c12d77..5a8350920 100644 --- a/lib/graph/notification/notification.c +++ b/lib/graph/notification/notification.c @@ -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(¬ification->base, release);