diff options
Diffstat (limited to 'PySide/QtOpenGL/typesystem_opengl.xml')
-rw-r--r-- | PySide/QtOpenGL/typesystem_opengl.xml | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/PySide/QtOpenGL/typesystem_opengl.xml b/PySide/QtOpenGL/typesystem_opengl.xml index 0a1579cfa..043b2f565 100644 --- a/PySide/QtOpenGL/typesystem_opengl.xml +++ b/PySide/QtOpenGL/typesystem_opengl.xml @@ -657,15 +657,13 @@ <enum-type name="UsagePattern" since="4.7"/> <modify-function signature="allocate(const void*, int)"> <modify-argument index="1"> - <replace-type modified-type="const QByteArray&"/> + <replace-type modified-type="QByteArray&"/> </modify-argument> <modify-argument index="2"> <replace-default-expression with="-1"/> </modify-argument> <inject-code class="target" position="beginning"> - int size = %2; - if (size < 0) - size = %1.size(); + int size = (%2 < 0) ? %1.size() : %2; %CPPSELF.allocate((const void*) %1.data(), size); </inject-code> </modify-function> @@ -703,15 +701,13 @@ </modify-function> <modify-function signature="write(int, const void*, int)"> <modify-argument index="2"> - <replace-type modified-type="const QByteArray&"/> + <replace-type modified-type="QByteArray&"/> </modify-argument> <modify-argument index="3"> <replace-default-expression with="-1"/> </modify-argument> <inject-code class="target" position="beginning"> - int size = %3; - if (size < 0) - size = %2.size(); + int size = (%3 < 0) ? %2.size() : %3; %CPPSELF.write(%1, (const void*) %2.data(), size); </inject-code> </modify-function> |