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/utility.cc b/modules/audio_coding/test/utility.cc
index 3c64620..83c25b5 100644
--- a/modules/audio_coding/test/utility.cc
+++ b/modules/audio_coding/test/utility.cc
@@ -23,11 +23,7 @@
namespace webrtc {
-ACMTestTimer::ACMTestTimer()
- : _msec(0),
- _sec(0),
- _min(0),
- _hour(0) {
+ACMTestTimer::ACMTestTimer() : _msec(0), _sec(0), _min(0), _hour(0) {
return;
}
@@ -68,12 +64,14 @@
void ACMTestTimer::CurrentTimeHMS(char* currTime) {
sprintf(currTime, "%4lu:%02u:%06.3f", _hour, _min,
- (double) _sec + (double) _msec / 1000.);
+ (double)_sec + (double)_msec / 1000.);
return;
}
-void ACMTestTimer::CurrentTime(unsigned long& h, unsigned char& m,
- unsigned char& s, unsigned short& ms) {
+void ACMTestTimer::CurrentTime(unsigned long& h,
+ unsigned char& m,
+ unsigned char& s,
+ unsigned short& ms) {
h = _hour;
m = _min;
s = _sec;
@@ -101,9 +99,8 @@
}
int16_t ChooseCodec(CodecInst& codecInst) {
-
PrintCodecs();
- //AudioCodingModule* tmpACM = AudioCodingModule::Create(0);
+ // AudioCodingModule* tmpACM = AudioCodingModule::Create(0);
uint8_t noCodec = AudioCodingModule::NumberOfCodecs();
int8_t codecID;
bool outOfRange = false;
@@ -118,7 +115,7 @@
}
} while (outOfRange);
- CHECK_ERROR(AudioCodingModule::Codec((uint8_t )codecID, &codecInst));
+ CHECK_ERROR(AudioCodingModule::Codec((uint8_t)codecID, &codecInst));
return 0;
}
@@ -132,7 +129,6 @@
printf("%2d- %-18s %5d %6d\n", codecCntr, codecInst.plname,
codecInst.plfreq, codecInst.rate);
}
-
}
namespace test {
@@ -192,7 +188,7 @@
if (_calcVar) {
// to calculate variance we have to update
// the sum of squares
- _sumSqr += (double) (newVal - oldVal) * (double) (newVal + oldVal);
+ _sumSqr += (double)(newVal - oldVal) * (double)(newVal + oldVal);
}
}
@@ -236,17 +232,15 @@
assert(_buffLen > 0);
if (_buffIsFull) {
-
- mean = _sum / (double) _buffLen;
+ mean = _sum / (double)_buffLen;
return 0;
} else {
if (_idx > 0) {
- mean = _sum / (double) _idx;
+ mean = _sum / (double)_idx;
return 0;
} else {
return -1;
}
-
}
}
@@ -254,11 +248,11 @@
assert(_buffLen > 0);
if (_buffIsFull) {
- var = _sumSqr / (double) _buffLen;
+ var = _sumSqr / (double)_buffLen;
return 0;
} else {
if (_idx > 0) {
- var = _sumSqr / (double) _idx;
+ var = _sumSqr / (double)_idx;
return 0;
} else {
return -1;
@@ -269,9 +263,9 @@
} // namespace test
bool FixedPayloadTypeCodec(const char* payloadName) {
- char fixPayloadTypeCodecs[NUM_CODECS_WITH_FIXED_PAYLOAD_TYPE][32] = { "PCMU",
- "PCMA", "GSM", "G723", "DVI4", "LPC", "PCMA", "G722", "QCELP", "CN",
- "MPA", "G728", "G729" };
+ char fixPayloadTypeCodecs[NUM_CODECS_WITH_FIXED_PAYLOAD_TYPE][32] = {
+ "PCMU", "PCMA", "GSM", "G723", "DVI4", "LPC", "PCMA",
+ "G722", "QCELP", "CN", "MPA", "G728", "G729"};
for (int n = 0; n < NUM_CODECS_WITH_FIXED_PAYLOAD_TYPE; n++) {
if (!STR_CASE_CMP(payloadName, fixPayloadTypeCodecs[n])) {