[build] Upgrade CI to clang-format 10.0 (#1961)

MacOS no longer ships 6.0, and Arch Linux's mesa GPU drivers are no longer compatible with LLVM 6.0.
This commit is contained in:
Tyler Veness
2020-06-27 20:39:00 -07:00
committed by GitHub
parent 9796987d59
commit 22c0e2813a
62 changed files with 613 additions and 435 deletions

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2015-2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2015-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -135,18 +135,18 @@ void NetworkConnection::ReadThreadMain() {
WireDecoder decoder(is, m_proto_rev, m_logger);
set_state(kHandshake);
if (!m_handshake(*this,
[&] {
decoder.set_proto_rev(m_proto_rev);
auto msg = Message::Read(decoder, m_get_entry_type);
if (!msg && decoder.error())
DEBUG0(
"error reading in handshake: " << decoder.error());
return msg;
},
[&](wpi::ArrayRef<std::shared_ptr<Message>> msgs) {
m_outgoing.emplace(msgs);
})) {
if (!m_handshake(
*this,
[&] {
decoder.set_proto_rev(m_proto_rev);
auto msg = Message::Read(decoder, m_get_entry_type);
if (!msg && decoder.error())
DEBUG0("error reading in handshake: " << decoder.error());
return msg;
},
[&](wpi::ArrayRef<std::shared_ptr<Message>> msgs) {
m_outgoing.emplace(msgs);
})) {
set_state(kDead);
m_active = false;
goto done;

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2015-2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2015-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -1053,14 +1053,15 @@ unsigned int Storage::CallRpc(unsigned int local_id, StringRef params) {
conn_info.last_update = wpi::Now();
conn_info.protocol_version = 0x0300;
unsigned int call_uid = msg->seq_num_uid();
m_rpc_server.ProcessRpc(local_id, call_uid, name, msg->str(), conn_info,
[=](StringRef result) {
std::scoped_lock lock(m_mutex);
m_rpc_results.insert(std::make_pair(
RpcIdPair{local_id, call_uid}, result));
m_rpc_results_cond.notify_all();
},
rpc_uid);
m_rpc_server.ProcessRpc(
local_id, call_uid, name, msg->str(), conn_info,
[=](StringRef result) {
std::scoped_lock lock(m_mutex);
m_rpc_results.insert(
std::make_pair(RpcIdPair{local_id, call_uid}, result));
m_rpc_results_cond.notify_all();
},
rpc_uid);
} else {
auto dispatcher = m_dispatcher;
lock.unlock();

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2017-2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2017-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -233,13 +233,13 @@ NT_EntryListener NetworkTable::AddEntryListener(const Twine& key,
unsigned int flags) const {
size_t prefix_len = m_path.size() + 1;
auto entry = GetEntry(key);
return nt::AddEntryListener(entry.GetHandle(),
[=](const EntryNotification& event) {
listener(const_cast<NetworkTable*>(this),
event.name.substr(prefix_len), entry,
event.value, event.flags);
},
flags);
return nt::AddEntryListener(
entry.GetHandle(),
[=](const EntryNotification& event) {
listener(const_cast<NetworkTable*>(this), event.name.substr(prefix_len),
entry, event.value, event.flags);
},
flags);
}
void NetworkTable::RemoveEntryListener(NT_EntryListener listener) const {

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2015-2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2015-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -260,27 +260,29 @@ NT_EntryListener NT_AddEntryListener(NT_Inst inst, const char* prefix,
size_t prefix_len, void* data,
NT_EntryListenerCallback callback,
unsigned int flags) {
return nt::AddEntryListener(inst, StringRef(prefix, prefix_len),
[=](const EntryNotification& event) {
NT_EntryNotification c_event;
ConvertToC(event, &c_event);
callback(data, &c_event);
DisposeEntryNotification(&c_event);
},
flags);
return nt::AddEntryListener(
inst, StringRef(prefix, prefix_len),
[=](const EntryNotification& event) {
NT_EntryNotification c_event;
ConvertToC(event, &c_event);
callback(data, &c_event);
DisposeEntryNotification(&c_event);
},
flags);
}
NT_EntryListener NT_AddEntryListenerSingle(NT_Entry entry, void* data,
NT_EntryListenerCallback callback,
unsigned int flags) {
return nt::AddEntryListener(entry,
[=](const EntryNotification& event) {
NT_EntryNotification c_event;
ConvertToC(event, &c_event);
callback(data, &c_event);
DisposeEntryNotification(&c_event);
},
flags);
return nt::AddEntryListener(
entry,
[=](const EntryNotification& event) {
NT_EntryNotification c_event;
ConvertToC(event, &c_event);
callback(data, &c_event);
DisposeEntryNotification(&c_event);
},
flags);
}
NT_EntryListenerPoller NT_CreateEntryListenerPoller(NT_Inst inst) {
@@ -335,14 +337,15 @@ NT_Bool NT_WaitForEntryListenerQueue(NT_Inst inst, double timeout) {
NT_ConnectionListener NT_AddConnectionListener(
NT_Inst inst, void* data, NT_ConnectionListenerCallback callback,
NT_Bool immediate_notify) {
return nt::AddConnectionListener(inst,
[=](const ConnectionNotification& event) {
NT_ConnectionNotification event_c;
ConvertToC(event, &event_c);
callback(data, &event_c);
DisposeConnectionNotification(&event_c);
},
immediate_notify != 0);
return nt::AddConnectionListener(
inst,
[=](const ConnectionNotification& event) {
NT_ConnectionNotification event_c;
ConvertToC(event, &event_c);
callback(data, &event_c);
DisposeConnectionNotification(&event_c);
},
immediate_notify != 0);
}
NT_ConnectionListenerPoller NT_CreateConnectionListenerPoller(NT_Inst inst) {
@@ -639,14 +642,15 @@ uint64_t NT_Now(void) { return wpi::Now(); }
NT_Logger NT_AddLogger(NT_Inst inst, void* data, NT_LogFunc func,
unsigned int min_level, unsigned int max_level) {
return nt::AddLogger(inst,
[=](const LogMessage& msg) {
NT_LogMessage msg_c;
ConvertToC(msg, &msg_c);
func(data, &msg_c);
NT_DisposeLogMessage(&msg_c);
},
min_level, max_level);
return nt::AddLogger(
inst,
[=](const LogMessage& msg) {
NT_LogMessage msg_c;
ConvertToC(msg, &msg_c);
func(data, &msg_c);
NT_DisposeLogMessage(&msg_c);
},
min_level, max_level);
}
NT_LoggerPoller NT_CreateLoggerPoller(NT_Inst inst) {