From 04bbc8ea4584b14c21e0c63f8dc4c6b4beb7bd47 Mon Sep 17 00:00:00 2001 From: Mark Salyzyn Date: Wed, 8 Mar 2017 15:03:20 -0800 Subject: [PATCH] liblog: stay away from C++ keyword private Replace with void* private with priv in context structure. SideEffects: None Test: gTest liblog-unit-tests Bug: 27405083 Change-Id: I670cb0b7fb2f3085ea13b4ac836d84239a3c8572 --- liblog/fake_writer.c | 2 +- liblog/local_logger.c | 2 +- liblog/logger.h | 2 +- liblog/stderr_write.c | 12 ++++++------ 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/liblog/fake_writer.c b/liblog/fake_writer.c index c280e3f49..969661ada 100644 --- a/liblog/fake_writer.c +++ b/liblog/fake_writer.c @@ -34,7 +34,7 @@ static int logFds[(int)LOG_ID_MAX] = { -1, -1, -1, -1, -1, -1 }; LIBLOG_HIDDEN struct android_log_transport_write fakeLoggerWrite = { .node = { &fakeLoggerWrite.node, &fakeLoggerWrite.node }, - .context.private = &logFds, + .context.priv = &logFds, .name = "fake", .available = NULL, .open = fakeOpen, diff --git a/liblog/local_logger.c b/liblog/local_logger.c index 758905fd4..9906eb724 100644 --- a/liblog/local_logger.c +++ b/liblog/local_logger.c @@ -47,7 +47,7 @@ static int writeToLocalWrite(log_id_t logId, struct timespec* ts, LIBLOG_HIDDEN struct android_log_transport_write localLoggerWrite = { .node = { &localLoggerWrite.node, &localLoggerWrite.node }, - .context.private = NULL, + .context.priv = NULL, .name = "local", .available = writeToLocalAvailable, .open = writeToLocalInit, diff --git a/liblog/logger.h b/liblog/logger.h index 86c75f8b8..1a39ec092 100644 --- a/liblog/logger.h +++ b/liblog/logger.h @@ -30,7 +30,7 @@ __BEGIN_DECLS /* Union, sock or fd of zero is not allowed unless static initialized */ union android_log_context { - void* private; + void* priv; atomic_int sock; atomic_int fd; struct listnode* node; diff --git a/liblog/stderr_write.c b/liblog/stderr_write.c index 291ce9322..dbe5309da 100644 --- a/liblog/stderr_write.c +++ b/liblog/stderr_write.c @@ -57,7 +57,7 @@ struct stderrContext { LIBLOG_HIDDEN struct android_log_transport_write stderrLoggerWrite = { .node = { &stderrLoggerWrite.node, &stderrLoggerWrite.node }, - .context.private = NULL, + .context.priv = NULL, .name = "stderr", .available = stderrAvailable, .open = stderrOpen, @@ -74,7 +74,7 @@ static int stderrOpen() { return -EBADF; } - if (stderrLoggerWrite.context.private) { + if (stderrLoggerWrite.context.priv) { return fileno(stderr); } @@ -117,16 +117,16 @@ static int stderrOpen() { if (envStr) { android_log_addFilterString(ctx->logformat, envStr); } - stderrLoggerWrite.context.private = ctx; + stderrLoggerWrite.context.priv = ctx; return fileno(stderr); } static void stderrClose() { - struct stderrContext* ctx = stderrLoggerWrite.context.private; + struct stderrContext* ctx = stderrLoggerWrite.context.priv; if (ctx) { - stderrLoggerWrite.context.private = NULL; + stderrLoggerWrite.context.priv = NULL; if (ctx->logformat) { android_log_format_free(ctx->logformat); ctx->logformat = NULL; @@ -154,7 +154,7 @@ static int stderrWrite(log_id_t logId, struct timespec* ts, struct iovec* vec, char binaryMsgBuf[1024]; int err; size_t i; - struct stderrContext* ctx = stderrLoggerWrite.context.private; + struct stderrContext* ctx = stderrLoggerWrite.context.priv; if (!ctx) return -EBADF; if (!vec || !nr) return -EINVAL;