Skip to content

Commit 1f47d3f

Browse files
style: pre-commit fixes
1 parent f14499d commit 1f47d3f

File tree

7 files changed

+214
-270
lines changed

7 files changed

+214
-270
lines changed

include/pybind11/cast.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -893,8 +893,7 @@ struct holder_caster_foreign_helpers {
893893
}
894894

895895
template <typename type>
896-
static bool set_foreign_holder(handle src, type *value,
897-
std::shared_ptr<type> *holder_out) {
896+
static bool set_foreign_holder(handle src, type *value, std::shared_ptr<type> *holder_out) {
898897
// We only support using std::shared_ptr<T> for foreign T, and
899898
// it's done by creating a new shared_ptr control block that
900899
// owns a reference to the original Python object.
@@ -910,8 +909,8 @@ struct holder_caster_foreign_helpers {
910909
}
911910

912911
template <typename type>
913-
static bool set_foreign_holder(handle src, type *value,
914-
std::shared_ptr<const type> *holder_out) {
912+
static bool
913+
set_foreign_holder(handle src, type *value, std::shared_ptr<const type> *holder_out) {
915914
std::shared_ptr<type> holder_mut;
916915
if (set_foreign_holder(src, value, &holder_mut)) {
917916
*holder_out = holder_mut;
@@ -972,8 +971,7 @@ struct copyable_holder_caster : public type_caster_base<type> {
972971
}
973972

974973
bool set_foreign_holder(handle src) {
975-
return holder_caster_foreign_helpers::set_foreign_holder(
976-
src, (type *) value, &holder);
974+
return holder_caster_foreign_helpers::set_foreign_holder(src, (type *) value, &holder);
977975
}
978976

979977
void load_value(value_and_holder &&v_h) {
@@ -1109,7 +1107,7 @@ struct copyable_holder_caster<
11091107

11101108
bool set_foreign_holder(handle src) {
11111109
return holder_caster_foreign_helpers::set_foreign_holder(
1112-
src, (type *) value, &shared_ptr_storage);
1110+
src, (type *) value, &shared_ptr_storage);
11131111
}
11141112

11151113
void load_value(value_and_holder &&v_h) {

include/pybind11/detail/foreign.h

Lines changed: 55 additions & 77 deletions
Large diffs are not rendered by default.

include/pybind11/detail/internals.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,8 @@ struct type_equal_to {
181181
template <typename value_type>
182182
using type_map = std::unordered_map<std::type_index, value_type, type_hash, type_equal_to>;
183183
template <typename value_type>
184-
using type_multimap = std::unordered_multimap<std::type_index, value_type, type_hash, type_equal_to>;
184+
using type_multimap
185+
= std::unordered_multimap<std::type_index, value_type, type_hash, type_equal_to>;
185186

186187
struct override_hash {
187188
inline size_t operator()(const std::pair<const PyObject *, const char *> &v) const {
@@ -313,8 +314,7 @@ struct foreign_internals {
313314
// For each C++ type with a native binding, store pointers to its
314315
// copy and move constructors. These would ideally move inside `type_info`
315316
// on an ABI bump. Protected by internals::mutex.
316-
type_map<std::pair<copy_or_move_ctor,
317-
copy_or_move_ctor>> copy_move_ctors;
317+
type_map<std::pair<copy_or_move_ctor, copy_or_move_ctor>> copy_move_ctors;
318318

319319
// List of frameworks that provide exception translators.
320320
// Protected by internals::exception_translator_mutex.
@@ -368,7 +368,7 @@ struct foreign_internals {
368368
return initialize();
369369
}
370370

371-
private:
371+
private:
372372
inline bool initialize();
373373
};
374374

@@ -425,7 +425,8 @@ struct type_info {
425425
bool module_local : 1;
426426
};
427427

428-
#define PYBIND11_ABI_TAG "v" PYBIND11_TOSTRING(PYBIND11_INTERNALS_VERSION) \
428+
#define PYBIND11_ABI_TAG \
429+
"v" PYBIND11_TOSTRING(PYBIND11_INTERNALS_VERSION) \
429430
PYBIND11_COMPILER_TYPE_LEADING_UNDERSCORE PYBIND11_PLATFORM_ABI_ID
430431

431432
#define PYBIND11_INTERNALS_ID "__pybind11_internals_" PYBIND11_ABI_TAG "__"

0 commit comments

Comments
 (0)