From b9844fc08537cd512565b08cdc70ca9769c21713 Mon Sep 17 00:00:00 2001 From: Henning Rogge Date: Sat, 22 Aug 2009 22:11:19 +0200 Subject: [PATCH] Change variable names back to old value (were changed during timewarp refactoring) --- lib/txtinfo/src/olsrd_txtinfo.c | 4 ++-- src/build_msg.c | 4 ++-- src/defs.h | 2 +- src/hysteresis.c | 2 +- src/scheduler.c | 32 ++++++++++++++++---------------- src/socket_parser.c | 2 +- 6 files changed, 23 insertions(+), 23 deletions(-) diff --git a/lib/txtinfo/src/olsrd_txtinfo.c b/lib/txtinfo/src/olsrd_txtinfo.c index 50750d68..e552f3a4 100644 --- a/lib/txtinfo/src/olsrd_txtinfo.c +++ b/lib/txtinfo/src/olsrd_txtinfo.c @@ -353,7 +353,7 @@ ipc_print_link(struct autobuf *abuf) /* Link set */ OLSR_FOR_ALL_LINK_ENTRIES(my_link) { #ifdef ACTIVATE_VTIME_TXTINFO - int diff = (unsigned int)(my_link->link_timer->timer_clock - now_times1); + int diff = (unsigned int)(my_link->link_timer->timer_clock - now_times); abuf_appendf(abuf, "%s\t%s\t%d.%03d\t%s\t%s\t\n", olsr_ip_to_string(&buf1, &my_link->local_iface_addr), olsr_ip_to_string(&buf2, &my_link->neighbor_iface_addr), @@ -411,7 +411,7 @@ ipc_print_topology(struct autobuf *abuf) struct ipaddr_str dstbuf, addrbuf; struct lqtextbuffer lqbuffer1, lqbuffer2; #ifdef ACTIVATE_VTIME_TXTINFO - uint32_t vt = tc->validity_timer != NULL ? (tc->validity_timer->timer_clock - now_times1) : 0; + uint32_t vt = tc->validity_timer != NULL ? (tc->validity_timer->timer_clock - now_times) : 0; int diff = (int)(vt); abuf_appendf(abuf, "%s\t%s\t%s\t%s\t%d.%03d\n", olsr_ip_to_string(&dstbuf, &tc_edge->T_dest_addr), olsr_ip_to_string(&addrbuf, &tc->addr), diff --git a/src/build_msg.c b/src/build_msg.c index 9830e106..7a8b42ec 100644 --- a/src/build_msg.c +++ b/src/build_msg.c @@ -650,8 +650,8 @@ serialize_tc4(struct tc_message *message, struct interface *ifp) } else { if ((!partial_sent) && (!TIMED_OUT(send_empty_tc))) { if (!TIMED_OUT(send_empty_tc)) - OLSR_PRINTF(1, "TC: Sending empty package - (%d/%d/%d/%d)\n", partial_sent, (int)send_empty_tc, (int)now_times1, - (int)((send_empty_tc) - now_times1)); + OLSR_PRINTF(1, "TC: Sending empty package - (%d/%d/%d/%d)\n", partial_sent, (int)send_empty_tc, (int)now_times, + (int)((send_empty_tc) - now_times)); m->v4.olsr_msgsize = htons(curr_size); m->v4.seqno = htons(get_msg_seqno()); diff --git a/src/defs.h b/src/defs.h index c9eaa151..d8a7fc60 100644 --- a/src/defs.h +++ b/src/defs.h @@ -182,7 +182,7 @@ strscat(char *dest, const char *src, size_t size) extern struct olsrd_config *olsr_cnf; /* Timer data */ -extern uint32_t now_times1; /* current idea of times(2) reported uptime */ +extern uint32_t now_times; /* current idea of times(2) reported uptime */ #if defined WIN32 extern bool olsr_win32_end_request; diff --git a/src/hysteresis.c b/src/hysteresis.c index 9ae3c231..37e3e804 100644 --- a/src/hysteresis.c +++ b/src/hysteresis.c @@ -83,7 +83,7 @@ olsr_process_hysteresis(struct link_entry *entry) changes_neighborhood = true; /* time = now -1 */ - entry->L_LOST_LINK_time = now_times1 - 1; + entry->L_LOST_LINK_time = now_times - 1; return 1; } diff --git a/src/scheduler.c b/src/scheduler.c index 8159ee3b..657a9cfc 100644 --- a/src/scheduler.c +++ b/src/scheduler.c @@ -58,13 +58,13 @@ #include "olsr_cookie.h" /* Timer data, global. Externed in defs.h */ -uint32_t now_times1; /* relative time compared to startup (in milliseconds */ +uint32_t now_times; /* relative time compared to startup (in milliseconds */ struct timeval first_tv; /* timevalue during startup */ struct timeval last_tv; /* timevalue used for last olsr_times() calculation */ /* Hashed root of all timers */ static struct list_node timer_wheel[TIMER_WHEEL_SLOTS]; -static uint32_t timer_last_run1; /* remember the last timeslot walk */ +static uint32_t timer_last_run; /* remember the last timeslot walk */ /* Pool of timers to avoid malloc() churn */ static struct list_node free_timer_list; @@ -113,7 +113,7 @@ olsr_times(void) uint32_t olsr_getTimestamp(uint32_t s) { - return now_times1 + s; + return now_times + s; } /** @@ -124,8 +124,8 @@ int32_t olsr_getTimeDue(uint32_t s) { uint32_t diff; - if (s > now_times1) { - diff = s - now_times1; + if (s > now_times) { + diff = s - now_times; /* overflow ? */ if (diff > (1u << 31)) { @@ -134,7 +134,7 @@ olsr_getTimeDue(uint32_t s) return (int32_t) (diff); } - diff = now_times1 - s; + diff = now_times - s; /* overflow ? */ if (diff > (1u << 31)) { return (int32_t) (0xffffffff - diff); @@ -145,11 +145,11 @@ olsr_getTimeDue(uint32_t s) bool olsr_isTimedOut(uint32_t s) { - if (s > now_times1) { - return s - now_times1 > (1u << 31); + if (s > now_times) { + return s - now_times > (1u << 31); } - return now_times1 - s <= (1u << 31); + return now_times - s <= (1u << 31); } /** @@ -211,13 +211,13 @@ olsr_scheduler(void) * Update the global timestamp. We are using a non-wallclock timer here * to avoid any undesired side effects if the system clock changes. */ - now_times1 = olsr_times(); + now_times = olsr_times(); /* Read incoming data */ olsr_poll_sockets(); /* Process timers (before packet generation) */ - olsr_walk_timers(&timer_last_run1); + olsr_walk_timers(&timer_last_run); /* Update */ olsr_process_changes(); @@ -237,7 +237,7 @@ olsr_scheduler(void) } /* We are done, sleep until the next scheduling interval. */ - olsr_scheduler_sleep(olsr_times() - now_times1); + olsr_scheduler_sleep(olsr_times() - now_times); #if defined WIN32 /* The Ctrl-C signal handler thread asks us to exit */ @@ -380,14 +380,14 @@ olsr_init_timers(void) /* * Reset the last timer run. */ - timer_last_run1 = now_times1; + timer_last_run = now_times; if (gettimeofday(&first_tv, NULL)) { OLSR_PRINTF(0, "OS clock is not working, have to shut down OLSR (%d)\n", errno); exit(1); } last_tv = first_tv; - now_times1 = olsr_times(); + now_times = olsr_times(); /* Timer memory pooling */ list_head_init(&free_timer_list); @@ -414,7 +414,7 @@ olsr_walk_timers(uint32_t * last_run) * The latter is meant as a safety belt if the scheduler falls behind. */ total_timers_walked = total_timers_fired = timers_walked = timers_fired = 0; - while ((*last_run <= now_times1) && (wheel_slot_walks < TIMER_WHEEL_SLOTS)) { + while ((*last_run <= now_times) && (wheel_slot_walks < TIMER_WHEEL_SLOTS)) { /* keep some statistics */ total_timers_walked += timers_walked; @@ -497,7 +497,7 @@ olsr_walk_timers(uint32_t * last_run) * If the scheduler has slipped and we have walked all wheel slots, * reset the last timer run. */ - *last_run = now_times1; + *last_run = now_times; } /** diff --git a/src/socket_parser.c b/src/socket_parser.c index e0c850c0..f3aa8de0 100644 --- a/src/socket_parser.c +++ b/src/socket_parser.c @@ -180,7 +180,7 @@ olsr_poll_sockets(void) } /* Update time since this is much used by the parsing functions */ - now_times1 = olsr_times(); + now_times = olsr_times(); for (olsr_sockets = olsr_socket_entries; olsr_sockets; olsr_sockets = olsr_sockets->next) { if (FD_ISSET(olsr_sockets->fd, &ibits)) -- 2.20.1