Skip to content

Commit

Permalink
Minor clang-tidy fixups in some of the newer magnum-bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
Skylion007 committed Sep 13, 2022
1 parent 732a0b7 commit f22d377
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions src/python/magnum/gl.cpp
Expand Up @@ -364,10 +364,10 @@ void gl(py::module_& m) {
corrade::enumOperators(contextDetectedDriver);

context
.def_property_readonly_static("has_current", [](py::object) {
.def_property_readonly_static("has_current", [](const py::object&) {
return GL::Context::hasCurrent();
}, "Whether there is any current context")
.def_property_readonly_static("current", [](py::object) {
.def_property_readonly_static("current", [](const py::object&) {
if(!GL::Context::hasCurrent()) {
PyErr_SetString(PyExc_RuntimeError, "no current context");
throw py::error_already_set{};
Expand Down Expand Up @@ -901,7 +901,7 @@ void gl(py::module_& m) {
.def(py::init<MeshPrimitive>(), "Constructor", py::arg("primitive"))
.def_property_readonly("id", &GL::Mesh::id, "OpenGL vertex array ID")
.def_property("primitive", &GL::Mesh::primitive,
[](GL::Mesh& self, py::object primitive) {
[](GL::Mesh& self, const py::object &primitive) {
if(py::isinstance<MeshPrimitive>(primitive))
self.setPrimitive(py::cast<MeshPrimitive>(primitive));
else if(py::isinstance<GL::MeshPrimitive>(primitive))
Expand Down Expand Up @@ -1100,10 +1100,10 @@ void gl(py::module_& m) {
#endif

/** @todo FFS why do I have to pass the class as first argument?! */
.def_property_static("clear_color", nullptr, [](py::object, const Color4& color) {
.def_property_static("clear_color", nullptr, [](const py::object&, const Color4& color) {
GL::Renderer::setClearColor(color);
}, "Set clear color")
.def_property_readonly_static("error", [](py::object) {
.def_property_readonly_static("error", [](const py::object&) {
return GL::Renderer::error();
}, "Error status");
}
Expand Down
2 changes: 1 addition & 1 deletion src/python/magnum/platform/cgl.cpp
Expand Up @@ -63,7 +63,7 @@ void cgl(py::module_& m) {

/* The base doesn't have a virtual destructor because in C++ it's never
deleted through a pointer to the base. Here we need it, though. */
virtual ~PyWindowlessApplication() {}
virtual ~PyWindowlessApplication() = default;
};

py::class_<PyWindowlessApplication, ApplicationHolder<PyWindowlessApplication>> windowlessGlxApplication{m, "WindowlessApplication", "Windowless CGL application"};
Expand Down
2 changes: 1 addition & 1 deletion src/python/magnum/platform/egl.cpp
Expand Up @@ -63,7 +63,7 @@ void egl(py::module_& m) {

/* The base doesn't have a virtual destructor because in C++ it's never
deleted through a pointer to the base. Here we need it, though. */
virtual ~PyWindowlessApplication() {}
virtual ~PyWindowlessApplication() = default;
};

py::class_<PyWindowlessApplication, ApplicationHolder<PyWindowlessApplication>> windowlessEglApplication{m, "WindowlessApplication", "Windowless EGL application"};
Expand Down
2 changes: 1 addition & 1 deletion src/python/magnum/platform/glfw.cpp
Expand Up @@ -64,7 +64,7 @@ void glfw(py::module_& m) {

/* The base doesn't have a virtual destructor because in C++ it's never
deleted through a pointer to the base. Here we need it, though. */
virtual ~PublicizedApplication() {}
virtual ~PublicizedApplication() = default;
};

struct PyApplication: PublicizedApplication {
Expand Down
2 changes: 1 addition & 1 deletion src/python/magnum/platform/glx.cpp
Expand Up @@ -63,7 +63,7 @@ void glx(py::module_& m) {

/* The base doesn't have a virtual destructor because in C++ it's never
deleted through a pointer to the base. Here we need it, though. */
virtual ~PyWindowlessApplication() {}
virtual ~PyWindowlessApplication() = default;
};

py::class_<PyWindowlessApplication, ApplicationHolder<PyWindowlessApplication>> windowlessGlxApplication{m, "WindowlessApplication", "Windowless GLX application"};
Expand Down
2 changes: 1 addition & 1 deletion src/python/magnum/platform/wgl.cpp
Expand Up @@ -63,7 +63,7 @@ void wgl(py::module_& m) {

/* The base doesn't have a virtual destructor because in C++ it's never
deleted through a pointer to the base. Here we need it, though. */
virtual ~PyWindowlessApplication() {}
virtual ~PyWindowlessApplication() = default;
};

py::class_<PyWindowlessApplication, ApplicationHolder<PyWindowlessApplication>> windowlessWglApplication{m, "WindowlessApplication", "Windowless WGL application"};
Expand Down

0 comments on commit f22d377

Please sign in to comment.