[FL-2811] Fix PVS-Studio warnings (#2142)

Co-authored-by: あく <alleteam@gmail.com>
Co-authored-by: gornekich <n.gorbadey@gmail.com>
This commit is contained in:
Georgii Surkov
2022-12-26 15:13:30 +03:00
committed by GitHub
parent ad3bff0b67
commit 8582670a34
201 changed files with 719 additions and 743 deletions

View File

@@ -7,7 +7,7 @@
extern "C" {
#endif
#define TOPBIT(X) (1 << (X - 1))
#define TOPBIT(X) (1 << ((X)-1))
typedef enum {
BitLibParityEven,
@@ -26,13 +26,13 @@ typedef enum {
* @param data value to test
* @param index bit index to test
*/
#define bit_lib_bit_is_set(data, index) ((data & (1 << (index))) != 0)
#define bit_lib_bit_is_set(data, index) (((data) & (1 << (index))) != 0)
/** @brief Test if a bit is not set.
* @param data value to test
* @param index bit index to test
*/
#define bit_lib_bit_is_not_set(data, index) ((data & (1 << (index))) == 0)
#define bit_lib_bit_is_not_set(data, index) (((data) & (1 << (index))) == 0)
/** @brief Push a bit into a byte array.
* @param data array to push bit into
@@ -269,4 +269,4 @@ uint16_t bit_lib_crc16(
#ifdef __cplusplus
}
#endif
#endif