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/modules/audio_coding/test/PCMFile.cc b/modules/audio_coding/test/PCMFile.cc
index 2b2f1f0..659f968 100644
--- a/modules/audio_coding/test/PCMFile.cc
+++ b/modules/audio_coding/test/PCMFile.cc
@@ -30,8 +30,8 @@
rewinded_(false),
read_stereo_(false),
save_stereo_(false) {
- timestamp_ = (((uint32_t) rand() & 0x0000FFFF) << 16) |
- ((uint32_t) rand() & 0x0000FFFF);
+ timestamp_ =
+ (((uint32_t)rand() & 0x0000FFFF) << 16) | ((uint32_t)rand() & 0x0000FFFF);
}
PCMFile::PCMFile(uint32_t timestamp)
@@ -52,7 +52,8 @@
}
}
-int16_t PCMFile::ChooseFile(std::string* file_name, int16_t max_len,
+int16_t PCMFile::ChooseFile(std::string* file_name,
+ int16_t max_len,
uint16_t* frequency_hz) {
char tmp_name[MAX_FILE_NAME_LENGTH_BYTE];
@@ -61,8 +62,8 @@
int16_t n = 0;
// Removing trailing spaces.
- while ((isspace(tmp_name[n]) || iscntrl(tmp_name[n])) && (tmp_name[n] != 0)
- && (n < MAX_FILE_NAME_LENGTH_BYTE)) {
+ while ((isspace(tmp_name[n]) || iscntrl(tmp_name[n])) && (tmp_name[n] != 0) &&
+ (n < MAX_FILE_NAME_LENGTH_BYTE)) {
n++;
}
if (n > 0) {
@@ -80,7 +81,7 @@
tmp_name[n + 1] = '\0';
}
- int16_t len = (int16_t) strlen(tmp_name);
+ int16_t len = (int16_t)strlen(tmp_name);
if (len > max_len) {
return -1;
}
@@ -91,15 +92,17 @@
printf("Enter the sampling frequency (in Hz) of the above file [%u]: ",
*frequency_hz);
EXPECT_TRUE(fgets(tmp_name, 10, stdin) != NULL);
- uint16_t tmp_frequency = (uint16_t) atoi(tmp_name);
+ uint16_t tmp_frequency = (uint16_t)atoi(tmp_name);
if (tmp_frequency > 0) {
*frequency_hz = tmp_frequency;
}
return 0;
}
-void PCMFile::Open(const std::string& file_name, uint16_t frequency,
- const char* mode, bool auto_rewind) {
+void PCMFile::Open(const std::string& file_name,
+ uint16_t frequency,
+ const char* mode,
+ bool auto_rewind) {
if ((pcm_file_ = fopen(file_name.c_str(), mode)) == NULL) {
printf("Cannot open file %s.\n", file_name.c_str());
ADD_FAILURE() << "Unable to read file";
@@ -125,9 +128,9 @@
channels = 2;
}
- int32_t payload_size = (int32_t) fread(audio_frame.mutable_data(),
- sizeof(uint16_t),
- samples_10ms_ * channels, pcm_file_);
+ int32_t payload_size =
+ (int32_t)fread(audio_frame.mutable_data(), sizeof(uint16_t),
+ samples_10ms_ * channels, pcm_file_);
if (payload_size < samples_10ms_ * channels) {
int16_t* frame_data = audio_frame.mutable_data();
for (int k = payload_size; k < samples_10ms_ * channels; k++) {