Ran clang-format on android/cdm/util files.

[ Merge of http://go/wvgerrit/87143 ]

Certain android files have yet to be formated since we introduced
clang-formatting.

Test: Android unit tests
Bug: 134365840
Change-Id: I0e58fb7e5b5525f1e2885ce89b222561a971ab27
This commit is contained in:
Alex Dale
2019-10-02 12:59:31 -07:00
parent 78e84dcd3b
commit 06388368cc
4 changed files with 36 additions and 19 deletions

View File

@@ -14,6 +14,7 @@
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <cstring>
#include <memory>

View File

@@ -12,6 +12,7 @@
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <cstring>
#include "file_store.h"

View File

@@ -11,11 +11,11 @@
* at the top of your source file) to change that behavior.
*/
#ifndef LOG_NDEBUG
#ifdef NDEBUG
#define LOG_NDEBUG 1
#else
#define LOG_NDEBUG 0
#endif
# ifdef NDEBUG
# define LOG_NDEBUG 1
# else
# define LOG_NDEBUG 0
# endif
#endif
#define LOG_TAG "WVCdm"
@@ -24,10 +24,10 @@
#include "log.h"
#include <utils/Log.h>
#include <string>
#include <stdio.h>
#include <stdarg.h>
#include <stdio.h>
#include <string>
/*
* Uncomment the line below if you want to have the LOGV messages to print
@@ -48,28 +48,40 @@ void Log(const char* file, const char* function, int line, LogPriority level,
filename = filename == nullptr ? file : filename + 1;
char buf[LOG_BUF_SIZE];
int len = snprintf(buf, LOG_BUF_SIZE, "[%s(%d):%s] ", filename, line,
function);
int len =
snprintf(buf, LOG_BUF_SIZE, "[%s(%d):%s] ", filename, line, function);
if (len < 0) len = 0;
if (static_cast<unsigned int>(len) < sizeof(buf)) {
va_list ap;
va_start(ap, format);
vsnprintf(buf+len, LOG_BUF_SIZE-len, format, ap);
vsnprintf(buf + len, LOG_BUF_SIZE - len, format, ap);
va_end(ap);
}
android_LogPriority prio = ANDROID_LOG_VERBOSE;
switch(level) {
case LOG_SILENT: return; // It is nonsensical to pass LOG_SILENT.
case LOG_ERROR: prio = ANDROID_LOG_ERROR; break;
case LOG_WARN: prio = ANDROID_LOG_WARN; break;
case LOG_INFO: prio = ANDROID_LOG_INFO; break;
case LOG_DEBUG: prio = ANDROID_LOG_DEBUG; break;
switch (level) {
case LOG_SILENT:
return; // It is nonsensical to pass LOG_SILENT.
case LOG_ERROR:
prio = ANDROID_LOG_ERROR;
break;
case LOG_WARN:
prio = ANDROID_LOG_WARN;
break;
case LOG_INFO:
prio = ANDROID_LOG_INFO;
break;
case LOG_DEBUG:
prio = ANDROID_LOG_DEBUG;
break;
#if LOG_NDEBUG
case LOG_VERBOSE: return;
case LOG_VERBOSE:
return;
#else
case LOG_VERBOSE: prio = ANDROID_LOG_VERBOSE; break;
case LOG_VERBOSE:
prio = ANDROID_LOG_VERBOSE;
break;
#endif
}