FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

- Removed TypeDescription.input_pointer (instead, the Pointer instanc… · high-voltage/Source.Python@49c2ce4 · GitHub

Repository navigation

Commit 49c2ce4

Browse files
L'In20Cible
committed
- Removed TypeDescription.input_pointer (instead, the Pointer instance is bound to the returned Function of TypeDescription.input).
1 parent 9d827d3 commit 49c2ce4

3 files changed

Lines changed: 5 additions & 14 deletions

File tree

‎addons/source-python/packages/source-python/entities/classes.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ def input(name, desc):
473473

474474
def fget(pointer):
475475
"""Retrieve the InputFunction instance."""
476-
function = desc.input_pointer.make_function(
476+
function = get_object_pointer(desc.input).make_function(
477477
Convention.THISCALL,
478478
(DataType.POINTER, DataType.POINTER),
479479
DataType.VOID)

‎src/core/modules/entities/entities_datamaps_wrap.h‎

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -95,17 +95,12 @@ class TypeDescriptionSharedExt
9595
if (!(pTypeDesc.flags & FTYPEDESC_INPUT || pTypeDesc.flags & FTYPEDESC_FUNCTIONTABLE))
9696
BOOST_RAISE_EXCEPTION(PyExc_TypeError, "\"%s\" is not an input.", pTypeDesc.fieldName);
9797

98-
return make_function(pTypeDesc.inputFunc);
99-
}
100-
101-
static CPointer *get_input_pointer(const typedescription_t& pTypeDesc)
102-
{
103-
CPointer *pInputPointer = NULL;
98+
CPointer *pInputFunction = new CPointer((unsigned long)(void *&)pTypeDesc.inputFunc);
10499

105-
if (pTypeDesc.flags & FTYPEDESC_INPUT || pTypeDesc.flags & FTYPEDESC_FUNCTIONTABLE)
106-
pInputPointer = new CPointer((unsigned long)(void *&)pTypeDesc.inputFunc);
100+
object oInputFunction = make_function(pTypeDesc.inputFunc);
101+
PyDict_SetItemString(oInputFunction.ptr()->ob_type->tp_dict, "_ptr", object(ptr(pInputFunction)).ptr());
107102

108-
return pInputPointer;
103+
return oInputFunction;
109104
}
110105
};
111106

‎src/core/modules/entities/entities_datamaps_wrap_python.cpp‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,6 @@ void export_type_description(scope _datamaps)
138138
TypeDescription.def_readonly("save_restore", &typedescription_t::pSaveRestoreOps);
139139

140140
TypeDescription.add_property("input", &TypeDescriptionSharedExt::get_input);
141-
TypeDescription.add_property("input_pointer",
142-
make_function(&TypeDescriptionSharedExt::get_input_pointer,
143-
manage_new_object_policy())
144-
);
145141

146142
TypeDescription.def_readonly("embedded_datamap", &typedescription_t::td);
147143
TypeDescription.def_readonly("size_in_bytes", &typedescription_t::fieldSizeInBytes);

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL