mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-11 16:13:53 +00:00
clang-tidy fixes.
This commit is contained in:
parent
f19e80881c
commit
eac5b49fe1
@ -517,11 +517,11 @@ struct smart_holder_type_caster<std::shared_ptr<T>> : smart_holder_type_caster_l
|
||||
// MISSING: keep_alive.
|
||||
return existing_inst.second;
|
||||
|
||||
object inst = reinterpret_steal<object>(make_new_instance(tinfo->type));
|
||||
instance *inst_raw_ptr = reinterpret_cast<instance *>(inst.ptr());
|
||||
inst_raw_ptr->owned = true;
|
||||
void *&valueptr = values_and_holders(inst_raw_ptr).begin()->value_ptr();
|
||||
valueptr = src_raw_void_ptr;
|
||||
auto inst = reinterpret_steal<object>(make_new_instance(tinfo->type));
|
||||
auto *inst_raw_ptr = reinterpret_cast<instance *>(inst.ptr());
|
||||
inst_raw_ptr->owned = true;
|
||||
void *&valueptr = values_and_holders(inst_raw_ptr).begin()->value_ptr();
|
||||
valueptr = src_raw_void_ptr;
|
||||
|
||||
auto smhldr = pybindit::memory::smart_holder::from_shared_ptr(src);
|
||||
tinfo->init_instance(inst_raw_ptr, static_cast<const void *>(&smhldr));
|
||||
@ -578,11 +578,11 @@ struct smart_holder_type_caster<std::unique_ptr<T>> : smart_holder_type_caster_l
|
||||
if (existing_inst.first)
|
||||
throw cast_error("Invalid unique_ptr: another instance owns this pointer already.");
|
||||
|
||||
object inst = reinterpret_steal<object>(make_new_instance(tinfo->type));
|
||||
instance *inst_raw_ptr = reinterpret_cast<instance *>(inst.ptr());
|
||||
inst_raw_ptr->owned = true;
|
||||
void *&valueptr = values_and_holders(inst_raw_ptr).begin()->value_ptr();
|
||||
valueptr = src_raw_void_ptr;
|
||||
auto inst = reinterpret_steal<object>(make_new_instance(tinfo->type));
|
||||
auto *inst_raw_ptr = reinterpret_cast<instance *>(inst.ptr());
|
||||
inst_raw_ptr->owned = true;
|
||||
void *&valueptr = values_and_holders(inst_raw_ptr).begin()->value_ptr();
|
||||
valueptr = src_raw_void_ptr;
|
||||
|
||||
auto smhldr = pybindit::memory::smart_holder::from_unique_ptr(std::move(src));
|
||||
tinfo->init_instance(inst_raw_ptr, static_cast<const void *>(&smhldr));
|
||||
|
Loading…
Reference in New Issue
Block a user