From 2dbe69d18c9db3783f848cede6585d54fb18eab2 Mon Sep 17 00:00:00 2001 From: "7u83@mail.ru" <7u83@mail.ru@noemail.net> Date: Fri, 1 May 2015 18:44:18 +0000 Subject: [PATCH] Indentation + some comments. FossilOrigin-Name: 49d9359ce17bafbbe7e511cb9cc9f3ed014e621df6df3c4c3d81f58d0a400fd7 --- src/capwap/timer.h | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/capwap/timer.h b/src/capwap/timer.h index 3e1ed7e7..de05be5c 100644 --- a/src/capwap/timer.h +++ b/src/capwap/timer.h @@ -29,7 +29,7 @@ */ /** - * CAPWAP timer type, used in #cw_timer_start and #cw_timer_timeout. + * CAPWAP timer type, used in conjunction with #cw_timer_start and #cw_timer_timeout. */ typedef time_t cw_timer_t; @@ -50,7 +50,9 @@ typedef time_t cw_timer_t; */ #define cw_timer_timeout(t) (time(NULL)>t ? 1 : 0) - +/** + * Get the number of nano seconds from a timeval. + */ #define cw_timevaltodouble(tv) \ (( ((1000000.0)*(double)((tv)->tv_sec) + (double)(tv)->tv_usec)) ) @@ -60,31 +62,32 @@ typedef time_t cw_timer_t; * and #cw_clock_lap. * * @param c name of the variable - */ + */ #define CLOCK_DEFINE(c)\ - struct timeval c; + struct timeval c; /** * Start the clock (stop watch), start measuring time * @param c a pounter to a variable defined with #DEFINE_CLOCK - */ + */ #define cw_clock_start(c)\ gettimeofday(c,NULL); /** * Get lap time. (stop watch) - * @param tv pointer to clock variable defined with #DEFINE_CLOCK + * @param tv pointer to a clock variable defined with #CLOCK_DEFINE * @return lap time in seconds. - */ -static inline double cw_clock_lap(struct timeval *tv){ + */ +static inline double cw_clock_lap(struct timeval *tv) +{ struct timeval lap; - gettimeofday(&lap,NULL); - return (cw_timevaltodouble(&lap)-cw_timevaltodouble(tv))/1000000.0; -} + gettimeofday(&lap, NULL); + return (cw_timevaltodouble(&lap) - cw_timevaltodouble(tv)) / 1000000.0; +} /** * An alias for #cw_clock_lap - */ + */ #define cw_clock_stop cw_clock_lap /** @} */