Commit b2aa9f8c authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Rename timeval_plus_msec to timeval_add_msec.

Stress the asymmetry with timeval_add_msec, which is purely functional.
parent d981759f
......@@ -818,7 +818,7 @@ schedule_neighbours_check(int msecs, int override)
{
struct timeval timeout;
timeval_plus_msec(&timeout, &now, roughly(msecs * 3 / 2));
timeval_add_msec(&timeout, &now, roughly(msecs * 3 / 2));
if(override)
check_neighbours_timeout = timeout;
else
......
......@@ -121,7 +121,7 @@ update_neighbour(struct neighbour *neigh, int hello, int hello_interval)
(neigh->hello_interval * 10);
if(missed_hellos <= 0)
return rc;
timeval_plus_msec(&neigh->hello_time, &neigh->hello_time,
timeval_add_msec(&neigh->hello_time, &neigh->hello_time,
missed_hellos * neigh->hello_interval * 10);
} else {
if(neigh->hello_seqno >= 0 && neigh->reach > 0) {
......
......@@ -147,7 +147,7 @@ update_jitter(struct network *net, int urgent)
void
delay_jitter(struct timeval *timeout, int msecs)
{
timeval_plus_msec(timeout, &now, roughly(msecs));
timeval_add_msec(timeout, &now, roughly(msecs));
}
static int
......
......@@ -138,7 +138,7 @@ record_resend(int kind, const unsigned char *prefix, unsigned char plen,
if(resend->delay) {
struct timeval timeout;
timeval_plus_msec(&timeout, &resend->time, resend->delay);
timeval_add_msec(&timeout, &resend->time, resend->delay);
timeval_min(&resend_time, &timeout);
}
return 1;
......@@ -268,7 +268,7 @@ recompute_resend_time()
while(request) {
if(!resend_expired(request) && request->delay > 0 && request->max > 0) {
struct timeval timeout;
timeval_plus_msec(&timeout, &request->time, request->delay);
timeval_add_msec(&timeout, &request->time, request->delay);
timeval_min(&resend, &timeout);
}
request = request->next;
......@@ -286,7 +286,7 @@ do_resend()
while(resend) {
if(!resend_expired(resend) && resend->delay > 0 && resend->max > 0) {
struct timeval timeout;
timeval_plus_msec(&timeout, &resend->time, resend->delay);
timeval_add_msec(&timeout, &resend->time, resend->delay);
if(timeval_compare(&now, &timeout) >= 0) {
switch(resend->kind) {
case RESEND_REQUEST:
......
......@@ -77,7 +77,7 @@ timeval_minus_msec(const struct timeval *s1, const struct timeval *s2)
}
void
timeval_plus_msec(struct timeval *d, const struct timeval *s, int msecs)
timeval_add_msec(struct timeval *d, const struct timeval *s, int msecs)
{
int usecs;
d->tv_sec = s->tv_sec + msecs / 1000;
......
......@@ -71,8 +71,8 @@ void timeval_minus(struct timeval *d,
const struct timeval *s1, const struct timeval *s2);
unsigned timeval_minus_msec(const struct timeval *s1, const struct timeval *s2)
ATTRIBUTE ((pure));
void timeval_plus_msec(struct timeval *d,
const struct timeval *s, int msecs);
void timeval_add_msec(struct timeval *d,
const struct timeval *s, int msecs);
int timeval_compare(const struct timeval *s1, const struct timeval *s2)
ATTRIBUTE ((pure));
void timeval_min(struct timeval *d, const struct timeval *s);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment