From 144d01850bd3e07222d3f8696debec689dcdccf5 Mon Sep 17 00:00:00 2001 From: Donald Curtis Date: Fri, 15 May 2015 13:14:24 -0700 Subject: [PATCH] fix indent on tokenize_first function signatures R=juberti@google.com, pthatcher@webrtc.org Review URL: https://webrtc-codereview.appspot.com/52499004 Cr-Commit-Position: refs/heads/master@{#9198} --- talk/app/webrtc/webrtcsdp.cc | 23 ++++++++++------------- talk/app/webrtc/webrtcsdp_unittest.cc | 7 +++---- webrtc/base/stringencode.cc | 8 +++++--- webrtc/base/stringencode.h | 6 ++++-- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/talk/app/webrtc/webrtcsdp.cc b/talk/app/webrtc/webrtcsdp.cc index 3ad6a92f4e..aaf9d71940 100644 --- a/talk/app/webrtc/webrtcsdp.cc +++ b/talk/app/webrtc/webrtcsdp.cc @@ -974,8 +974,8 @@ bool ParseCandidate(const std::string& message, Candidate* candidate, std::string candidate_value; // |first_line| must be in the form of "candidate:". - if (!rtc::tokenize_first(first_line, kSdpDelimiterColon, - &attribute_candidate, &candidate_value) || + if (!rtc::tokenize_first(first_line, kSdpDelimiterColon, &attribute_candidate, + &candidate_value) || attribute_candidate != kAttributeCandidate) { if (is_raw) { std::ostringstream description; @@ -2734,10 +2734,8 @@ bool ParseSsrcAttribute(const std::string& line, SsrcInfoVec* ssrc_infos, // a=ssrc: // a=ssrc: : std::string field1, field2; - if (!rtc::tokenize_first(line.substr(kLinePrefixLength), - kSdpDelimiterSpace, - &field1, - &field2)) { + if (!rtc::tokenize_first(line.substr(kLinePrefixLength), kSdpDelimiterSpace, + &field1, &field2)) { const size_t expected_fields = 2; return ParseFailedExpectFieldNum(line, expected_fields, error); } @@ -2754,8 +2752,7 @@ bool ParseSsrcAttribute(const std::string& line, SsrcInfoVec* ssrc_infos, std::string attribute; std::string value; - if (!rtc::tokenize_first(field2, kSdpDelimiterColon, - &attribute, &value)) { + if (!rtc::tokenize_first(field2, kSdpDelimiterColon, &attribute, &value)) { std::ostringstream description; description << "Failed to get the ssrc attribute value from " << field2 << ". Expected format :."; @@ -3026,8 +3023,8 @@ bool ParseFmtpAttributes(const std::string& line, const MediaType media_type, // a=fmtp: // At least two fields, whereas the second one is any of the optional // parameters. - if(!rtc::tokenize_first(line.substr(kLinePrefixLength), kSdpDelimiterSpace, - &line_payload, &line_params)) { + if (!rtc::tokenize_first(line.substr(kLinePrefixLength), kSdpDelimiterSpace, + &line_payload, &line_params)) { ParseFailedExpectMinFieldNum(line, 2, error); return false; } @@ -3039,8 +3036,8 @@ bool ParseFmtpAttributes(const std::string& line, const MediaType media_type, } int payload_type = 0; - if (!GetPayloadTypeFromString(line_payload, payload_type_str, - &payload_type, error)) { + if (!GetPayloadTypeFromString(line_payload, payload_type_str, &payload_type, + error)) { return false; } @@ -3049,7 +3046,7 @@ bool ParseFmtpAttributes(const std::string& line, const MediaType media_type, rtc::split(line_params, kSdpDelimiterSemicolon, &fields); cricket::CodecParameterMap codec_params; - for (auto &iter : fields) { + for (auto& iter : fields) { if (iter.find(kSdpDelimiterEqual) == std::string::npos) { // Only fmtps with equals are currently supported. Other fmtp types // should be ignored. Unknown fmtps do not constitute an error. diff --git a/talk/app/webrtc/webrtcsdp_unittest.cc b/talk/app/webrtc/webrtcsdp_unittest.cc index 4fe18e8966..2bd6f6d668 100644 --- a/talk/app/webrtc/webrtcsdp_unittest.cc +++ b/talk/app/webrtc/webrtcsdp_unittest.cc @@ -1207,8 +1207,7 @@ class WebRtcSdpTest : public testing::Test { "a=fmtp:111 0-15,66,70\r\n" "a=fmtp:111 "; std::ostringstream os; - os << "minptime=" << params.min_ptime - << "; stereo=" << params.stereo + os << "minptime=" << params.min_ptime << "; stereo=" << params.stereo << "; sprop-stereo=" << params.sprop_stereo << "; useinbandfec=" << params.useinband << "; maxaveragebitrate=" << params.maxaveragebitrate << "\r\n" @@ -2508,8 +2507,8 @@ TEST_F(WebRtcSdpTest, DeserializeVideoFmtp) { // Deserialize SdpParseError error; - EXPECT_TRUE(webrtc::SdpDeserialize(kSdpWithFmtpString, &jdesc_output, - &error)); + EXPECT_TRUE( + webrtc::SdpDeserialize(kSdpWithFmtpString, &jdesc_output, &error)); const ContentInfo* vc = GetFirstVideoContent(jdesc_output.description()); ASSERT_TRUE(vc != NULL); diff --git a/webrtc/base/stringencode.cc b/webrtc/base/stringencode.cc index 880538d4e9..c48c52634c 100644 --- a/webrtc/base/stringencode.cc +++ b/webrtc/base/stringencode.cc @@ -611,8 +611,10 @@ size_t tokenize(const std::string& source, char delimiter, char start_mark, return tokenize_append(remain_source, delimiter, fields); } -bool tokenize_first(const std::string& source, const char delimiter, - std::string* token, std::string* rest) { +bool tokenize_first(const std::string& source, + const char delimiter, + std::string* token, + std::string* rest) { // Find the first delimiter size_t left_pos = source.find(delimiter); if (left_pos == std::string::npos) { @@ -621,7 +623,7 @@ bool tokenize_first(const std::string& source, const char delimiter, // Look for additional occurrances of delimiter. size_t right_pos = left_pos + 1; - while(source[right_pos] == delimiter) { + while (source[right_pos] == delimiter) { right_pos++; } diff --git a/webrtc/base/stringencode.h b/webrtc/base/stringencode.h index df163dd34e..356844cf8b 100644 --- a/webrtc/base/stringencode.h +++ b/webrtc/base/stringencode.h @@ -163,8 +163,10 @@ size_t tokenize(const std::string& source, char delimiter, char start_mark, // Extract the first token from source as separated by delimiter, with // duplicates of delimiter ignored. Return false if the delimiter could not be // found, otherwise return true. -bool tokenize_first(const std::string& source, const char delimiter, - std::string* token, std::string* rest); +bool tokenize_first(const std::string& source, + const char delimiter, + std::string* token, + std::string* rest); // Safe sprintf to std::string //void sprintf(std::string& value, size_t maxlen, const char * format, ...)