From 936db7bca3636daada9bbb6f9dea0dbff800412a Mon Sep 17 00:00:00 2001 From: Andrew Bettison Date: Wed, 7 May 2014 11:11:04 +0930 Subject: [PATCH] Rename TIME_NEVER... to TIME_MS_NEVER... --- fdqueue.c | 2 +- msp_client.c | 10 +++++----- os.h | 4 ++-- route_link.c | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/fdqueue.c b/fdqueue.c index a78967f6..d0127dc1 100644 --- a/fdqueue.c +++ b/fdqueue.c @@ -133,7 +133,7 @@ int _schedule(struct __sourceloc __whence, struct sched_ent *alarm) return WHY("Can't schedule if you haven't set the function pointer"); // don't bother to schedule an alarm that will (by definition) never run - if (alarm->alarm == TIME_NEVER_WILL) + if (alarm->alarm == TIME_MS_NEVER_WILL) return 0; if (alarm->deadline < alarm->alarm) diff --git a/msp_client.c b/msp_client.c index b68d5b98..8867fc13 100644 --- a/msp_client.c +++ b/msp_client.c @@ -78,9 +78,9 @@ struct msp_sock * msp_socket(int mdp_sock) ret->_next = root; // TODO set base rtt to ensure that we send the first packet a few times before giving up ret->tx.base_rtt = ret->tx.rtt = 0xFFFFFFFF; - ret->tx.last_activity = TIME_NEVER_HAS; - ret->rx.last_activity = TIME_NEVER_HAS; - ret->next_action = TIME_NEVER_WILL; + ret->tx.last_activity = TIME_MS_NEVER_HAS; + ret->rx.last_activity = TIME_MS_NEVER_HAS; + ret->next_action = TIME_MS_NEVER_WILL; ret->timeout = gettime_ms() + 10000; ret->previous_ack = 0x7FFF; if (root) @@ -552,7 +552,7 @@ static int process_sock(struct msp_sock *sock) int msp_processing(time_ms_t *next_action) { - *next_action=TIME_NEVER_WILL; + *next_action=TIME_MS_NEVER_WILL; struct msp_sock *sock = root; time_ms_t now = gettime_ms(); while(sock){ @@ -602,7 +602,7 @@ static int process_packet(int mdp_sock, struct mdp_header *header, const uint8_t DEBUGF("Bound to %s:%d", alloca_tohex_sid_t(header->local.sid), header->local.port); s->next_action = gettime_ms(); if (s->state & MSP_STATE_LISTENING) - s->timeout = TIME_NEVER_WILL; + s->timeout = TIME_MS_NEVER_WILL; return 0; } diff --git a/os.h b/os.h index 4154e41e..86c59c3d 100644 --- a/os.h +++ b/os.h @@ -56,8 +56,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ typedef int64_t time_ms_t; #define PRItime_ms_t PRId64 -#define TIME_NEVER_WILL INT64_MAX -#define TIME_NEVER_HAS INT64_MIN +#define TIME_MS_NEVER_WILL INT64_MAX +#define TIME_MS_NEVER_HAS INT64_MIN time_ms_t gettime_ms(); time_ms_t sleep_ms(time_ms_t milliseconds); diff --git a/route_link.c b/route_link.c index 9568d5d6..7af3258f 100644 --- a/route_link.c +++ b/route_link.c @@ -171,7 +171,7 @@ static struct profile_total link_send_stats={ static struct sched_ent link_send_alarm={ .function = link_send, .stats = &link_send_stats, - .alarm = TIME_NEVER_WILL, + .alarm = TIME_MS_NEVER_WILL, }; struct neighbour *neighbours=NULL; @@ -185,7 +185,7 @@ struct network_destination * new_destination(struct overlay_interface *interface ret->encapsulation = encapsulation; ret->interface = interface; ret->resend_delay = 1000; - ret->last_tx = TIME_NEVER_HAS; + ret->last_tx = TIME_MS_NEVER_HAS; ret->sequence_number = -1; ret->last_ack_seq = -1; } @@ -882,7 +882,7 @@ static int link_send_neighbours() // send link details static void link_send(struct sched_ent *alarm) { - alarm->alarm=TIME_NEVER_WILL; + alarm->alarm=TIME_MS_NEVER_WILL; // TODO use a separate alarm link_send_neighbours();