bt_ctf_event_set_clock_value() does not need a clock class
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Sat, 4 Feb 2017 08:37:54 +0000 (03:37 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sun, 28 May 2017 16:57:37 +0000 (12:57 -0400)
Since a clock value has a clock class member, and you can
get it with bt_ctf_clock_value_get_class(), it's redundant
to specify both the clock class and the clock value when
you call bt_ctf_event_set_clock_value().

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
formats/ctf/ir/event.c
include/babeltrace/ctf-ir/event.h
plugins/ctf/common/notif-iter/notif-iter.c

index 95168a573ebf60dda718acb71b495785b740a28b..c553f7a707eff35e4d4a024a91128a675583215b 100644 (file)
@@ -582,18 +582,17 @@ end:
 }
 
 int bt_ctf_event_set_clock_value(struct bt_ctf_event *event,
-               struct bt_ctf_clock_class *clock_class,
                struct bt_ctf_clock_value *value)
 {
        int ret = 0;
 
-       if (!event || !clock_class || !value || event->frozen) {
+       if (!event || !value || event->frozen) {
                ret = -1;
                goto end;
        }
 
-       g_hash_table_insert(event->clock_values, bt_get(clock_class),
-               bt_get(value));
+       g_hash_table_insert(event->clock_values,
+               bt_ctf_clock_value_get_class(value), bt_get(value));
 end:
        return ret;
 }
index 7c46d8bb9b58422dad11d0071dc30dbefb720ae4..42d39269b46b68f2593c469ba8ba4b8890151d34 100644 (file)
@@ -540,29 +540,25 @@ extern struct bt_ctf_clock_value *bt_ctf_event_get_clock_value(
 
 /**
 @brief Sets the value, as of the CTF IR event \p event, of the
-       clock described by the
-       \link ctfirclockclass CTF IR clock class\endlink \p clock_class.
+       clock described by its \link ctfirclockclass CTF IR
+       clock class\endlink.
 
 @param[in] event       Event of which to set the value of the clock
-                       described by \p clock_class.
-@param[in] clock_class Class of the clock of which to set the value
-                       for \p event.
-@param[in] clock_value Value of the clock described by \p clock_class
+                       described by the clock class of \p clock_value.
+@param[in] clock_value Value of the clock described by its clock class
                        as of \p event.
 @returns               0 on success, or a negative value on error.
 
 @prenotnull{event}
-@prenotnull{clock_class}
 @prenotnull{clock_value}
 @prehot{event}
 @postrefcountsame{event}
-@postrefcountsame{clock_class}
 
 @sa bt_ctf_event_get_clock_value(): Returns the clock value of
        a given event.
 */
 extern int bt_ctf_event_set_clock_value(
-               struct bt_ctf_event *event, struct bt_ctf_clock_class *clock_class,
+               struct bt_ctf_event *event,
                struct bt_ctf_clock_value *clock_value);
 
 /** @} */
index 44663f7bc38a6a5673a98cc4f98d1b8a76dff798..92de35798f1944a1f2bd693a78bc7e0fe0898712 100644 (file)
@@ -2034,8 +2034,7 @@ int set_event_clocks(struct bt_ctf_event *event,
                        ret = -1;
                        goto end;
                }
-               ret = bt_ctf_event_set_clock_value(event, clock_class,
-                       clock_value);
+               ret = bt_ctf_event_set_clock_value(event, clock_value);
                bt_put(clock_value);
                if (ret) {
                        goto end;
This page took 0.029057 seconds and 4 git commands to generate.