Reformat the WebRTC code base
Running clang-format with chromium's style guide.
The goal is n-fold:
* providing consistency and readability (that's what code guidelines are for)
* preventing noise with presubmit checks and git cl format
* building on the previous point: making it easier to automatically fix format issues
* you name it
Please consider using git-hyper-blame to ignore this commit.
Bug: webrtc:9340
Change-Id: I694567c4cdf8cee2860958cfe82bfaf25848bb87
Reviewed-on: https://webrtc-review.googlesource.com/81185
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23660}
diff --git a/rtc_base/optionsfile.cc b/rtc_base/optionsfile.cc
index c3b6a6a..8d2d2e0 100644
--- a/rtc_base/optionsfile.cc
+++ b/rtc_base/optionsfile.cc
@@ -18,8 +18,7 @@
namespace rtc {
-OptionsFile::OptionsFile(const std::string &path) : path_(path) {
-}
+OptionsFile::OptionsFile(const std::string& path) : path_(path) {}
OptionsFile::~OptionsFile() = default;
@@ -75,8 +74,8 @@
int error;
for (OptionsMap::const_iterator i = options_.begin(); i != options_.end();
++i) {
- res = stream.WriteAll(i->first.c_str(), i->first.length(), &written,
- &error);
+ res =
+ stream.WriteAll(i->first.c_str(), i->first.length(), &written, &error);
if (res != SR_SUCCESS) {
break;
}
@@ -85,7 +84,7 @@
break;
}
res = stream.WriteAll(i->second.c_str(), i->second.length(), &written,
- &error);
+ &error);
if (res != SR_SUCCESS) {
break;
}
@@ -102,7 +101,7 @@
}
}
-bool OptionsFile::IsLegalName(const std::string &name) {
+bool OptionsFile::IsLegalName(const std::string& name) {
for (size_t pos = 0; pos < name.length(); ++pos) {
if (name[pos] == '\n' || name[pos] == '\\' || name[pos] == '=') {
// Illegal character.
@@ -113,7 +112,7 @@
return true;
}
-bool OptionsFile::IsLegalValue(const std::string &value) {
+bool OptionsFile::IsLegalValue(const std::string& value) {
for (size_t pos = 0; pos < value.length(); ++pos) {
if (value[pos] == '\n' || value[pos] == '\\') {
// Illegal character.
@@ -125,7 +124,7 @@
}
bool OptionsFile::GetStringValue(const std::string& option,
- std::string *out_val) const {
+ std::string* out_val) const {
RTC_LOG(LS_VERBOSE) << "OptionsFile::GetStringValue " << option;
if (!IsLegalName(option)) {
return false;
@@ -138,8 +137,7 @@
return true;
}
-bool OptionsFile::GetIntValue(const std::string& option,
- int *out_val) const {
+bool OptionsFile::GetIntValue(const std::string& option, int* out_val) const {
RTC_LOG(LS_VERBOSE) << "OptionsFile::GetIntValue " << option;
if (!IsLegalName(option)) {
return false;
@@ -162,8 +160,7 @@
return true;
}
-bool OptionsFile::SetIntValue(const std::string& option,
- int value) {
+bool OptionsFile::SetIntValue(const std::string& option, int value) {
RTC_LOG(LS_VERBOSE) << "OptionsFile::SetIntValue " << option << ":" << value;
if (!IsLegalName(option)) {
return false;