@@ -59,63 +59,6 @@ DtoolInstance_GetPointer(PyObject *self, T *&into, Dtool_PyTypedObject &target_c
5959 return false ;
6060}
6161
62- /* *
63- * Function to create a hash from a wrapped Python object.
64- */
65- INLINE Py_hash_t DtoolInstance_HashPointer (PyObject *self) {
66- if (self != nullptr && DtoolInstance_Check (self)) {
67- return (Py_hash_t)(intptr_t )DtoolInstance_VOID_PTR (self);
68- }
69- return -1 ;
70- }
71-
72- /* *
73- * Python 2-style comparison function that compares objects by pointer.
74- */
75- INLINE int DtoolInstance_ComparePointers (PyObject *v1, PyObject *v2) {
76- void *v1_this = DtoolInstance_Check (v1) ? DtoolInstance_VOID_PTR (v1) : nullptr ;
77- void *v2_this = DtoolInstance_Check (v2) ? DtoolInstance_VOID_PTR (v2) : nullptr ;
78- if (v1_this != nullptr && v2_this != nullptr ) {
79- return (v1_this > v2_this) - (v1_this < v2_this);
80- } else {
81- return (v1 > v2) - (v1 < v2);
82- }
83- }
84-
85- /* *
86- * Rich comparison function that compares objects by pointer.
87- */
88- INLINE PyObject *DtoolInstance_RichComparePointers (PyObject *v1, PyObject *v2, int op) {
89- int cmpval = DtoolInstance_ComparePointers (v1, v2);
90- Py_RETURN_RICHCOMPARE (cmpval, 0 , op);
91- }
92-
93- /* *
94- * Utility function for assigning a PyObject pointer while managing refcounts.
95- */
96- ALWAYS_INLINE void
97- Dtool_Assign_PyObject (PyObject *&ptr, PyObject *value) {
98- PyObject *prev_value = ptr;
99- if (prev_value != value) {
100- ptr = Py_XNewRef (value);
101- Py_XDECREF (prev_value);
102- }
103- }
104-
105- /* *
106- * Converts the enum value to a C long.
107- */
108- INLINE long Dtool_EnumValue_AsLong (PyObject *value) {
109- PyObject *val = PyObject_GetAttrString (value, " value" );
110- if (val != nullptr ) {
111- long as_long = PyLongOrInt_AS_LONG (val);
112- Py_DECREF (val);
113- return as_long;
114- } else {
115- return -1 ;
116- }
117- }
118-
11962/* *
12063 * These functions wrap a pointer for a class that defines get_type_handle().
12164 */
@@ -167,23 +110,6 @@ DTool_PyInit_Finalize(PyObject *self, void *local_this, Dtool_PyTypedObject *typ
167110 return 0 ;
168111}
169112
170- /* *
171- * Checks that the tuple is empty.
172- */
173- ALWAYS_INLINE bool
174- Dtool_CheckNoArgs (PyObject *args) {
175- return PyTuple_GET_SIZE (args) == 0 ;
176- }
177-
178- /* *
179- * Checks that the tuple is empty, and that the dict is empty or NULL.
180- */
181- ALWAYS_INLINE bool
182- Dtool_CheckNoArgs (PyObject *args, PyObject *kwds) {
183- return PyTuple_GET_SIZE (args) == 0 &&
184- (kwds == nullptr || PyDict_GET_SIZE (kwds) == 0 );
185- }
186-
187113/* *
188114 * The following functions wrap an arbitrary C++ value into a PyObject.
189115 */
0 commit comments