projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Cleanup: lift function call outside of condition
[babeltrace.git]
/
formats
/
ctf
/
ir
/
clock.c
diff --git
a/formats/ctf/ir/clock.c
b/formats/ctf/ir/clock.c
index 253b033da398f50ebada3c851c08ef5a2e369959..9256bc1f26f58ef5cb4f04a8ca9a92d32dc364e7 100644
(file)
--- a/
formats/ctf/ir/clock.c
+++ b/
formats/ctf/ir/clock.c
@@
-365,6
+365,7
@@
end:
int bt_ctf_clock_set_time(struct bt_ctf_clock *clock, int64_t time)
{
int ret = 0;
int bt_ctf_clock_set_time(struct bt_ctf_clock *clock, int64_t time)
{
int ret = 0;
+ int64_t value;
/* Timestamps are strictly monotonic */
if (!clock) {
/* Timestamps are strictly monotonic */
if (!clock) {
@@
-384,13
+385,13
@@
int bt_ctf_clock_set_time(struct bt_ctf_clock *clock, int64_t time)
/* Common case where cycles are actually nanoseconds */
if (clock->frequency == 1000000000) {
/* Common case where cycles are actually nanoseconds */
if (clock->frequency == 1000000000) {
- clock->value = time;
- goto end;
+ value = time;
+ } else {
+ value = (uint64_t) (((double) time *
+ (double) clock->frequency) / 1e9);
}
}
- ret = bt_ctf_clock_set_value(clock,
- (uint64_t) (((double) time * (double) clock->frequency) / 1e9));
-
+ ret = bt_ctf_clock_set_value(clock, value);
end:
return ret;
}
end:
return ret;
}
This page took
0.024392 seconds
and
4
git commands to generate.