mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-02 02:51:42 +00:00
[robotpy] Run wpiformat on non-python robotpy files (#8362)
This turns the styleguide on for the non-python robotpy files. The overwhelming amount of changes were related to whitespace, followed by some IWYU for standard library headers.
This commit is contained in:
@@ -1,20 +1,19 @@
|
||||
|
||||
#include <semiwrap_init.halsim_gui._ext._halsim_gui_ext.hpp>
|
||||
|
||||
#include <functional>
|
||||
|
||||
#include <wpi/halsim/gui/HALSimGuiExt.hpp>
|
||||
#include <wpi/hal/Extensions.h>
|
||||
#include <wpi/halsim/gui/HALSimGuiExt.hpp>
|
||||
|
||||
#include "semiwrap_init.halsim_gui._ext._halsim_gui_ext.hpp"
|
||||
|
||||
std::function<void()> g_gui_exit;
|
||||
|
||||
SEMIWRAP_PYBIND11_MODULE(m) {
|
||||
|
||||
initWrapper(m);
|
||||
|
||||
m.def("_kill_on_signal", []() {
|
||||
HAL_RegisterExtensionListener(
|
||||
nullptr, [](void *, const char *name, void *data) {
|
||||
nullptr, [](void*, const char* name, void* data) {
|
||||
std::string_view name_view{name};
|
||||
if (name_view == HALSIMGUI_EXT_GUIEXIT) {
|
||||
g_gui_exit = (halsimgui::GuiExitFn)data;
|
||||
@@ -23,14 +22,14 @@ SEMIWRAP_PYBIND11_MODULE(m) {
|
||||
AddGuiLateExecute([] {
|
||||
py::gil_scoped_acquire gil;
|
||||
if (PyErr_CheckSignals() == -1) {
|
||||
|
||||
// If a python signal has been triggered, the GUI needs to exit. It's
|
||||
// not safe to throw an exception here on all platforms so we just
|
||||
// assume that the only eventual caller of this function is HAL_RunMain,
|
||||
// and our wrapper around that function will check if a python error is
|
||||
// set and throw from there.
|
||||
// If a python signal has been triggered, the GUI needs to exit.
|
||||
// It's not safe to throw an exception here on all platforms so
|
||||
// we just assume that the only eventual caller of this function
|
||||
// is HAL_RunMain, and our wrapper around that function will
|
||||
// check if a python error is set and throw from there.
|
||||
//
|
||||
// Reference: https://github.com/wpilibsuite/allwpilib/issues/8528
|
||||
// Reference:
|
||||
// https://github.com/wpilibsuite/allwpilib/issues/8528
|
||||
if (g_gui_exit) {
|
||||
g_gui_exit();
|
||||
} else {
|
||||
@@ -41,4 +40,4 @@ SEMIWRAP_PYBIND11_MODULE(m) {
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user