diff options
author | Giovanni Di Sirio <gdisirio@gmail.com> | 2016-04-03 09:27:34 +0000 |
---|---|---|
committer | Giovanni Di Sirio <gdisirio@gmail.com> | 2016-04-03 09:27:34 +0000 |
commit | 88fc433e5dfc3ddc3948d27b78be2e531113fa1e (patch) | |
tree | c271cde02df11bbd992e59a58c28ad3adfbecd81 /os/rt/include/chalign.h | |
parent | a5156a2f8fa55401d16405acfb51dc8b6999b484 (diff) | |
download | ChibiOS-88fc433e5dfc3ddc3948d27b78be2e531113fa1e.tar.gz ChibiOS-88fc433e5dfc3ddc3948d27b78be2e531113fa1e.tar.bz2 ChibiOS-88fc433e5dfc3ddc3948d27b78be2e531113fa1e.zip |
MISRA-related fixes.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9229 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/rt/include/chalign.h')
-rw-r--r-- | os/rt/include/chalign.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/os/rt/include/chalign.h b/os/rt/include/chalign.h index 9662b3b2f..b2065923e 100644 --- a/os/rt/include/chalign.h +++ b/os/rt/include/chalign.h @@ -64,7 +64,10 @@ * @param[in] p variable to be aligned
* @param[in] a alignment, must be a power of two
*/
-#define MEM_ALIGN_PREV(p, a) ((size_t)(p) & ~MEM_ALIGN_MASK(a))
+#define MEM_ALIGN_PREV(p, a) \
+ /*lint -save -e9033 [10.8] The cast is safe.*/ \
+ ((size_t)(p) & ~MEM_ALIGN_MASK(a)) \
+ /*lint -restore*/
/**
* @brief Aligns to the new aligned memory address.
@@ -72,8 +75,10 @@ * @param[in] p variable to be aligned
* @param[in] a alignment, must be a power of two
*/
-#define MEM_ALIGN_NEXT(p, a) MEM_ALIGN_PREV((size_t)(p) + \
- MEM_ALIGN_MASK(a), (a))
+#define MEM_ALIGN_NEXT(p, a) \
+ /*lint -save -e9033 [10.8] The cast is safe.*/ \
+ MEM_ALIGN_PREV((size_t)(p) + MEM_ALIGN_MASK(a), (a)) \
+ /*lint -restore*/
/**
* @brief Returns whatever a pointer or memory size is aligned.
|