diff options
| author | 2020-12-23 17:31:34 -0800 | |
|---|---|---|
| committer | 2022-04-22 13:22:38 +0200 | |
| commit | 95316d81633120244d53b85303447beb1a917f74 (patch) | |
| tree | d836d7b096a86bc64b1e64c09f6c4433b0df67cb | |
| parent | 78040882a30666f29985bc6589be03cbc7d7cfbe (diff) | |
| download | libimobiledevice-95316d81633120244d53b85303447beb1a917f74.tar.gz libimobiledevice-95316d81633120244d53b85303447beb1a917f74.tar.bz2 | |
[clang-tidy] add parentheses to macros
Found with bugprone-macro-parentheses
Signed-off-by: Rosen Penev <rosenp@gmail.com>
| -rw-r--r-- | common/debug.c | 2 | ||||
| -rw-r--r-- | src/debugserver.c | 8 | ||||
| -rw-r--r-- | src/mobilebackup.c | 2 | ||||
| -rw-r--r-- | src/mobilebackup2.c | 2 | ||||
| -rw-r--r-- | tools/idevicebackup2.c | 2 |
5 files changed, 8 insertions, 8 deletions
diff --git a/common/debug.c b/common/debug.c index a1c336b..6212e71 100644 --- a/common/debug.c +++ b/common/debug.c | |||
| @@ -46,7 +46,7 @@ void internal_set_debug_level(int level) | |||
| 46 | debug_level = level; | 46 | debug_level = level; |
| 47 | } | 47 | } |
| 48 | 48 | ||
| 49 | #define MAX_PRINT_LEN 16*1024 | 49 | #define MAX_PRINT_LEN (16*1024) |
| 50 | 50 | ||
| 51 | #ifndef STRIP_DEBUG_CODE | 51 | #ifndef STRIP_DEBUG_CODE |
| 52 | static void debug_print_line(const char *func, const char *file, int line, const char *buffer) | 52 | static void debug_print_line(const char *func, const char *file, int line, const char *buffer) |
diff --git a/src/debugserver.c b/src/debugserver.c index 7dd7f22..39c1bdc 100644 --- a/src/debugserver.c +++ b/src/debugserver.c | |||
| @@ -239,10 +239,10 @@ static char debugserver_int2hex(int x) | |||
| 239 | return hexchars[x]; | 239 | return hexchars[x]; |
| 240 | } | 240 | } |
| 241 | 241 | ||
| 242 | #define DEBUGSERVER_HEX_ENCODE_FIRST_BYTE(byte) debugserver_int2hex((byte >> 0x4) & 0xf) | 242 | #define DEBUGSERVER_HEX_ENCODE_FIRST_BYTE(byte) debugserver_int2hex(((byte) >> 0x4) & 0xf) |
| 243 | #define DEBUGSERVER_HEX_ENCODE_SECOND_BYTE(byte) debugserver_int2hex(byte & 0xf) | 243 | #define DEBUGSERVER_HEX_ENCODE_SECOND_BYTE(byte) debugserver_int2hex((byte) & 0xf) |
| 244 | #define DEBUGSERVER_HEX_DECODE_FIRST_BYTE(byte) ((byte >> 0x4) & 0xf) | 244 | #define DEBUGSERVER_HEX_DECODE_FIRST_BYTE(byte) (((byte) >> 0x4) & 0xf) |
| 245 | #define DEBUGSERVER_HEX_DECODE_SECOND_BYTE(byte) (byte & 0xf) | 245 | #define DEBUGSERVER_HEX_DECODE_SECOND_BYTE(byte) ((byte) & 0xf) |
| 246 | 246 | ||
| 247 | static uint32_t debugserver_get_checksum_for_buffer(const char* buffer, uint32_t size) | 247 | static uint32_t debugserver_get_checksum_for_buffer(const char* buffer, uint32_t size) |
| 248 | { | 248 | { |
diff --git a/src/mobilebackup.c b/src/mobilebackup.c index cde96b5..aa29277 100644 --- a/src/mobilebackup.c +++ b/src/mobilebackup.c | |||
| @@ -34,7 +34,7 @@ | |||
| 34 | #define MBACKUP_VERSION_INT1 100 | 34 | #define MBACKUP_VERSION_INT1 100 |
| 35 | #define MBACKUP_VERSION_INT2 0 | 35 | #define MBACKUP_VERSION_INT2 0 |
| 36 | 36 | ||
| 37 | #define IS_FLAG_SET(x, y) ((x & y) == y) | 37 | #define IS_FLAG_SET(x, y) (((x) & (y)) == (y)) |
| 38 | 38 | ||
| 39 | /** | 39 | /** |
| 40 | * Convert an device_link_service_error_t value to an mobilebackup_error_t value. | 40 | * Convert an device_link_service_error_t value to an mobilebackup_error_t value. |
diff --git a/src/mobilebackup2.c b/src/mobilebackup2.c index 6c6556d..f4fde95 100644 --- a/src/mobilebackup2.c +++ b/src/mobilebackup2.c | |||
| @@ -33,7 +33,7 @@ | |||
| 33 | #define MBACKUP2_VERSION_INT1 400 | 33 | #define MBACKUP2_VERSION_INT1 400 |
| 34 | #define MBACKUP2_VERSION_INT2 0 | 34 | #define MBACKUP2_VERSION_INT2 0 |
| 35 | 35 | ||
| 36 | #define IS_FLAG_SET(x, y) ((x & y) == y) | 36 | #define IS_FLAG_SET(x, y) (((x) & (y)) == (y)) |
| 37 | 37 | ||
| 38 | /** | 38 | /** |
| 39 | * Convert an device_link_service_error_t value to an mobilebackup2_error_t value. | 39 | * Convert an device_link_service_error_t value to an mobilebackup2_error_t value. |
diff --git a/tools/idevicebackup2.c b/tools/idevicebackup2.c index 2f8f1fa..2170f98 100644 --- a/tools/idevicebackup2.c +++ b/tools/idevicebackup2.c | |||
| @@ -1458,7 +1458,7 @@ static void print_usage(int argc, char **argv) | |||
| 1458 | printf("Bug Reports: <" PACKAGE_BUGREPORT ">\n"); | 1458 | printf("Bug Reports: <" PACKAGE_BUGREPORT ">\n"); |
| 1459 | } | 1459 | } |
| 1460 | 1460 | ||
| 1461 | #define DEVICE_VERSION(maj, min, patch) (((maj & 0xFF) << 16) | ((min & 0xFF) << 8) | (patch & 0xFF)) | 1461 | #define DEVICE_VERSION(maj, min, patch) ((((maj) & 0xFF) << 16) | (((min) & 0xFF) << 8) | ((patch) & 0xFF)) |
| 1462 | 1462 | ||
| 1463 | int main(int argc, char *argv[]) | 1463 | int main(int argc, char *argv[]) |
| 1464 | { | 1464 | { |
