| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 9d827d3 commit 49c2ce4
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -473,7 +473,7 @@ def input(name, desc): | |||
| 473 | 473 | ||
| 474 | 474 | def fget(pointer): | |
| 475 | 475 | """Retrieve the InputFunction instance.""" | |
| 476 | - function = desc.input_pointer.make_function( | ||
| 476 | + function = get_object_pointer(desc.input).make_function( | ||
| 477 | 477 | Convention.THISCALL, | |
| 478 | 478 | (DataType.POINTER, DataType.POINTER), | |
| 479 | 479 | DataType.VOID) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -95,17 +95,12 @@ class TypeDescriptionSharedExt | |||
| 95 | 95 | if (!(pTypeDesc.flags & FTYPEDESC_INPUT || pTypeDesc.flags & FTYPEDESC_FUNCTIONTABLE)) | |
| 96 | 96 | BOOST_RAISE_EXCEPTION(PyExc_TypeError, "\"%s\" is not an input.", pTypeDesc.fieldName); | |
| 97 | 97 | ||
| 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); | ||
| 104 | 99 | ||
| 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()); | ||
| 107 | 102 | ||
| 108 | - return pInputPointer; | ||
| 103 | + return oInputFunction; | ||
| 109 | 104 | } | |
| 110 | 105 | }; | |
| 111 | 106 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -138,10 +138,6 @@ void export_type_description(scope _datamaps) | |||
| 138 | 138 | TypeDescription.def_readonly("save_restore", &typedescription_t::pSaveRestoreOps); | |
| 139 | 139 | ||
| 140 | 140 | 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 | - ); | ||
| 145 | 141 | ||
| 146 | 142 | TypeDescription.def_readonly("embedded_datamap", &typedescription_t::td); | |
| 147 | 143 | TypeDescription.def_readonly("size_in_bytes", &typedescription_t::fieldSizeInBytes); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments