Browse Source

MT#55283 obsolete timeval_cmp

Change-Id: I824ea19696e690afdbb21346f75ca16a6410b56b
pull/1938/head
Richard Fuchs 8 months ago
parent
commit
2a6853c219
2 changed files with 5 additions and 12 deletions
  1. +2
    -2
      daemon/ice.c
  2. +3
    -10
      lib/auxlib.h

+ 2
- 2
daemon/ice.c View File

@ -839,7 +839,7 @@ static void __do_ice_checks(struct ice_agent *ag) {
if (AGENT_ISSET(ag, CONTROLLING) && !AGENT_ISSET(ag, NOMINATING) && ag->start_nominating) {
if (rtpe_now >= ag->start_nominating)
__nominate_pairs(ag);
next_run = timeval_us(timeval_lowest(timeval_from_us(next_run), timeval_from_us(ag->start_nominating)));
next_run = timeval_lowest(next_run, ag->start_nominating);
}
/* triggered checks are preferred */
@ -878,7 +878,7 @@ static void __do_ice_checks(struct ice_agent *ag) {
g_queue_push_tail(&retransmits, pair); /* can't run check directly
due to locks */
else
next_run = timeval_us(timeval_lowest(timeval_from_us(next_run), timeval_from_us(pair->retransmit)));
next_run = timeval_lowest(next_run, pair->retransmit);
continue;
}


+ 3
- 10
lib/auxlib.h View File

@ -386,19 +386,12 @@ INLINE int long_cmp(long long a, long long b) {
return -1;
return 1;
}
__attribute__((warn_unused_result))
INLINE int timeval_cmp(const struct timeval a, const struct timeval b) {
int r = long_cmp(a.tv_sec, b.tv_sec);
if (r != 0)
return r;
return long_cmp(a.tv_usec, b.tv_usec);
}
__attribute__((warn_unused_result))
INLINE struct timeval timeval_lowest(const struct timeval l, const struct timeval n) {
if (!n.tv_sec)
INLINE int64_t timeval_lowest(const int64_t l, const int64_t n) {
if (!n)
return l;
if (!l.tv_sec || timeval_cmp(l, n) == 1)
if (!l || l > n)
return n;
return l;
}


Loading…
Cancel
Save