aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/libshiboken
diff options
context:
space:
mode:
authorChristian Tismer <tismer@stackless.com>2018-07-25 14:36:26 +0200
committerChristian Tismer <tismer@stackless.com>2018-08-06 21:20:40 +0000
commitb45d97ae4902fbae26f66e33526f868f32a503ce (patch)
tree8d2b0a53633d3240e5c1a320b844ac2427c09b55 /sources/shiboken2/libshiboken
parent83b42ca06c834ad07985397764ebe2d7a58234ce (diff)
Fix Some Minor Limited API Omissions And Quirks
Some formatting was not ok, some ordering of methods was not perfect, some code vanished, bufferprocs had a bad filename, and descrobject.h did not need a patch, anymore since things were solved in signature.cpp . Task-number: PYSIDE-560 Change-Id: Ibd1bedf0763ebb3fbbfd33a8e7cff4b5af6fab5e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/shiboken2/libshiboken')
-rw-r--r--sources/shiboken2/libshiboken/CMakeLists.txt4
-rw-r--r--sources/shiboken2/libshiboken/bufferprocs_py37.cpp (renamed from sources/shiboken2/libshiboken/bufferprocs27.cpp)0
-rw-r--r--sources/shiboken2/libshiboken/bufferprocs_py37.h (renamed from sources/shiboken2/libshiboken/bufferprocs27.h)0
-rw-r--r--sources/shiboken2/libshiboken/pep384impl.cpp6
-rw-r--r--sources/shiboken2/libshiboken/pep384impl.h33
-rw-r--r--sources/shiboken2/libshiboken/qt_attribution.json2
6 files changed, 16 insertions, 29 deletions
diff --git a/sources/shiboken2/libshiboken/CMakeLists.txt b/sources/shiboken2/libshiboken/CMakeLists.txt
index b5ba78e15..dd304bdca 100644
--- a/sources/shiboken2/libshiboken/CMakeLists.txt
+++ b/sources/shiboken2/libshiboken/CMakeLists.txt
@@ -51,7 +51,7 @@ qapp_macro.cpp
pep384impl.cpp
voidptr.cpp
typespec.cpp
-bufferprocs27.cpp
+bufferprocs_py37.cpp
)
get_numpy_location()
@@ -97,7 +97,7 @@ install(FILES
qapp_macro.h
voidptr.h
typespec.h
- bufferprocs27.h
+ bufferprocs_py37.h
"${CMAKE_CURRENT_BINARY_DIR}/sbkversion.h"
DESTINATION include/shiboken2${shiboken2_SUFFIX})
install(TARGETS libshiboken EXPORT shiboken2
diff --git a/sources/shiboken2/libshiboken/bufferprocs27.cpp b/sources/shiboken2/libshiboken/bufferprocs_py37.cpp
index 84d670d21..84d670d21 100644
--- a/sources/shiboken2/libshiboken/bufferprocs27.cpp
+++ b/sources/shiboken2/libshiboken/bufferprocs_py37.cpp
diff --git a/sources/shiboken2/libshiboken/bufferprocs27.h b/sources/shiboken2/libshiboken/bufferprocs_py37.h
index 6fc7a3ece..6fc7a3ece 100644
--- a/sources/shiboken2/libshiboken/bufferprocs27.h
+++ b/sources/shiboken2/libshiboken/bufferprocs_py37.h
diff --git a/sources/shiboken2/libshiboken/pep384impl.cpp b/sources/shiboken2/libshiboken/pep384impl.cpp
index b648330d8..e1dd7518f 100644
--- a/sources/shiboken2/libshiboken/pep384impl.cpp
+++ b/sources/shiboken2/libshiboken/pep384impl.cpp
@@ -341,7 +341,7 @@ extern "C"
*/
/*
- * Here is the verification code for PepTypeObject.
+ * Here is the verification code for PyTypeObject.
* We create a type object and check if its fields
* appear at the right offsets.
*/
@@ -402,7 +402,7 @@ static PyType_Spec typeprobe_spec = {
};
static void
-check_PepTypeObject_valid(void)
+check_PyTypeObject_valid(void)
{
PyObject *obtype = reinterpret_cast<PyObject *>(&PyType_Type);
PyTypeObject *probe_tp_base = reinterpret_cast<PyTypeObject *>(
@@ -827,7 +827,7 @@ PepType_GetNameStr(PyTypeObject *type)
void
Pep384_Init()
{
- check_PepTypeObject_valid();
+ check_PyTypeObject_valid();
#ifdef Py_LIMITED_API
Pep_GetVerboseFlag();
PepMethod_TypePtr = getMethodType();
diff --git a/sources/shiboken2/libshiboken/pep384impl.h b/sources/shiboken2/libshiboken/pep384impl.h
index 643714f04..d06947f06 100644
--- a/sources/shiboken2/libshiboken/pep384impl.h
+++ b/sources/shiboken2/libshiboken/pep384impl.h
@@ -53,7 +53,7 @@ extern "C"
// Extracted into bufferprocs27.h
#ifdef Py_LIMITED_API
-#include "bufferprocs27.h"
+#include "bufferprocs_py37.h"
#endif
/*****************************************************************************
@@ -136,11 +136,6 @@ typedef struct _typeobject {
LIBSHIBOKEN_API int PyIndex_Check(PyObject *obj);
#endif
-#undef PyObject_IS_GC
-#define PyObject_IS_GC(o) (PyType_IS_GC(Py_TYPE(o)) && \
- ( Py_TYPE(o)->tp_is_gc == NULL || \
- Py_TYPE(o)->tp_is_gc(o) ))
-
#endif // Py_LIMITED_API
struct SbkObjectTypePrivate;
@@ -148,22 +143,22 @@ struct PySideQFlagsTypePrivate;
struct _SbkGenericTypePrivate;
#define PepHeapType_SIZE \
- (reinterpret_cast<PyTypeObject*>(&PyType_Type)->tp_basicsize)
+ (reinterpret_cast<PyTypeObject *>(&PyType_Type)->tp_basicsize)
#define _genericTypeExtender(etype) \
- (reinterpret_cast<char*>(etype) + PepHeapType_SIZE)
+ (reinterpret_cast<char *>(etype) + PepHeapType_SIZE)
#define PepType_SOTP(etype) \
- (*reinterpret_cast<SbkObjectTypePrivate**>(_genericTypeExtender(etype)))
+ (*reinterpret_cast<SbkObjectTypePrivate **>(_genericTypeExtender(etype)))
#define PepType_SETP(etype) \
- (reinterpret_cast<SbkEnumTypePrivate*>(_genericTypeExtender(etype)))
+ (reinterpret_cast<SbkEnumTypePrivate *>(_genericTypeExtender(etype)))
#define PepType_PFTP(etype) \
- (reinterpret_cast<PySideQFlagsTypePrivate*>(_genericTypeExtender(etype)))
+ (reinterpret_cast<PySideQFlagsTypePrivate *>(_genericTypeExtender(etype)))
#define PepType_SGTP(etype) \
- (reinterpret_cast<_SbkGenericTypePrivate*>(_genericTypeExtender(etype)))
+ (reinterpret_cast<_SbkGenericTypePrivate *>(_genericTypeExtender(etype)))
// functions used everywhere
LIBSHIBOKEN_API const char *PepType_GetNameStr(PyTypeObject *type);
@@ -237,8 +232,8 @@ LIBSHIBOKEN_API char *_PepUnicode_AsString(PyObject *);
*/
#ifdef Py_LIMITED_API
#define PyTuple_GET_ITEM(op, i) PyTuple_GetItem((PyObject *)op, i)
-#define PyTuple_GET_SIZE(op) PyTuple_Size((PyObject *)op)
#define PyTuple_SET_ITEM(op, i, v) PyTuple_SetItem(op, i, v)
+#define PyTuple_GET_SIZE(op) PyTuple_Size((PyObject *)op)
#endif
/*****************************************************************************
@@ -272,15 +267,6 @@ typedef struct _pycfunc PyCFunctionObject;
/*****************************************************************************
*
- * RESOLVED: descrobject.h
- *
- */
-#ifdef Py_LIMITED_API
-typedef struct _methoddescr PyMethodDescrObject;
-#endif
-
-/*****************************************************************************
- *
* RESOLVED: pythonrun.h
*
*/
@@ -380,7 +366,8 @@ LIBSHIBOKEN_API PyObject *PyMethod_Self(PyObject *);
*/
#ifdef Py_LIMITED_API
/* Bytecode object */
- // we have to grab the code object from python
+
+// we have to grab the code object from python
typedef struct _code PyCodeObject;
LIBSHIBOKEN_API int PepCode_Get(PyCodeObject *co, const char *name);
diff --git a/sources/shiboken2/libshiboken/qt_attribution.json b/sources/shiboken2/libshiboken/qt_attribution.json
index 14695a4d2..12a0952df 100644
--- a/sources/shiboken2/libshiboken/qt_attribution.json
+++ b/sources/shiboken2/libshiboken/qt_attribution.json
@@ -3,7 +3,7 @@
"Name": "Python",
"QDocModule": "QtForPython",
"QtUsage": "Used for Qt for Python in the signature extension.",
- "Description": "Qt for Python is an add-on for Python. The libshiboken packages of PySide uses certain parts of the source files (typespec.cpp, typespec.h, bufferprocs27.cpp, bufferprocs27.h). See the folder sources/shiboken2/libshiboken .",
+ "Description": "Qt for Python is an add-on for Python. The libshiboken packages of PySide uses certain parts of the source files (typespec.cpp, typespec.h, bufferprocs_py37.cpp, bufferprocs_py37.h). See the folder sources/shiboken2/libshiboken .",
"Homepage": "http://www.python.org/",
"Version": "3.7.0",
"License": "PSF LICENSE AGREEMENT FOR PYTHON 3.7.0",