Module: sip-router
Branch: master
Commit: a3a8457e9bfe4dea48c0acd7421952014346a907
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=a3a8457…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Thu Sep 19 15:17:38 2013 +0200
core: fix for warning dereferencing type-punned pointer will break strict-aliasing rules
- related to timer list operation
---
timer_funcs.h | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/timer_funcs.h b/timer_funcs.h
index 8e17b8a..28c223d 100644
--- a/timer_funcs.h
+++ b/timer_funcs.h
@@ -157,6 +157,8 @@ static inline void timer_redist(ticks_t t, struct timer_head *h)
static inline void timer_run(ticks_t t)
{
+ struct timer_head *thp;
+
/* trust the compiler for optimizing */
if ((t & H0_MASK)==0){ /*r1*/
if ((t & H1_H0_MASK)==0){ /*r2*/
@@ -168,7 +170,8 @@ static inline void timer_run(ticks_t t)
/*
DBG("timer_run: ticks %u, expire h0[%u]\n",
(unsigned ) t, (unsigned)(t & H0_MASK));*/
- _timer_mv_expire(&timer_lst->h0[t & H0_MASK]); /*r1*/
+ thp = &timer_lst->h0[t & H0_MASK];
+ _timer_mv_expire(thp); /*r1*/
}
#else