From 3f96242b42e7c45d56255980f7f6338d0db35041 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Tue, 6 Feb 2018 19:46:31 +0000 Subject: MISRA-related fixes. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11464 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/rt/include/chtime.h | 3 +++ test/rt/testbuild/chconf.h | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/os/rt/include/chtime.h b/os/rt/include/chtime.h index 73d278a77..b2fc9d5d0 100644 --- a/os/rt/include/chtime.h +++ b/os/rt/include/chtime.h @@ -490,7 +490,10 @@ static inline systime_t chTimeAddX(systime_t systime, */ static inline sysinterval_t chTimeDiffX(systime_t start, systime_t end) { + /*lint -save -e9033 [10.8] This cast is required by the operation, it is + known that the destination type can be wider.*/ return (sysinterval_t)((systime_t)(end - start)); + /*lint -restore*/ } /** diff --git a/test/rt/testbuild/chconf.h b/test/rt/testbuild/chconf.h index 87b6c7b2d..f652bbecd 100644 --- a/test/rt/testbuild/chconf.h +++ b/test/rt/testbuild/chconf.h @@ -59,13 +59,17 @@ * @brief Time intervals data size. * @note Allowed values are 16, 32 or 64 bits. */ +#if !defined(CH_CFG_INTERVALS_SIZE) || defined(__DOXYGEN__) #define CH_CFG_INTERVALS_SIZE 32 +#endif /** * @brief Time types data size. * @note Allowed values are 16 or 32 bits. */ +#if !defined(CH_CFG_TIME_TYPES_SIZE) || defined(__DOXYGEN__) #define CH_CFG_TIME_TYPES_SIZE 32 +#endif /** * @brief Time delta constant for the tick-less mode. -- cgit v1.2.3