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/asyncudpsocket.cc b/rtc_base/asyncudpsocket.cc
index d8e60b9..ba5fa88 100644
--- a/rtc_base/asyncudpsocket.cc
+++ b/rtc_base/asyncudpsocket.cc
@@ -16,9 +16,8 @@
static const int BUF_SIZE = 64 * 1024;
-AsyncUDPSocket* AsyncUDPSocket::Create(
- AsyncSocket* socket,
- const SocketAddress& bind_address) {
+AsyncUDPSocket* AsyncUDPSocket::Create(AsyncSocket* socket,
+ const SocketAddress& bind_address) {
std::unique_ptr<AsyncSocket> owned_socket(socket);
if (socket->Bind(bind_address) < 0) {
RTC_LOG(LS_ERROR) << "Bind() failed with error " << socket->GetError();
@@ -36,8 +35,7 @@
return Create(socket, bind_address);
}
-AsyncUDPSocket::AsyncUDPSocket(AsyncSocket* socket)
- : socket_(socket) {
+AsyncUDPSocket::AsyncUDPSocket(AsyncSocket* socket) : socket_(socket) {
size_ = BUF_SIZE;
buf_ = new char[size_];
@@ -47,7 +45,7 @@
}
AsyncUDPSocket::~AsyncUDPSocket() {
- delete [] buf_;
+ delete[] buf_;
}
SocketAddress AsyncUDPSocket::GetLocalAddress() const {
@@ -58,7 +56,8 @@
return socket_->GetRemoteAddress();
}
-int AsyncUDPSocket::Send(const void *pv, size_t cb,
+int AsyncUDPSocket::Send(const void* pv,
+ size_t cb,
const rtc::PacketOptions& options) {
rtc::SentPacket sent_packet(options.packet_id, rtc::TimeMillis(),
options.info_signaled_after_sent);
@@ -68,7 +67,8 @@
return ret;
}
-int AsyncUDPSocket::SendTo(const void *pv, size_t cb,
+int AsyncUDPSocket::SendTo(const void* pv,
+ size_t cb,
const SocketAddress& addr,
const rtc::PacketOptions& options) {
rtc::SentPacket sent_packet(options.packet_id, rtc::TimeMillis(),
@@ -117,8 +117,7 @@
// TODO: Do something better like forwarding the error to the user.
SocketAddress local_addr = socket_->GetLocalAddress();
RTC_LOG(LS_INFO) << "AsyncUDPSocket[" << local_addr.ToSensitiveString()
- << "] receive failed with error "
- << socket_->GetError();
+ << "] receive failed with error " << socket_->GetError();
return;
}