aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/libshiboken/shibokenbuffer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Rename shiboken2 to shiboken6Friedemann Kleint2020-10-281-83/+0
| | | | | | | | Adapt CMake files, build scripts, tests and examples. Task-number: PYSIDE-904 Change-Id: I4cb5ee4c8df539546014b08202a7b1e98ed3ff07 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Remove Python2 from C++ codeFriedemann Kleint2020-09-031-20/+0
| | | | | | | Task-number: PYSIDE-1339 Task-number: PYSIDE-904 Change-Id: I7e4ffaeabb2ac8a5ffe165d43b3475a7e5d57447 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Fix Python 3 deprecation warning about Buffer APIFriedemann Kleint2019-10-251-0/+4
| | | | | | | | | Use new buffer protocol, fixing: sources/shiboken2/libshiboken/shibokenbuffer.cpp: In function ‘bool Shiboken::Buffer::checkType(PyObject*)’: sources/shiboken2/libshiboken/shibokenbuffer.cpp:46:42: warning: ‘int PyObject_CheckReadBuffer(PyObject*)’ is deprecated [-Wdeprecated-declarations] Change-Id: I3e3a403306d86c940bf1bd71fc672db6e0a2ea60 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Cleanup pointer whitespace everywhereChristian Tismer2019-06-241-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Among other files to fix, basewrapper.(cpp|h) was full of uncommon pointer whitespace. After fixing that, I could not resist and fixed also libshiboken, generators, and after acceptance also PySide. Most of the time, this regex worked fine (\w\w+)([*&]+)[ ]*(?![&*]*[/=]) replaced with \1 \2 but everything was checked by hand. I did not touch the shiboken tests which are quite hairy. It turned out that inserting a space between a variable and asterisk causes a crash of shiboken, if the same line contains "CONVERTTOCPP". This was temporarily fixed by adding another space after it. Example.. sources/pyside2/PySide2/glue/qtcore.cpp line 977 QByteArray * cppSelf = %CONVERTTOCPP[QByteArray *](obj); //XXX /|\ omitting this space crashes shiboken! cppgenerator.cpp was special, since it was modified to _generate_ correct pointer whitespace. This caused a few testcases to fail, which had to be adjusted, again. This was difficult since some internal names must end on "*" and generated code normally not. Removing the last errors involved binary search on path sets... Apply C++ 11 fixits to the changed code, where applicable. Done-with: Friedemann.Kleint@qt.io Task-number: PYSIDE-1037 Change-Id: I4ac070f52c5efb296c05d581c9d46e6f397a6c81 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Merge remote-tracking branch 'origin/5.11' into devFriedemann Kleint2018-09-211-3/+4
|\ | | | | | | Change-Id: Ie4320a6ac584ec47ed8eaca538453a8e5b123c42
| * Release Py_buffer after gets its underlying pointerBoxiang Sun2018-09-191-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | PyObject_GetBuffer will increment the reference of Py_buffer, when the buffer is no longer being used, we should call PyBuffer_Release to reduce the reference count. See https://docs.python.org/3/c-api/buffer.html#c.PyBuffer_Release Task-number: PYSIDE-140 Change-Id: Ia7c231aff317252db83b2405237031fc73af2651 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* | libshiboken: Fix remaining clang-tidy warningsFriedemann Kleint2018-08-301-3/+3
|/ | | | | | | | | | - Remove else after return/continue/break; unindent code or simplify return conditions - Fix C-style casts - Comment out unused parameter Change-Id: Iea1106023829658cd1ce005fa02d0c8940504dfd Reviewed-by: Christian Tismer <tismer@stackless.com>
* PEP 384-squash: Implement PEP 384Christian Tismer2018-05-301-1/+3
| | | | | | | | | | This is the condensed checkin of 18 commits which created the implementation of PEP 384. Task-number: PYSIDE-560 Change-Id: I834c659af4c2b55b268f8e8dc4cfa53f02502409 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Change license from all the filesCristian Maureira-Fredes2018-05-031-1/+1
| | | | | | | | | | | | | | | | | Removing the word 'project' from all the headers, and changing the PySide reference from the examples to Qt for Python: The following line was used inside the source/ and build_scripts/ directory: for i in $(grep -r "the Qt for Python project" * |grep -v "pyside2-tools" | awk '{print $1}' | sed 's/:.*//g');do sed -i 's/the\ Qt\ for\ Python\ project/Qt\ for\ Python/g' $i;done and the following line was used inside the examples/ directory: for i in $(grep -r "of the PySide" * |grep -v "pyside2-tools" | awk '{print $1}' | sed 's/:.*//g');do sed -i 's/of\ the\ PySide/of\ the\ Qt\ for\ Python/g' $i;done Change-Id: Ic480714686ad62ac4d81c670f87f1c2033d4ffa1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Rename PySide references to Qt for PythonCristian Maureira-Fredes2018-04-271-1/+1
| | | | | | | | | When referring to the project one should use "Qt for Python" and for the module "PySide2" Change-Id: I36497df245c9f6dd60d6e160e2fc805e48cefcae Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* libshiboken: Fix/Silence some MSVC warningsFriedemann Kleint2017-06-091-1/+1
| | | | | | | | | | | | | | | autodecref.h(110): warning C4522: 'Shiboken::AutoDecRef': multiple assignment operators specified autodecref.h(78): warning C4800: 'PyObject *const ': forcing value to bool 'true' or 'false' (performance warning) conversions.h(282): warning C4800: 'long': forcing value to bool 'true' or 'false' (performance warning) basewrapper.cpp(625): warning C4800: 'int': forcing value to bool 'true' or 'false' (performance warning) basewrapper.cpp(654): warning C4800: 'SpecialCastFunction': forcing value to bool 'true' or 'false' (performance warning) basewrapper.cpp(1014): warning C4800: 'Shiboken::ParentInfo *': forcing value to bool 'true' or 'false' (performance warning) basewrapper.cpp(1044): warning C4800: 'void *': forcing value to bool 'true' or 'false' (performance warning) helper.cpp(56): warning C4244: 'initializing': conversion from 'Py_ssize_t' to 'int', possible loss of data shibokenbuffer.cpp(46): warning C4800: 'int': forcing value to bool 'true' or 'false' (performance warning) Change-Id: If1517fde8e7670f258a56f6d845a66ebb3d82141 Reviewed-by: Christian Tismer <tismer@stackless.com>
* move everying into sources/shiboken2Oswald Buddenhagen2017-05-221-0/+96
in preparation for a subtree merge. this should not be necessary to do in a separate commit, but git is a tad stupid about following history correctly without it.