Resolve clang-tidy errors and warnings.

This commit is contained in:
Ralf W. Grosse-Kunstleve 2024-07-07 09:43:53 -07:00
parent 56019a2d68
commit b82892ae6f
2 changed files with 5 additions and 4 deletions

View File

@ -903,9 +903,10 @@ protected:
void load_value(value_and_holder &&v_h) {
if (typeinfo->default_holder) {
sh_load_helper.loaded_v_h = v_h;
type_caster_generic::load_value(std::move(v_h));
type_caster_generic::load_value(std::move(v_h)); // NOLINT(performance-move-const-arg)
return;
} else if (v_h.holder_constructed()) {
}
if (v_h.holder_constructed()) {
value = v_h.value_ptr();
shared_ptr_holder = v_h.template holder<std::shared_ptr<type>>();
return;
@ -1027,7 +1028,7 @@ public:
if (typeinfo->default_holder) {
sh_load_helper.loaded_v_h = v_h;
sh_load_helper.loaded_v_h.type = get_type_info(typeid(type));
type_caster_generic::load_value(std::move(v_h));
type_caster_generic::load_value(std::move(v_h)); // NOLINT(performance-move-const-arg)
return;
}
throw std::runtime_error("BAKEIN_WIP: What is the best behavior here (load_value)?");

View File

@ -611,7 +611,7 @@ struct value_and_holder_helper {
// have_holder() must be true or this function will fail.
void throw_if_instance_is_currently_owned_by_shared_ptr() const {
auto vptr_gd_ptr = std::get_deleter<pybindit::memory::guarded_delete>(holder().vptr);
auto *vptr_gd_ptr = std::get_deleter<pybindit::memory::guarded_delete>(holder().vptr);
if (vptr_gd_ptr != nullptr && !vptr_gd_ptr->released_ptr.expired()) {
throw value_error("Python instance is currently owned by a std::shared_ptr.");
}