lib: make graph API const-correct
[babeltrace.git] / lib / graph / notification / notification.c
index 0bcfb7dfbdacf225ba6f6898b1d105f5aba6f8e3..3a6090b9265cabc453e38c7629b7c1d9b78702e4 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * Babeltrace Plug-in Notification
- *
  * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
  *
  * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
@@ -27,6 +25,7 @@
 #define BT_LOG_TAG "NOTIF"
 #include <babeltrace/lib-logging-internal.h>
 
+#include <babeltrace/graph/notification-const.h>
 #include <babeltrace/graph/notification-internal.h>
 #include <babeltrace/graph/graph-internal.h>
 #include <babeltrace/assert-internal.h>
@@ -50,10 +49,11 @@ 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(&notification->base, release);
+       bt_object_init_shared(&notification->base, release);
        notification->graph = graph;
 
        if (graph) {
@@ -62,7 +62,7 @@ void bt_notification_init(struct bt_notification *notification,
 }
 
 enum bt_notification_type bt_notification_get_type(
-               struct bt_notification *notification)
+               const struct bt_notification *notification)
 {
        BT_ASSERT_PRE_NON_NULL(notification, "Notification");
        return notification->type;
This page took 0.024694 seconds and 4 git commands to generate.