Skip to content

Commit 4c57618

Browse files
committed
Resolve clang-tidy errors
``` /__w/pybind11/pybind11/tests/test_callbacks.cpp:33:9: error: 'auto rec' can be declared as 'auto *rec' [readability-qualified-auto,-warnings-as-errors] 33 | auto rec = c.get_pointer<py::detail::function_record>(); | ^~~~ | auto * /__w/pybind11/pybind11/tests/test_callbacks.cpp:41:13: error: 'auto cap' can be declared as 'auto *cap' [readability-qualified-auto,-warnings-as-errors] 41 | auto cap = reinterpret_cast<capture *>(&rec->data); | ^~~~ | auto * ```
1 parent e8e0660 commit 4c57618

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/test_callbacks.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ double apply_custom_transform(const py::object &src, double value) {
3030
if (auto cfunc = func.cpp_function()) {
3131
auto c = py::reinterpret_borrow<py::capsule>(PyCFunction_GET_SELF(cfunc.ptr()));
3232

33-
auto rec = c.get_pointer<py::detail::function_record>();
33+
auto *rec = c.get_pointer<py::detail::function_record>();
3434

3535
if (rec && rec->is_stateless
3636
&& py::detail::same_type(typeid(raw_t *),
3737
*reinterpret_cast<const std::type_info *>(rec->data[1]))) {
3838
struct capture {
3939
raw_t *f;
4040
};
41-
auto cap = reinterpret_cast<capture *>(&rec->data);
41+
auto *cap = reinterpret_cast<capture *>(&rec->data);
4242
return (*cap->f)(value);
4343
}
4444
return -200;

0 commit comments

Comments
 (0)