diff --git a/newtypes.cpp b/newtypes.cpp index 2cc570ee..3855791f 100644 --- a/newtypes.cpp +++ b/newtypes.cpp @@ -535,40 +535,23 @@ const CapabilityEntry capabilities[] = { void add_capability( std::size_t n, PyTypeObject* dest_, - AllMethods& all_methods, - const PyTypeObject* src_) + AllMethods& all_methods) { assert(n < PY_ARRAY_LENGTH(capabilities)); const CapabilityEntry& c = capabilities[n]; - const char* const* src = src_ ? reinterpret_cast( - reinterpret_cast(src_) + c.offset1) : 0; - char** const dest = reinterpret_cast( reinterpret_cast(dest_) + c.offset1); if (c.substructure_size == 0) { - if (src == 0 || -#if defined(__MWERKS__) && __MWERKS__ <= 0x4000 || defined(__alpha) && defined(__osf__) - ((const Dispatch*)src) -#else - reinterpret_cast(src) -#endif - != 0) { - *reinterpret_cast(dest) = c.dispatch; - } + *reinterpret_cast(dest) = c.dispatch; } else { - if (src == 0 || - *src != 0 && *reinterpret_cast(*src + c.offset2) != 0) - { - *dest = reinterpret_cast(&all_methods) + c.allmethods_offset; - *reinterpret_cast(*dest + c.offset2) = c.dispatch; - } + *dest = reinterpret_cast(&all_methods) + c.allmethods_offset; + *reinterpret_cast(*dest + c.offset2) = c.dispatch; } - } } // namespace detail