From a42018d075cf8aebbbf9ef4411c988e6f65748f3 Mon Sep 17 00:00:00 2001 From: Aaron Gokaslan Date: Tue, 15 Jun 2021 18:21:16 +0200 Subject: [PATCH] python: don't carelessly copy py::args and py::kwargs. --- src/python/magnum/math.matrix.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/python/magnum/math.matrix.h b/src/python/magnum/math.matrix.h index 7baba7a..1dc1537 100644 --- a/src/python/magnum/math.matrix.h +++ b/src/python/magnum/math.matrix.h @@ -686,7 +686,7 @@ Overloaded function. so we create a scaling(*args, **kwargs) and dispatch ourselves. */ .def_static("_sscaling", static_cast(*)(const Math::Vector2&)>(&Math::Matrix3::scaling)) .def("_iscaling", static_cast(Math::Matrix3::*)() const>(&Math::Matrix3::scaling)) - .def("scaling", [matrix3](py::args args, py::kwargs kwargs) { + .def("scaling", [matrix3](const py::args& args, const py::kwargs& kwargs) { if(py::len(args) && py::isinstance>(args[0])) { return matrix3.attr("_iscaling")(*args, **kwargs); } else { @@ -700,7 +700,7 @@ Overloaded function. return Math::Matrix3::rotation(Math::Rad(angle)); }) .def("_irotation", static_cast(Math::Matrix3::*)() const>(&Math::Matrix3::rotation)) - .def("rotation", [matrix3](py::args args, py::kwargs kwargs) { + .def("rotation", [matrix3](const py::args& args, const py::kwargs& kwargs) { if(py::len(args) && py::isinstance>(args[0])) { return matrix3.attr("_irotation")(*args, **kwargs); } else { @@ -896,7 +896,7 @@ Overloaded function. so we create a scaling(*args, **kwargs) and dispatch ourselves. */ .def_static("_sscaling", static_cast(*)(const Math::Vector3&)>(&Math::Matrix4::scaling)) .def("_iscaling", static_cast(Math::Matrix4::*)() const>(&Math::Matrix4::scaling)) - .def("scaling", [matrix4](py::args args, py::kwargs kwargs) { + .def("scaling", [matrix4](const py::args& args, const py::kwargs& kwargs) { if(py::len(args) && py::isinstance>(args[0])) { return matrix4.attr("_iscaling")(*args, **kwargs); } else { @@ -910,7 +910,7 @@ Overloaded function. return Math::Matrix4::rotation(Math::Rad(angle), axis); }) .def("_irotation", static_cast(Math::Matrix4::*)() const>(&Math::Matrix4::rotation)) - .def("rotation", [matrix4](py::args args, py::kwargs kwargs) { + .def("rotation", [matrix4](const py::args& args, const py::kwargs& kwargs) { if(py::len(args) && py::isinstance>(args[0])) { return matrix4.attr("_irotation")(*args, **kwargs); } else {