From 33500c91e33c2e8871af2826ee1801c630c54702 Mon Sep 17 00:00:00 2001 From: Chih-Hung Hsieh Date: Wed, 11 May 2016 14:59:45 -0700 Subject: [PATCH] Fix misc-macro-parentheses warnings. Add parentheses around macro arguments used beside binary operators. Use NOLINT comment to suppress false clang-tidy warnings. Bug: 28705665 Change-Id: Idc7474c43da52a1ca6a690b56d8f637767adbb88 --- tools/check_seapp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/check_seapp.c b/tools/check_seapp.c index 69db3889e..751fb5c1c 100644 --- a/tools/check_seapp.c +++ b/tools/check_seapp.c @@ -23,7 +23,7 @@ /** * Initializes an empty, static list. */ -#define list_init(free_fn) { .head = NULL, .tail = NULL, .freefn = free_fn } +#define list_init(free_fn) { .head = NULL, .tail = NULL, .freefn = (free_fn) } /** * given an item in the list, finds the offset for the container @@ -35,7 +35,7 @@ * */ #define list_entry(element, type, name) \ - (type *)(((uint8_t *)element) - (uint8_t *)&(((type *)NULL)->name)) + (type *)(((uint8_t *)(element)) - (uint8_t *)&(((type *)NULL)->name)) /** * Iterates over the list, do not free elements from the list when using this. @@ -43,7 +43,7 @@ * @var The variable name for the cursor */ #define list_for_each(list, var) \ - for(var = (list)->head; var != NULL; var = var->next) + for(var = (list)->head; var != NULL; var = var->next) /*NOLINT*/ typedef struct hash_entry hash_entry;