[rtems commit] rtems: Fix implicit type conversions

Sebastian Huber sebh at rtems.org
Mon Feb 1 06:20:12 UTC 2021


Module:    rtems
Branch:    master
Commit:    9523887904159c27730fd3d78114e9825c683f8b
Changeset: http://git.rtems.org/rtems/commit/?id=9523887904159c27730fd3d78114e9825c683f8b

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri Jan 29 07:22:21 2021 +0100

rtems: Fix implicit type conversions

This fix relates to a Coverity issue (PW.MIXED_ENUM_TYPE).

---

 cpukit/include/rtems/rtems/timerimpl.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/cpukit/include/rtems/rtems/timerimpl.h b/cpukit/include/rtems/rtems/timerimpl.h
index 840005d..8d245d7 100644
--- a/cpukit/include/rtems/rtems/timerimpl.h
+++ b/cpukit/include/rtems/rtems/timerimpl.h
@@ -117,9 +117,9 @@ RTEMS_INLINE_ROUTINE bool _Timer_Is_interval_class(
   Timer_Classes the_class
 )
 {
-  Timer_Classes mask =
-    TIMER_CLASS_BIT_NOT_DORMANT | TIMER_CLASS_BIT_TIME_OF_DAY;
+  int mask;
 
+  mask = TIMER_CLASS_BIT_NOT_DORMANT | TIMER_CLASS_BIT_TIME_OF_DAY;
   return ( the_class & mask ) == TIMER_CLASS_BIT_NOT_DORMANT;
 }
 
@@ -127,9 +127,9 @@ RTEMS_INLINE_ROUTINE bool _Timer_Is_on_task_class(
   Timer_Classes the_class
 )
 {
-  Timer_Classes mask =
-    TIMER_CLASS_BIT_NOT_DORMANT | TIMER_CLASS_BIT_ON_TASK;
+  int mask;
 
+  mask = TIMER_CLASS_BIT_NOT_DORMANT | TIMER_CLASS_BIT_ON_TASK;
   return ( the_class & mask ) == mask;
 }
 



More information about the vc mailing list