tools/remote-compile: clang-format

This was using the old tint code style

Change-Id: I1aff541eb4cc0d7ec0e045b555710aa605c4da28
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/105141
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Auto-Submit: Ben Clayton <bclayton@google.com>
This commit is contained in:
Ben Clayton 2022-10-10 12:17:03 +00:00 committed by Dawn LUCI CQ
parent c8f1075310
commit 467e6e3fc6
6 changed files with 657 additions and 670 deletions

View File

@ -225,8 +225,7 @@ struct CompileRequest : Message { // Client -> Server
/// Writes the message `m` to the stream `s`
template <typename MESSAGE>
std::enable_if_t<std::is_base_of<Message, MESSAGE>::value, Stream>& operator<<(
Stream& s,
std::enable_if_t<std::is_base_of<Message, MESSAGE>::value, Stream>& operator<<(Stream& s,
const MESSAGE& m) {
s << m.type;
const_cast<MESSAGE&>(m).Serialize([&s](const auto& value) { s << value; });
@ -235,8 +234,7 @@ std::enable_if_t<std::is_base_of<Message, MESSAGE>::value, Stream>& operator<<(
/// Reads the message `m` from the stream `s`
template <typename MESSAGE>
std::enable_if_t<std::is_base_of<Message, MESSAGE>::value, Stream>& operator>>(
Stream& s,
std::enable_if_t<std::is_base_of<Message, MESSAGE>::value, Stream>& operator>>(Stream& s,
MESSAGE& m) {
Message::Type ty;
s >> ty;
@ -406,8 +404,7 @@ bool RunClient(std::string address, std::string port, std::string file) {
printf("Couldn't open '%s'\n", file.c_str());
return false;
}
std::string source((std::istreambuf_iterator<char>(input)),
std::istreambuf_iterator<char>());
std::string source((std::istreambuf_iterator<char>(input)), std::istreambuf_iterator<char>());
constexpr const int timeout_ms = 10000;
DEBUG("Connecting to %s:%s...", address.c_str(), port.c_str());

View File

@ -35,8 +35,7 @@ CompileResult CompileMslUsingMetalAPI(const std::string& src) {
return result;
}
NSString* source = [NSString stringWithCString:src.c_str()
encoding:NSUTF8StringEncoding];
NSString* source = [NSString stringWithCString:src.c_str() encoding:NSUTF8StringEncoding];
MTLCompileOptions* compileOptions = [MTLCompileOptions new];
compileOptions.languageVersion = MTLLanguageVersion1_2;

View File

@ -99,14 +99,12 @@ class Impl : public Socket {
auto err = getaddrinfo(address, port, &hints, &info);
#if !defined(_WIN32)
if (err) {
printf("getaddrinfo(%s, %s) error: %s\n", address, port,
gai_strerror(err));
printf("getaddrinfo(%s, %s) error: %s\n", address, port, gai_strerror(err));
}
#endif
if (info) {
auto socket =
::socket(info->ai_family, info->ai_socktype, info->ai_protocol);
auto socket = ::socket(info->ai_family, info->ai_socktype, info->ai_protocol);
auto out = std::make_shared<Impl>(info, socket);
out->setOptions();
return out;
@ -143,20 +141,17 @@ class Impl : public Socket {
#if !defined(_WIN32)
// Prevent sockets lingering after process termination, causing
// reconnection issues on the same port.
setsockopt(s, SOL_SOCKET, SO_REUSEADDR, reinterpret_cast<char*>(&enable),
sizeof(enable));
setsockopt(s, SOL_SOCKET, SO_REUSEADDR, reinterpret_cast<char*>(&enable), sizeof(enable));
struct {
int l_onoff; /* linger active */
int l_linger; /* how many seconds to linger for */
} linger = {false, 0};
setsockopt(s, SOL_SOCKET, SO_LINGER, reinterpret_cast<char*>(&linger),
sizeof(linger));
setsockopt(s, SOL_SOCKET, SO_LINGER, reinterpret_cast<char*>(&linger), sizeof(linger));
#endif // !defined(_WIN32)
// Enable TCP_NODELAY.
setsockopt(s, IPPROTO_TCP, TCP_NODELAY, reinterpret_cast<char*>(&enable),
sizeof(enable));
setsockopt(s, IPPROTO_TCP, TCP_NODELAY, reinterpret_cast<char*>(&enable), sizeof(enable));
}
bool IsOpen() override {
@ -197,8 +192,7 @@ class Impl : public Socket {
if (s == InvalidSocket) {
return 0;
}
auto len =
recv(s, reinterpret_cast<char*>(buffer), static_cast<int>(bytes), 0);
auto len = recv(s, reinterpret_cast<char*>(buffer), static_cast<int>(bytes), 0);
return (len < 0) ? 0 : len;
}
@ -210,8 +204,7 @@ class Impl : public Socket {
if (bytes == 0) {
return true;
}
return ::send(s, reinterpret_cast<const char*>(buffer),
static_cast<int>(bytes), 0) > 0;
return ::send(s, reinterpret_cast<const char*>(buffer), static_cast<int>(bytes), 0) > 0;
}
std::shared_ptr<Socket> Accept() override {
@ -268,8 +261,7 @@ std::shared_ptr<Socket> Socket::Connect(const char* address,
}
if (timeoutMillis == 0) {
if (::connect(socket, info->ai_addr,
static_cast<int>(info->ai_addrlen)) == 0) {
if (::connect(socket, info->ai_addr, static_cast<int>(info->ai_addrlen)) == 0) {
out = impl;
}
return;
@ -279,8 +271,7 @@ std::shared_ptr<Socket> Socket::Connect(const char* address,
return;
}
auto res =
::connect(socket, info->ai_addr, static_cast<int>(info->ai_addrlen));
auto res = ::connect(socket, info->ai_addr, static_cast<int>(info->ai_addrlen));
if (res == 0) {
if (setBlocking(socket, true)) {
out = impl;