diff options
Diffstat (limited to 'source/blender/python/gpu')
-rw-r--r-- | source/blender/python/gpu/gpu_py_api.c | 10 | ||||
-rw-r--r-- | source/blender/python/gpu/gpu_py_buffer.c | 42 | ||||
-rw-r--r-- | source/blender/python/gpu/gpu_py_capabilities.c | 11 | ||||
-rw-r--r-- | source/blender/python/gpu/gpu_py_matrix.c | 11 | ||||
-rw-r--r-- | source/blender/python/gpu/gpu_py_platform.c | 11 | ||||
-rw-r--r-- | source/blender/python/gpu/gpu_py_select.c | 11 | ||||
-rw-r--r-- | source/blender/python/gpu/gpu_py_shader.c | 11 | ||||
-rw-r--r-- | source/blender/python/gpu/gpu_py_state.c | 11 | ||||
-rw-r--r-- | source/blender/python/gpu/gpu_py_texture.c | 11 | ||||
-rw-r--r-- | source/blender/python/gpu/gpu_py_types.c | 9 |
10 files changed, 93 insertions, 45 deletions
diff --git a/source/blender/python/gpu/gpu_py_api.c b/source/blender/python/gpu/gpu_py_api.c index a2075566f31..8f5897be649 100644 --- a/source/blender/python/gpu/gpu_py_api.c +++ b/source/blender/python/gpu/gpu_py_api.c @@ -32,8 +32,14 @@ PyDoc_STRVAR(pygpu_doc, "Some higher level functions can be found in the `gpu_extras` module."); static struct PyModuleDef pygpu_module_def = { PyModuleDef_HEAD_INIT, - .m_name = "gpu", - .m_doc = pygpu_doc, + /*m_name*/ "gpu", + /*m_doc*/ pygpu_doc, + /*m_size*/ 0, + /*m_methods*/ NULL, + /*m_slots*/ NULL, + /*m_traverse*/ NULL, + /*m_clear*/ NULL, + /*m_free*/ NULL, }; PyObject *BPyInit_gpu(void) diff --git a/source/blender/python/gpu/gpu_py_buffer.c b/source/blender/python/gpu/gpu_py_buffer.c index 30a434f8667..51bda9b4941 100644 --- a/source/blender/python/gpu/gpu_py_buffer.c +++ b/source/blender/python/gpu/gpu_py_buffer.c @@ -159,7 +159,7 @@ static BPyGPUBuffer *pygpu_buffer_make_from_data(PyObject *parent, return buffer; } -static PyObject *pygpu_buffer__sq_item(BPyGPUBuffer *self, int i) +static PyObject *pygpu_buffer__sq_item(BPyGPUBuffer *self, Py_ssize_t i) { if (i >= self->shape[0] || i < 0) { PyErr_SetString(PyExc_IndexError, "array index out of range"); @@ -200,10 +200,10 @@ static PyObject *pygpu_buffer__sq_item(BPyGPUBuffer *self, int i) static PyObject *pygpu_buffer_to_list(BPyGPUBuffer *self) { - int i, len = self->shape[0]; + const Py_ssize_t len = self->shape[0]; PyObject *list = PyList_New(len); - for (i = 0; i < len; i++) { + for (Py_ssize_t i = 0; i < len; i++) { PyList_SET_ITEM(list, i, pygpu_buffer__sq_item(self, i)); } @@ -313,7 +313,7 @@ static PyObject *pygpu_buffer__tp_repr(BPyGPUBuffer *self) return repr; } -static int pygpu_buffer__sq_ass_item(BPyGPUBuffer *self, int i, PyObject *v); +static int pygpu_buffer__sq_ass_item(BPyGPUBuffer *self, Py_ssize_t i, PyObject *v); static int pygpu_buffer_ass_slice(BPyGPUBuffer *self, Py_ssize_t begin, @@ -430,7 +430,7 @@ static int pygpu_buffer__tp_is_gc(BPyGPUBuffer *self) /* BPyGPUBuffer sequence methods */ -static int pygpu_buffer__sq_length(BPyGPUBuffer *self) +static Py_ssize_t pygpu_buffer__sq_length(BPyGPUBuffer *self) { return self->shape[0]; } @@ -458,7 +458,7 @@ static PyObject *pygpu_buffer_slice(BPyGPUBuffer *self, Py_ssize_t begin, Py_ssi return list; } -static int pygpu_buffer__sq_ass_item(BPyGPUBuffer *self, int i, PyObject *v) +static int pygpu_buffer__sq_ass_item(BPyGPUBuffer *self, Py_ssize_t i, PyObject *v) { if (i >= self->shape[0] || i < 0) { PyErr_SetString(PyExc_IndexError, "array assignment index out of range"); @@ -579,22 +579,22 @@ static PyGetSetDef pygpu_buffer_getseters[] = { }; static PySequenceMethods pygpu_buffer__tp_as_sequence = { - (lenfunc)pygpu_buffer__sq_length, /* sq_length */ - (binaryfunc)NULL, /* sq_concat */ - (ssizeargfunc)NULL, /* sq_repeat */ - (ssizeargfunc)pygpu_buffer__sq_item, /* sq_item */ - (ssizessizeargfunc)NULL, /* sq_slice, deprecated, handled in pygpu_buffer__sq_item */ - (ssizeobjargproc)pygpu_buffer__sq_ass_item, /* sq_ass_item */ - (ssizessizeobjargproc)NULL, /* sq_ass_slice, deprecated handled in pygpu_buffer__sq_ass_item */ - (objobjproc)NULL, /* sq_contains */ - (binaryfunc)NULL, /* sq_inplace_concat */ - (ssizeargfunc)NULL, /* sq_inplace_repeat */ + /*sq_length*/ (lenfunc)pygpu_buffer__sq_length, + /*sq_concat*/ NULL, + /*sq_repeat*/ NULL, + /*sq_item*/ (ssizeargfunc)pygpu_buffer__sq_item, + /*was_sq_slice*/ NULL, /* DEPRECATED. Handled by #pygpu_buffer__sq_item. */ + /*sq_ass_item*/ (ssizeobjargproc)pygpu_buffer__sq_ass_item, + /*was_sq_ass_slice*/ NULL, /* DEPRECATED. Handled by #pygpu_buffer__sq_ass_item. */ + /*sq_contains*/ NULL, + /*sq_inplace_concat*/ NULL, + /*sq_inplace_repeat*/ NULL, }; static PyMappingMethods pygpu_buffer__tp_as_mapping = { - (lenfunc)pygpu_buffer__sq_length, - (binaryfunc)pygpu_buffer__mp_subscript, - (objobjargproc)pygpu_buffer__mp_ass_subscript, + /*mp_len*/ (lenfunc)pygpu_buffer__sq_length, + /*mp_subscript*/ (binaryfunc)pygpu_buffer__mp_subscript, + /*mp_ass_subscript*/ (objobjargproc)pygpu_buffer__mp_ass_subscript, }; #ifdef PYGPU_BUFFER_PROTOCOL @@ -648,8 +648,8 @@ static void pygpu_buffer__bf_releasebuffer(PyObject *UNUSED(exporter), Py_buffer } static PyBufferProcs pygpu_buffer__tp_as_buffer = { - (getbufferproc)pygpu_buffer__bf_getbuffer, - (releasebufferproc)pygpu_buffer__bf_releasebuffer, + /*bf_getbuffer*/ (getbufferproc)pygpu_buffer__bf_getbuffer, + /*bf_releasebuffer*/ (releasebufferproc)pygpu_buffer__bf_releasebuffer, }; #endif diff --git a/source/blender/python/gpu/gpu_py_capabilities.c b/source/blender/python/gpu/gpu_py_capabilities.c index dea057bf8e3..2345982eb42 100644 --- a/source/blender/python/gpu/gpu_py_capabilities.c +++ b/source/blender/python/gpu/gpu_py_capabilities.c @@ -301,9 +301,14 @@ static struct PyMethodDef pygpu_capabilities__tp_methods[] = { PyDoc_STRVAR(pygpu_capabilities__tp_doc, "This module provides access to the GPU capabilities."); static PyModuleDef pygpu_capabilities_module_def = { PyModuleDef_HEAD_INIT, - .m_name = "gpu.capabilities", - .m_doc = pygpu_capabilities__tp_doc, - .m_methods = pygpu_capabilities__tp_methods, + /*m_name*/ "gpu.capabilities", + /*m_doc*/ pygpu_capabilities__tp_doc, + /*m_size*/ 0, + /*m_methods*/ pygpu_capabilities__tp_methods, + /*m_slots*/ NULL, + /*m_traverse*/ NULL, + /*m_clear*/ NULL, + /*m_free*/ NULL, }; PyObject *bpygpu_capabilities_init(void) diff --git a/source/blender/python/gpu/gpu_py_matrix.c b/source/blender/python/gpu/gpu_py_matrix.c index 18925a101da..7d80f763162 100644 --- a/source/blender/python/gpu/gpu_py_matrix.c +++ b/source/blender/python/gpu/gpu_py_matrix.c @@ -528,9 +528,14 @@ static struct PyMethodDef pygpu_matrix__tp_methods[] = { PyDoc_STRVAR(pygpu_matrix__tp_doc, "This module provides access to the matrix stack."); static PyModuleDef pygpu_matrix_module_def = { PyModuleDef_HEAD_INIT, - .m_name = "gpu.matrix", - .m_doc = pygpu_matrix__tp_doc, - .m_methods = pygpu_matrix__tp_methods, + /*m_name*/ "gpu.matrix", + /*m_doc*/ pygpu_matrix__tp_doc, + /*m_size*/ 0, + /*m_methods*/ pygpu_matrix__tp_methods, + /*m_slots*/ NULL, + /*m_traverse*/ NULL, + /*m_clear*/ NULL, + /*m_free*/ NULL, }; PyObject *bpygpu_matrix_init(void) diff --git a/source/blender/python/gpu/gpu_py_platform.c b/source/blender/python/gpu/gpu_py_platform.c index c6e964405fa..5f9f653a3c4 100644 --- a/source/blender/python/gpu/gpu_py_platform.c +++ b/source/blender/python/gpu/gpu_py_platform.c @@ -141,9 +141,14 @@ static struct PyMethodDef pygpu_platform__tp_methods[] = { PyDoc_STRVAR(pygpu_platform__tp_doc, "This module provides access to GPU Platform definitions."); static PyModuleDef pygpu_platform_module_def = { PyModuleDef_HEAD_INIT, - .m_name = "gpu.platform", - .m_doc = pygpu_platform__tp_doc, - .m_methods = pygpu_platform__tp_methods, + /*m_name*/ "gpu.platform", + /*m_doc*/ pygpu_platform__tp_doc, + /*m_size*/ 0, + /*m_methods*/ pygpu_platform__tp_methods, + /*m_slots*/ NULL, + /*m_traverse*/ NULL, + /*m_clear*/ NULL, + /*m_free*/ NULL, }; PyObject *bpygpu_platform_init(void) diff --git a/source/blender/python/gpu/gpu_py_select.c b/source/blender/python/gpu/gpu_py_select.c index 6d11e94433e..02e06e0ffd5 100644 --- a/source/blender/python/gpu/gpu_py_select.c +++ b/source/blender/python/gpu/gpu_py_select.c @@ -58,9 +58,14 @@ static struct PyMethodDef pygpu_select__tp_methods[] = { PyDoc_STRVAR(pygpu_select__tp_doc, "This module provides access to selection."); static PyModuleDef pygpu_select_module_def = { PyModuleDef_HEAD_INIT, - .m_name = "gpu.select", - .m_doc = pygpu_select__tp_doc, - .m_methods = pygpu_select__tp_methods, + /*m_name*/ "gpu.select", + /*m_doc*/ pygpu_select__tp_doc, + /*m_size*/ 0, + /*m_methods*/ pygpu_select__tp_methods, + /*m_slots*/ NULL, + /*m_traverse*/ NULL, + /*m_clear*/ NULL, + /*m_free*/ NULL, }; PyObject *bpygpu_select_init(void) diff --git a/source/blender/python/gpu/gpu_py_shader.c b/source/blender/python/gpu/gpu_py_shader.c index a57b00e671e..7222cb1696a 100644 --- a/source/blender/python/gpu/gpu_py_shader.c +++ b/source/blender/python/gpu/gpu_py_shader.c @@ -923,9 +923,14 @@ PyDoc_STRVAR(pygpu_shader_module__tp_doc, "\n" PYDOC_BUILTIN_SHADER_DESCRIPTION); static PyModuleDef pygpu_shader_module_def = { PyModuleDef_HEAD_INIT, - .m_name = "gpu.shader", - .m_doc = pygpu_shader_module__tp_doc, - .m_methods = pygpu_shader_module__tp_methods, + /*m_name*/ "gpu.shader", + /*m_doc*/ pygpu_shader_module__tp_doc, + /*m_size*/ 0, + /*m_methods*/ pygpu_shader_module__tp_methods, + /*m_slots*/ NULL, + /*m_traverse*/ NULL, + /*m_clear*/ NULL, + /*m_free*/ NULL, }; /** \} */ diff --git a/source/blender/python/gpu/gpu_py_state.c b/source/blender/python/gpu/gpu_py_state.c index 35ecc2aff40..f17a3fecfdd 100644 --- a/source/blender/python/gpu/gpu_py_state.c +++ b/source/blender/python/gpu/gpu_py_state.c @@ -431,9 +431,14 @@ static struct PyMethodDef pygpu_state__tp_methods[] = { PyDoc_STRVAR(pygpu_state__tp_doc, "This module provides access to the gpu state."); static PyModuleDef pygpu_state_module_def = { PyModuleDef_HEAD_INIT, - .m_name = "gpu.state", - .m_doc = pygpu_state__tp_doc, - .m_methods = pygpu_state__tp_methods, + /*m_name*/ "gpu.state", + /*m_doc*/ pygpu_state__tp_doc, + /*m_size*/ 0, + /*m_methods*/ pygpu_state__tp_methods, + /*m_slots*/ NULL, + /*m_traverse*/ NULL, + /*m_clear*/ NULL, + /*m_free*/ NULL, }; PyObject *bpygpu_state_init(void) diff --git a/source/blender/python/gpu/gpu_py_texture.c b/source/blender/python/gpu/gpu_py_texture.c index ae004341304..11b44a2a35e 100644 --- a/source/blender/python/gpu/gpu_py_texture.c +++ b/source/blender/python/gpu/gpu_py_texture.c @@ -565,9 +565,14 @@ static struct PyMethodDef pygpu_texture__m_methods[] = { PyDoc_STRVAR(pygpu_texture__m_doc, "This module provides utils for textures."); static PyModuleDef pygpu_texture_module_def = { PyModuleDef_HEAD_INIT, - .m_name = "gpu.texture", - .m_doc = pygpu_texture__m_doc, - .m_methods = pygpu_texture__m_methods, + /*m_name*/ "gpu.texture", + /*m_doc*/ pygpu_texture__m_doc, + /*m_size*/ 0, + /*m_methods*/ pygpu_texture__m_methods, + /*m_slots*/ NULL, + /*m_traverse*/ NULL, + /*m_clear*/ NULL, + /*m_free*/ NULL, }; /** \} */ diff --git a/source/blender/python/gpu/gpu_py_types.c b/source/blender/python/gpu/gpu_py_types.c index eccbebbd8dd..b5cabd93b42 100644 --- a/source/blender/python/gpu/gpu_py_types.c +++ b/source/blender/python/gpu/gpu_py_types.c @@ -19,7 +19,14 @@ static struct PyModuleDef pygpu_types_module_def = { PyModuleDef_HEAD_INIT, - .m_name = "gpu.types", + /*m_name*/ "gpu.types", + /*m_doc*/ NULL, + /*m_size*/ 0, + /*m_methods*/ NULL, + /*m_slots*/ NULL, + /*m_traverse*/ NULL, + /*m_clear*/ NULL, + /*m_free*/ NULL, }; PyObject *bpygpu_types_init(void) |