mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[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:
@@ -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. */
|
||||
@@ -107,8 +107,7 @@ std::unique_ptr<NetworkStream> TCPConnector::connect_parallel(
|
||||
}
|
||||
++result->count;
|
||||
result->cv.notify_all();
|
||||
})
|
||||
.detach();
|
||||
}).detach();
|
||||
}
|
||||
|
||||
// wait for a result, timeout, or all finished
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2018 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2018-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. */
|
||||
@@ -19,17 +19,18 @@ GetNameInfoReq::GetNameInfoReq() {
|
||||
|
||||
void GetNameInfo(Loop& loop, const std::shared_ptr<GetNameInfoReq>& req,
|
||||
const sockaddr& addr, int flags) {
|
||||
int err = uv_getnameinfo(loop.GetRaw(), req->GetRaw(),
|
||||
[](uv_getnameinfo_t* req, int status,
|
||||
const char* hostname, const char* service) {
|
||||
auto& h = *static_cast<GetNameInfoReq*>(req->data);
|
||||
if (status < 0)
|
||||
h.ReportError(status);
|
||||
else
|
||||
h.resolved(hostname, service);
|
||||
h.Release(); // this is always a one-shot
|
||||
},
|
||||
&addr, flags);
|
||||
int err = uv_getnameinfo(
|
||||
loop.GetRaw(), req->GetRaw(),
|
||||
[](uv_getnameinfo_t* req, int status, const char* hostname,
|
||||
const char* service) {
|
||||
auto& h = *static_cast<GetNameInfoReq*>(req->data);
|
||||
if (status < 0)
|
||||
h.ReportError(status);
|
||||
else
|
||||
h.resolved(hostname, service);
|
||||
h.Release(); // this is always a one-shot
|
||||
},
|
||||
&addr, flags);
|
||||
if (err < 0)
|
||||
loop.ReportError(err);
|
||||
else
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2018 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2018-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. */
|
||||
@@ -49,13 +49,14 @@ void Loop::Close() {
|
||||
}
|
||||
|
||||
void Loop::Walk(std::function<void(Handle&)> callback) {
|
||||
uv_walk(m_loop,
|
||||
[](uv_handle_t* handle, void* func) {
|
||||
auto& h = *static_cast<Handle*>(handle->data);
|
||||
auto& f = *static_cast<std::function<void(Handle&)>*>(func);
|
||||
f(h);
|
||||
},
|
||||
&callback);
|
||||
uv_walk(
|
||||
m_loop,
|
||||
[](uv_handle_t* handle, void* func) {
|
||||
auto& h = *static_cast<Handle*>(handle->data);
|
||||
auto& f = *static_cast<std::function<void(Handle&)>*>(func);
|
||||
f(h);
|
||||
},
|
||||
&callback);
|
||||
}
|
||||
|
||||
void Loop::Fork() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2018 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2018-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. */
|
||||
@@ -24,12 +24,13 @@ std::shared_ptr<Signal> Signal::Create(Loop& loop) {
|
||||
}
|
||||
|
||||
void Signal::Start(int signum) {
|
||||
Invoke(&uv_signal_start, GetRaw(),
|
||||
[](uv_signal_t* handle, int signum) {
|
||||
Signal& h = *static_cast<Signal*>(handle->data);
|
||||
h.signal(signum);
|
||||
},
|
||||
signum);
|
||||
Invoke(
|
||||
&uv_signal_start, GetRaw(),
|
||||
[](uv_signal_t* handle, int signum) {
|
||||
Signal& h = *static_cast<Signal*>(handle->data);
|
||||
h.signal(signum);
|
||||
},
|
||||
signum);
|
||||
}
|
||||
|
||||
} // namespace uv
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2018-2019 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2018-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. */
|
||||
@@ -34,12 +34,13 @@ void Timer::SingleShot(Loop& loop, Time timeout, std::function<void()> func) {
|
||||
}
|
||||
|
||||
void Timer::Start(Time timeout, Time repeat) {
|
||||
Invoke(&uv_timer_start, GetRaw(),
|
||||
[](uv_timer_t* handle) {
|
||||
Timer& h = *static_cast<Timer*>(handle->data);
|
||||
h.timeout();
|
||||
},
|
||||
timeout.count(), repeat.count());
|
||||
Invoke(
|
||||
&uv_timer_start, GetRaw(),
|
||||
[](uv_timer_t* handle) {
|
||||
Timer& h = *static_cast<Timer*>(handle->data);
|
||||
h.timeout();
|
||||
},
|
||||
timeout.count(), repeat.count());
|
||||
}
|
||||
|
||||
} // namespace uv
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2018 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2018-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. */
|
||||
@@ -17,19 +17,20 @@ WorkReq::WorkReq() {
|
||||
}
|
||||
|
||||
void QueueWork(Loop& loop, const std::shared_ptr<WorkReq>& req) {
|
||||
int err = uv_queue_work(loop.GetRaw(), req->GetRaw(),
|
||||
[](uv_work_t* req) {
|
||||
auto& h = *static_cast<WorkReq*>(req->data);
|
||||
h.work();
|
||||
},
|
||||
[](uv_work_t* req, int status) {
|
||||
auto& h = *static_cast<WorkReq*>(req->data);
|
||||
if (status < 0)
|
||||
h.ReportError(status);
|
||||
else
|
||||
h.afterWork();
|
||||
h.Release(); // this is always a one-shot
|
||||
});
|
||||
int err = uv_queue_work(
|
||||
loop.GetRaw(), req->GetRaw(),
|
||||
[](uv_work_t* req) {
|
||||
auto& h = *static_cast<WorkReq*>(req->data);
|
||||
h.work();
|
||||
},
|
||||
[](uv_work_t* req, int status) {
|
||||
auto& h = *static_cast<WorkReq*>(req->data);
|
||||
if (status < 0)
|
||||
h.ReportError(status);
|
||||
else
|
||||
h.afterWork();
|
||||
h.Release(); // this is always a one-shot
|
||||
});
|
||||
if (err < 0)
|
||||
loop.ReportError(err);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user