Преглед на файлове

core: fix for warning dereferencing type-punned pointer will break strict-aliasing rules

- related to timer list operation
Daniel-Constantin Mierla преди 12 години
родител
ревизия
a3a8457e9b
променени са 1 файла, в които са добавени 4 реда и са изтрити 1 реда
  1. 4 1
      timer_funcs.h

+ 4 - 1
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