Merge "Fix misc-macro-parentheses warnings in liblog."

This commit is contained in:
Chih-hung Hsieh 2016-05-19 00:48:44 +00:00 committed by Gerrit Code Review
commit 2bd428e1f9
6 changed files with 33 additions and 33 deletions

View file

@ -27,21 +27,21 @@ extern LIBLOG_HIDDEN struct listnode __android_log_transport_read;
extern LIBLOG_HIDDEN struct listnode __android_log_persist_read;
#define read_transport_for_each(transp, transports) \
for (transp = node_to_item((transports)->next, \
for ((transp) = node_to_item((transports)->next, \
struct android_log_transport_read, node); \
(transp != node_to_item(transports, \
((transp) != node_to_item(transports, \
struct android_log_transport_read, node)); \
transp = node_to_item(transp->node.next, \
(transp) = node_to_item((transp)->node.next, \
struct android_log_transport_read, node)) \
#define read_transport_for_each_safe(transp, n, transports) \
for (transp = node_to_item((transports)->next, \
for ((transp) = node_to_item((transports)->next, \
struct android_log_transport_read, node), \
n = transp->node.next; \
(transp != node_to_item(transports, \
(n) = (transp)->node.next; \
((transp) != node_to_item(transports, \
struct android_log_transport_read, node)); \
transp = node_to_item(n, struct android_log_transport_read, node), \
n = transp->node.next)
(transp) = node_to_item(n, struct android_log_transport_read, node), \
(n) = (transp)->node.next)
LIBLOG_HIDDEN void __android_log_config_read();

View file

@ -27,21 +27,21 @@ extern LIBLOG_HIDDEN struct listnode __android_log_transport_write;
extern LIBLOG_HIDDEN struct listnode __android_log_persist_write;
#define write_transport_for_each(transp, transports) \
for (transp = node_to_item((transports)->next, \
struct android_log_transport_write, node); \
(transp != node_to_item(transports, \
for ((transp) = node_to_item((transports)->next, \
struct android_log_transport_write, node); \
((transp) != node_to_item(transports, \
struct android_log_transport_write, node)); \
transp = node_to_item(transp->node.next, \
struct android_log_transport_write, node)) \
(transp) = node_to_item((transp)->node.next, \
struct android_log_transport_write, node)) \
#define write_transport_for_each_safe(transp, n, transports) \
for (transp = node_to_item((transports)->next, \
struct android_log_transport_write, node), \
n = transp->node.next; \
(transp != node_to_item(transports, \
struct android_log_transport_write, node)); \
transp = node_to_item(n, struct android_log_transport_write, node), \
n = transp->node.next)
for ((transp) = node_to_item((transports)->next, \
struct android_log_transport_write, node), \
(n) = (transp)->node.next; \
((transp) != node_to_item(transports, \
struct android_log_transport_write, node)); \
(transp) = node_to_item(n, struct android_log_transport_write, node), \
(n) = (transp)->node.next)
LIBLOG_HIDDEN void __android_log_config_write();

View file

@ -124,23 +124,23 @@ struct android_log_transport_context {
/* assumes caller has structures read-locked, single threaded, or fenced */
#define transport_context_for_each(transp, logger_list) \
for (transp = node_to_item((logger_list)->transport.next, \
for ((transp) = node_to_item((logger_list)->transport.next, \
struct android_log_transport_context, \
node); \
(transp != node_to_item(&(logger_list)->transport, \
((transp) != node_to_item(&(logger_list)->transport, \
struct android_log_transport_context, \
node)) && \
(transp->parent == (logger_list)); \
transp = node_to_item(transp->node.next, \
((transp)->parent == (logger_list)); \
(transp) = node_to_item((transp)->node.next, \
struct android_log_transport_context, node))
#define logger_for_each(logp, logger_list) \
for (logp = node_to_item((logger_list)->logger.next, \
for ((logp) = node_to_item((logger_list)->logger.next, \
struct android_log_logger, node); \
(logp != node_to_item(&(logger_list)->logger, \
((logp) != node_to_item(&(logger_list)->logger, \
struct android_log_logger, node)) && \
(logp->parent == (logger_list)); \
logp = node_to_item((logp)->node.next, \
((logp)->parent == (logger_list)); \
(logp) = node_to_item((logp)->node.next, \
struct android_log_logger, node))
/* OS specific dribs and drabs */

View file

@ -125,7 +125,7 @@ static int init_transport_context(struct android_log_logger_list *logger_list)
ssize_t ret = -EINVAL; \
struct android_log_transport_context *transp; \
struct android_log_logger *logger_internal = \
(struct android_log_logger *)logger; \
(struct android_log_logger *)(logger); \
\
if (!logger_internal) { \
return ret; \
@ -186,7 +186,7 @@ LIBLOG_ABI_PUBLIC int android_logger_get_log_version(struct logger *logger)
#define LOGGER_LIST_FUNCTION(logger_list, def, func, args...) \
struct android_log_transport_context *transp; \
struct android_log_logger_list *logger_list_internal = \
(struct android_log_logger_list *)logger_list; \
(struct android_log_logger_list *)(logger_list); \
\
ssize_t ret = init_transport_context(logger_list_internal); \
if (ret < 0) { \

View file

@ -141,7 +141,7 @@ void StartBenchmarkTiming(uint64_t);
void StopBenchmarkTiming(uint64_t);
#define BENCHMARK(f) \
static ::testing::Benchmark* _benchmark_##f __attribute__((unused)) = \
(::testing::Benchmark*)::testing::BenchmarkFactory(#f, f)
static ::testing::Benchmark* _benchmark_##f __attribute__((unused)) = /* NOLINT */ \
(::testing::Benchmark*)::testing::BenchmarkFactory(#f, f) /* NOLINT */
#endif // BIONIC_BENCHMARK_H_

View file

@ -33,7 +33,7 @@
#include "LogUtils.h"
#define log_id_for_each(i) \
for (log_id_t i = LOG_ID_MIN; i < LOG_ID_MAX; i = (log_id_t) (i + 1))
for (log_id_t i = LOG_ID_MIN; (i) < LOG_ID_MAX; (i) = (log_id_t) ((i) + 1))
class LogStatistics;