Clang Format some OEMCrypto Files

Merge from Widevine repo of http://go/wvgerrit/23240

This CL runs clang format on some OEMCrypto test and mock files,
so it is easier to see what really changed in the next CL.

Change-Id: I0abf98fc8d312d5b94ad51c3ef2caae820b931de
This commit is contained in:
Fred Gylys-Colwell
2017-01-24 17:57:04 -08:00
parent 15e1f7dca2
commit a24acfa928
8 changed files with 482 additions and 664 deletions

View File

@@ -14,17 +14,13 @@ void SetLoggingSettings(int level, int categories) {
AddLoggingForCategories(categories);
}
void TurnOffLoggingForAllCategories() {
logging_category_setting = 0;
void TurnOffLoggingForAllCategories() { logging_category_setting = 0; }
void SetLoggingLevel(int level) {
wvcdm::g_cutoff = static_cast<wvcdm::LogPriority>(level);
}
void SetLoggingLevel(int level){;
wvcdm::g_cutoff = static_cast<wvcdm::LogPriority>(level);
}
void SetLoggingLevel(wvcdm::LogPriority level) {
wvcdm::g_cutoff = level;
}
void SetLoggingLevel(wvcdm::LogPriority level) { wvcdm::g_cutoff = level; }
void AddLoggingForCategories(int categories) {
logging_category_setting |= categories;
@@ -35,20 +31,20 @@ void RemoveLoggingForCategories(int categories) {
}
bool LogCategoryEnabled(int categories) {
return ( (logging_category_setting & categories) !=0 );
return ((logging_category_setting & categories) != 0);
}
void dump_hex_helper(std::string& buffer, std::string name,
const uint8_t* vector, size_t length) {
const uint8_t* vector, size_t length) {
buffer += name + " = ";
if (vector == NULL) {
buffer +="NULL;\n";
buffer += "NULL;\n";
LOGE(buffer.c_str());
return;
}
int a, b;
char int_to_hexcar[16] = {'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
'8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
for (size_t i = 0; i < length; i++) {
if (i == 0) {
buffer += "\n wvcdm::a2b_hex(\"";
@@ -64,7 +60,7 @@ void dump_hex_helper(std::string& buffer, std::string name,
}
void dump_hex(std::string name, const uint8_t* vector, size_t length) {
std::string buffer="";
std::string buffer = "";
dump_hex_helper(buffer, name, vector, length);
LOGV(buffer.c_str());
}
@@ -88,7 +84,7 @@ void dump_array_part_helper(std::string& buffer, std::string array,
}
buffer += "std::string s";
buffer += index_str;
buffer+= "_";
buffer += "_";
dump_hex_helper(buffer, name, vector, length);
buffer += array.c_str();
buffer += "[";
@@ -98,9 +94,9 @@ void dump_array_part_helper(std::string& buffer, std::string array,
buffer += "_" + name + ".data());\n";
}
void dump_array_part(std::string array, size_t index,
std::string name, const uint8_t* vector, size_t length) {
std::string buffer ="";
void dump_array_part(std::string array, size_t index, std::string name,
const uint8_t* vector, size_t length) {
std::string buffer = "";
dump_array_part_helper(buffer, array, index, name, vector, length);
LOGV(buffer.c_str());
}