From f22d3777d540acc72771114cdbb7140e48da6827 Mon Sep 17 00:00:00 2001 From: Aaron Gokaslan Date: Tue, 13 Sep 2022 11:53:21 -0700 Subject: [PATCH] Minor clang-tidy fixups in some of the newer magnum-bindings --- src/python/magnum/gl.cpp | 10 +++++----- src/python/magnum/platform/cgl.cpp | 2 +- src/python/magnum/platform/egl.cpp | 2 +- src/python/magnum/platform/glfw.cpp | 2 +- src/python/magnum/platform/glx.cpp | 2 +- src/python/magnum/platform/wgl.cpp | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/python/magnum/gl.cpp b/src/python/magnum/gl.cpp index 47c95670..4d128382 100644 --- a/src/python/magnum/gl.cpp +++ b/src/python/magnum/gl.cpp @@ -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{}; @@ -901,7 +901,7 @@ void gl(py::module_& m) { .def(py::init(), "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(primitive)) self.setPrimitive(py::cast(primitive)); else if(py::isinstance(primitive)) @@ -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"); } diff --git a/src/python/magnum/platform/cgl.cpp b/src/python/magnum/platform/cgl.cpp index 3976a048..2832942e 100644 --- a/src/python/magnum/platform/cgl.cpp +++ b/src/python/magnum/platform/cgl.cpp @@ -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_> windowlessGlxApplication{m, "WindowlessApplication", "Windowless CGL application"}; diff --git a/src/python/magnum/platform/egl.cpp b/src/python/magnum/platform/egl.cpp index f5d2afa3..4f45b0af 100644 --- a/src/python/magnum/platform/egl.cpp +++ b/src/python/magnum/platform/egl.cpp @@ -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_> windowlessEglApplication{m, "WindowlessApplication", "Windowless EGL application"}; diff --git a/src/python/magnum/platform/glfw.cpp b/src/python/magnum/platform/glfw.cpp index ecb47bc7..d82d4871 100644 --- a/src/python/magnum/platform/glfw.cpp +++ b/src/python/magnum/platform/glfw.cpp @@ -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 { diff --git a/src/python/magnum/platform/glx.cpp b/src/python/magnum/platform/glx.cpp index ba21b7b4..b08ef6b8 100644 --- a/src/python/magnum/platform/glx.cpp +++ b/src/python/magnum/platform/glx.cpp @@ -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_> windowlessGlxApplication{m, "WindowlessApplication", "Windowless GLX application"}; diff --git a/src/python/magnum/platform/wgl.cpp b/src/python/magnum/platform/wgl.cpp index 23d3bc86..73669e4a 100644 --- a/src/python/magnum/platform/wgl.cpp +++ b/src/python/magnum/platform/wgl.cpp @@ -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_> windowlessWglApplication{m, "WindowlessApplication", "Windowless WGL application"};