Skip to content

Commit 6b8f55b

Browse files
committed
Merge pull request #705 from izaid/id
Updates to match libdynd
2 parents a91d8d7 + e1a2bf6 commit 6b8f55b

2 files changed

Lines changed: 6 additions & 10 deletions

File tree

dynd/include/types/pyobject_type.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ extern const dynd::type_id_t pyobject_id;
1313

1414
class PYDYND_API pyobject_type : public dynd::ndt::base_type {
1515
public:
16-
pyobject_type();
16+
pyobject_type(dynd::type_id_t new_id);
1717

1818
void print_type(std::ostream &o) const;
1919
void print_data(std::ostream &o, const char *arrmeta, const char *data) const;

dynd/src/types/pyobject_type.cpp

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,17 @@ using namespace dynd;
1313

1414
const type_id_t pyobject_id = new_id("pyobject", any_kind_id);
1515

16-
pyobject_type::pyobject_type()
17-
: ndt::base_type(pyobject_id, sizeof(PyObject *), alignof(PyObject *),
18-
type_flag_none | type_flag_zeroinit, 0, 0, 0)
16+
pyobject_type::pyobject_type(type_id_t new_id)
17+
: ndt::base_type(new_id, pyobject_id, sizeof(PyObject *), alignof(PyObject *), type_flag_none | type_flag_zeroinit,
18+
0, 0, 0)
1919
{
2020
}
2121

2222
void pyobject_type::print_type(std::ostream &o) const { o << "pyobject"; }
2323

24-
bool pyobject_type::operator==(const base_type &rhs) const
25-
{
26-
return get_id() == rhs.get_id();
27-
}
24+
bool pyobject_type::operator==(const base_type &rhs) const { return get_id() == rhs.get_id(); }
2825

29-
void pyobject_type::print_data(std::ostream &o, const char *arrmeta,
30-
const char *data) const
26+
void pyobject_type::print_data(std::ostream &o, const char *arrmeta, const char *data) const
3127
{
3228
PyObject *repr = PyObject_Repr(*reinterpret_cast<PyObject *const *>(data));
3329
#if PY_VERSION_HEX < 0x03000000

0 commit comments

Comments
 (0)