From: bernie Date: Sun, 8 Aug 2004 05:59:37 +0000 (+0000) Subject: Remove a few useless casts. X-Git-Tag: 1.0.0~1122 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=b7719aabccbf66857d16c5ee1ba5ae25b7449d75;p=bertos.git Remove a few useless casts. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@119 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/drv/timer.c b/drv/timer.c index 24287cb9..dc350057 100755 --- a/drv/timer.c +++ b/drv/timer.c @@ -15,6 +15,9 @@ /* * $Log$ + * Revision 1.12 2004/08/08 05:59:37 bernie + * Remove a few useless casts. + * * Revision 1.11 2004/08/02 20:20:29 aleph * Merge from project_ks * @@ -91,7 +94,7 @@ void timer_add(Timer *timer) node = (Timer *)timers_queue.head; while (node->link.succ) { - /* Stop just after the insert point */ + /* Stop just after the insertion point */ if (node->tick > timer->tick) break; @@ -100,7 +103,7 @@ void timer_add(Timer *timer) } /* Enqueue timer request into the list */ - INSERTBEFORE((Node *)timer, (Node *)node); + INSERTBEFORE(&timer->link, &node->link); ENABLE_IRQRESTORE(flags); } @@ -113,7 +116,7 @@ Timer *timer_abort(Timer *timer) { cpuflags_t flags; DISABLE_IRQSAVE(flags); - REMOVE((Node *)timer); + REMOVE(&timer->link); ENABLE_IRQRESTORE(flags); return timer; @@ -157,7 +160,7 @@ void timer_delay(time_t time) */ void timer_udelay(utime_t usec_delay) { - if (usec_delay > 1000) + if (UNLIKELY(usec_delay > 1000)) { timer_delay(usec_delay / 1000); usec_delay %= 1000; @@ -216,7 +219,7 @@ DEFINE_TIMER_ISR break; /* Retreat the expired timer */ - REMOVE((Node *)timer); + REMOVE(&timer->link); /* Execute the associated event */ event_do(&timer->expire);