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
This commit is contained in:
Mark Salyzyn 2017-03-08 15:03:20 -08:00
parent 2ed51d708e
commit 04bbc8ea45
4 changed files with 9 additions and 9 deletions

View file

@ -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,

View file

@ -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,

View file

@ -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;

View file

@ -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;