From c6d6652df52bb65984f6be1f8e57606d3f5a6e69 Mon Sep 17 00:00:00 2001 From: Mark Salyzyn Date: Wed, 30 Mar 2016 12:38:29 -0700 Subject: [PATCH] logcat: do not assign 0 or NULL to global variables Bug: 27706081 Change-Id: If29d8d688ca7cce9b22227eeff1e9b500e728a50 --- logcat/logcat.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/logcat/logcat.cpp b/logcat/logcat.cpp index cc3333cff..df3eb6606 100644 --- a/logcat/logcat.cpp +++ b/logcat/logcat.cpp @@ -69,19 +69,19 @@ namespace android { /* Global Variables */ -static const char * g_outputFileName = NULL; +static const char * g_outputFileName; // 0 means "no log rotation" -static size_t g_logRotateSizeKBytes = 0; +static size_t g_logRotateSizeKBytes; // 0 means "unbounded" static size_t g_maxRotatedLogs = DEFAULT_MAX_ROTATED_LOGS; static int g_outFD = -1; -static size_t g_outByteCount = 0; -static int g_printBinary = 0; -static int g_devCount = 0; // >1 means multiple +static size_t g_outByteCount; +static int g_printBinary; +static int g_devCount; // >1 means multiple static pcrecpp::RE* g_regex; // 0 means "infinite" -static size_t g_maxCount = 0; -static size_t g_printCount = 0; +static size_t g_maxCount; +static size_t g_printCount; __noreturn static void logcat_panic(bool showHelp, const char *fmt, ...) __printflike(2,3);