[asterisk-commits] mmichelson: branch mmichelson/res_timing_timerfd r157781 - /team/mmichelson/r...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Nov 19 11:00:44 CST 2008


Author: mmichelson
Date: Wed Nov 19 11:00:44 2008
New Revision: 157781

URL: http://svn.digium.com/view/asterisk?view=rev&rev=157781
Log:
* Remove trailing whitespace
* Change the continuous timer to use a struct initializer.


Modified:
    team/mmichelson/res_timing_timerfd/res/res_timing_timerfd.c

Modified: team/mmichelson/res_timing_timerfd/res/res_timing_timerfd.c
URL: http://svn.digium.com/view/asterisk/team/mmichelson/res_timing_timerfd/res/res_timing_timerfd.c?view=diff&rev=157781&r1=157780&r2=157781
==============================================================================
--- team/mmichelson/res_timing_timerfd/res/res_timing_timerfd.c (original)
+++ team/mmichelson/res_timing_timerfd/res/res_timing_timerfd.c Wed Nov 19 11:00:44 2008
@@ -16,11 +16,11 @@
  * at the top of the source tree.
  */
 
-/*! 
+/*!
  * \file
  * \author Mark Michelson <mmichelson at digium.com>
  *
- * \brief timerfd timing interface 
+ * \brief timerfd timing interface
  */
 
 /*** MODULEINFO
@@ -165,7 +165,9 @@
 static int timerfd_timer_enable_continuous(int handle)
 {
 	int res;
-	struct itimerspec continuous_timer;
+	struct itimerspec continuous_timer = {
+		.it_value.tv_nsec = 1L;
+	};
 	struct timerfd_timer *our_timer, find_helper = {
 		.handle = handle,
 	};
@@ -183,9 +185,6 @@
 		return 0;
 	}
 
-	memset(&continuous_timer, 0, sizeof(continuous_timer));
-	continuous_timer.it_value.tv_nsec = 1L;
-	
 	res = timerfd_settime(handle, 0, &continuous_timer, &our_timer->saved_timer);
 	our_timer->is_continuous = 1;
 	ao2_ref(our_timer, -1);
@@ -211,7 +210,7 @@
 		ao2_ref(our_timer, -1);
 		return 0;
 	}
-	
+
 	res = timerfd_settime(handle, 0, &our_timer->saved_timer, NULL);
 	our_timer->is_continuous = 0;
 	memset(&our_timer->saved_timer, 0, sizeof(our_timer->saved_timer));
@@ -229,7 +228,7 @@
 	if (!(our_timer = ao2_find(timerfd_timers, &find_helper, NULL, OBJ_POINTER))) {
 		ast_log(LOG_ERROR, "Couldn't find timer with handle %d\n", handle);
 		return -1;
-	} 
+	}
 
 	if (our_timer->is_continuous) {
 		res = AST_TIMING_EVENT_CONTINUOUS;
@@ -251,7 +250,7 @@
 	if (!(timerfd_timers = ao2_container_alloc(TIMERFD_TIMER_BUCKETS, timerfd_timer_hash, timerfd_timer_cmp))) {
 		return AST_MODULE_LOAD_DECLINE;
 	}
-	
+
 	if (!(timing_funcs_handle = ast_install_timing_functions(&timerfd_timing_functions))) {
 		ao2_ref(timerfd_timers, -1);
 		return AST_MODULE_LOAD_DECLINE;




More information about the asterisk-commits mailing list