Make sip_api_get_address a public API function

The sipGetAddress function has been renamed as sip_api_get_address
and made available as part of the public API.

Signed-off-by: aneejit1 <aneejit1@gmail.com>
(cherry picked from commit b92a3b0a4e)
r14.0.x r14.0.13
aneejit1 3 years ago committed by Slávek Banko
parent 1eb067b439
commit 9149eaf253
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -143,7 +143,7 @@ PyObject *sip_api_invoke_slot(const sipSlot *slot, PyObject *sigargs)
* longer exists.
*/
if (PyObject_TypeCheck(self, (PyTypeObject *)&sipSimpleWrapper_Type) &&
sipGetAddress(self) == NULL)
sip_api_get_address(self) == NULL)
{
Py_XDECREF(sref);
@ -371,7 +371,7 @@ void *sipGetRx(sipSimpleWrapper *txSelf, const char *sigargs, PyObject *rxObj,
* The slot was either a Python callable or PyTQt3 Python signal so there
* should be a universal slot.
*/
return sipTQtSupport->qt_find_slot(sipGetAddress(txSelf), sigargs, rxObj, slot, memberp);
return sipTQtSupport->qt_find_slot(sip_api_get_address(txSelf), sigargs, rxObj, slot, memberp);
}

@ -1295,6 +1295,7 @@ typedef struct _sipAPIDef {
sipAttrGetterFunc getter);
int (*api_is_api_enabled)(const char *name, int from, int to);
sipErrorState (*api_bad_callable_arg)(int arg_nr, PyObject *arg);
void *(*api_get_address)(sipSimpleWrapper *w);
/*
* The following are deprecated parts of the public API.

@ -118,6 +118,7 @@ PyObject *sip_api_invoke_slot(const sipSlot *slot, PyObject *sigargs);
void *sip_api_convert_rx(sipWrapper *txSelf, const char *sigargs,
PyObject *rxObj, const char *slot, const char **memberp, int flags);
int sip_api_save_slot(sipSlot *sp, PyObject *rxObj, const char *slot);
void *sip_api_get_address(sipSimpleWrapper *w);
/*
@ -139,8 +140,6 @@ int sipOMRemoveObject(sipObjectMap *om, sipSimpleWrapper *val);
void sipSetBool(void *ptr,int val);
void *sipGetAddress(sipSimpleWrapper *w);
#ifdef __cplusplus
}

@ -307,6 +307,7 @@ static const sipAPIDef sip_api = {
sip_api_register_attribute_getter,
sip_api_is_api_enabled,
sip_api_bad_callable_arg,
sip_api_get_address,
/*
* The following are deprecated parts of the public API.
*/
@ -901,7 +902,7 @@ static PyObject *dumpWrapper(PyObject *self, PyObject *args)
#else
printf(" Reference count: %d\n", Py_REFCNT(sw));
#endif
printf(" Address of wrapped object: %p\n", sipGetAddress(sw));
printf(" Address of wrapped object: %p\n", sip_api_get_address(sw));
printf(" To be destroyed by: %s\n", (sipIsPyOwned(sw) ? "Python" : "C/C++"));
printf(" Derived class?: %s\n", (sipIsDerived(sw) ? "yes" : "no"));
@ -1071,7 +1072,7 @@ static PyObject *isDeleted(PyObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "O!:isdeleted", &sipSimpleWrapper_Type, &sw))
return NULL;
res = (sipGetAddress(sw) == NULL ? Py_True : Py_False);
res = (sip_api_get_address(sw) == NULL ? Py_True : Py_False);
Py_INCREF(res);
return res;
@ -7369,7 +7370,7 @@ static PyObject *sip_api_get_pyobject(void *cppPtr, const sipTypeDef *td)
/*
* Return the C/C++ pointer from a wrapper without any checks.
*/
void *sipGetAddress(sipSimpleWrapper *sw)
void *sip_api_get_address(sipSimpleWrapper *sw)
{
if (sipIsAccessFunc(sw))
return (*sw->u.afPtr)();
@ -7416,7 +7417,7 @@ static void *getComplexCppPtr(sipSimpleWrapper *sw, const sipTypeDef *td)
*/
void *sip_api_get_cpp_ptr(sipSimpleWrapper *sw, const sipTypeDef *td)
{
void *ptr = sipGetAddress(sw);
void *ptr = sip_api_get_address(sw);
if (checkPointer(ptr, sw) < 0)
return NULL;
@ -9213,7 +9214,7 @@ static int sipWrapper_clear(sipWrapper *self)
/* Remove any slots connected via a proxy. */
if (sipTQtSupport != NULL && sipPossibleProxy(sw))
{
void *tx = sipGetAddress(sw);
void *tx = sip_api_get_address(sw);
if (tx != NULL)
{
@ -9281,7 +9282,7 @@ static int sipWrapper_traverse(sipWrapper *self, visitproc visit, void *arg)
/* This should be handwritten code in PyTQt. */
if (sipTQtSupport != NULL)
{
void *tx = sipGetAddress(sw);
void *tx = sip_api_get_address(sw);
if (tx != NULL)
{

Loading…
Cancel
Save