lib: make graph API const-correct
[babeltrace.git] / plugins / utils / counter / counter.c
index 7bf9b799dd27f9a646fa9734fefa1be1b4e54db7..3b24092c0fe3469aa61a136997db96447477ba0d 100644 (file)
@@ -124,12 +124,13 @@ void counter_finalize(struct bt_self_component_sink *comp)
 BT_HIDDEN
 enum bt_self_component_status counter_init(
                struct bt_self_component_sink *component,
-               struct bt_value *params, UNUSED_VAR void *init_method_data)
+               const struct bt_value *params,
+               UNUSED_VAR void *init_method_data)
 {
        enum bt_self_component_status ret;
        struct counter *counter = g_new0(struct counter, 1);
-       struct bt_value *step = NULL;
-       struct bt_value *hide_zero = NULL;
+       const struct bt_value *step = NULL;
+       const struct bt_value *hide_zero = NULL;
 
        if (!counter) {
                ret = BT_SELF_COMPONENT_STATUS_NOMEM;
@@ -144,7 +145,7 @@ enum bt_self_component_status counter_init(
 
        counter->last_printed_total = -1ULL;
        counter->step = 1000;
-       step = bt_value_map_borrow_entry_value(params, "step");
+       step = bt_value_map_borrow_entry_value_const(params, "step");
        if (step && bt_value_is_integer(step)) {
                int64_t val;
 
@@ -154,7 +155,7 @@ enum bt_self_component_status counter_init(
                }
        }
 
-       hide_zero = bt_value_map_borrow_entry_value(params, "hide-zero");
+       hide_zero = bt_value_map_borrow_entry_value_const(params, "hide-zero");
        if (hide_zero && bt_value_is_bool(hide_zero)) {
                bt_bool val;
 
@@ -178,7 +179,7 @@ BT_HIDDEN
 enum bt_self_component_status counter_port_connected(
                struct bt_self_component_sink *comp,
                struct bt_self_component_port_input *self_port,
-               struct bt_port_output *other_port)
+               const struct bt_port_output *other_port)
 {
        enum bt_self_component_status status = BT_SELF_COMPONENT_STATUS_OK;
        struct counter *counter;
@@ -208,7 +209,7 @@ enum bt_self_component_status counter_consume(
        struct counter *counter;
        enum bt_notification_iterator_status it_ret;
        uint64_t notif_count;
-       bt_notification_array notifs;
+       bt_notification_array_const notifs;
 
        counter = bt_self_component_get_data(
                        bt_self_component_sink_as_self_component(comp));
@@ -234,7 +235,7 @@ enum bt_self_component_status counter_consume(
                uint64_t i;
 
                for (i = 0; i < notif_count; i++) {
-                       struct bt_notification *notif = notifs[i];
+                       const struct bt_notification *notif = notifs[i];
 
                        BT_ASSERT(notif);
                        switch (bt_notification_get_type(notif)) {
This page took 0.024593 seconds and 4 git commands to generate.