Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2021-02-18 05:32:35 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-02-18 18:19:53 +0300
commite79916eb47a88cfb8dd8b238fd7e86d90b3459be (patch)
treecd1a3e36d1714d7d4808d82d6d2b4f35655b7642 /source/blender/python/gpu
parent10a54bbd06e3b1843b39b7bc55c24057dcaac41a (diff)
Cleanup: order shape_len after shape argument
This matches nearly all other argument ordering in Blender, including Python mathutils API.
Diffstat (limited to 'source/blender/python/gpu')
-rw-r--r--source/blender/python/gpu/gpu_py_buffer.c4
-rw-r--r--source/blender/python/gpu/gpu_py_buffer.h2
-rw-r--r--source/blender/python/gpu/gpu_py_texture.c7
3 files changed, 5 insertions, 8 deletions
diff --git a/source/blender/python/gpu/gpu_py_buffer.c b/source/blender/python/gpu/gpu_py_buffer.c
index 5939c822272..115f7ba923f 100644
--- a/source/blender/python/gpu/gpu_py_buffer.c
+++ b/source/blender/python/gpu/gpu_py_buffer.c
@@ -369,7 +369,7 @@ static PyObject *pygpu_buffer__tp_new(PyTypeObject *UNUSED(type), PyObject *args
PyBuffer_Release(&pybuffer);
}
else {
- buffer = BPyGPU_Buffer_CreatePyObject(pygpu_dataformat.value_found, shape_len, shape, NULL);
+ buffer = BPyGPU_Buffer_CreatePyObject(pygpu_dataformat.value_found, shape, shape_len, NULL);
if (init && pygpu_buffer_ass_slice(buffer, 0, shape[0], init)) {
Py_DECREF(buffer);
return NULL;
@@ -654,8 +654,8 @@ size_t bpygpu_Buffer_size(BPyGPUBuffer *buffer)
* with the correct format from which the buffer will be initialized
*/
BPyGPUBuffer *BPyGPU_Buffer_CreatePyObject(const int format,
- const int shape_len,
const Py_ssize_t *shape,
+ const int shape_len,
void *buffer)
{
if (buffer == NULL) {
diff --git a/source/blender/python/gpu/gpu_py_buffer.h b/source/blender/python/gpu/gpu_py_buffer.h
index 003f1a52078..5eac5e3d309 100644
--- a/source/blender/python/gpu/gpu_py_buffer.h
+++ b/source/blender/python/gpu/gpu_py_buffer.h
@@ -48,6 +48,6 @@ typedef struct BPyGPUBuffer {
size_t bpygpu_Buffer_size(BPyGPUBuffer *buffer);
BPyGPUBuffer *BPyGPU_Buffer_CreatePyObject(const int format,
- const int shape_len,
const Py_ssize_t *shape,
+ const int shape_len,
void *buffer);
diff --git a/source/blender/python/gpu/gpu_py_texture.c b/source/blender/python/gpu/gpu_py_texture.c
index 2b1b5f672b0..85246bffac7 100644
--- a/source/blender/python/gpu/gpu_py_texture.c
+++ b/source/blender/python/gpu/gpu_py_texture.c
@@ -390,11 +390,8 @@ static PyObject *pygpu_texture_read(BPyGPUTexture *self)
}
void *buf = GPU_texture_read(self->tex, best_data_format, 0);
- return (PyObject *)BPyGPU_Buffer_CreatePyObject(
- best_data_format,
- 2,
- (Py_ssize_t[2]){GPU_texture_height(self->tex), GPU_texture_width(self->tex)},
- buf);
+ const Py_ssize_t shape[2] = {GPU_texture_height(self->tex), GPU_texture_width(self->tex)};
+ return (PyObject *)BPyGPU_Buffer_CreatePyObject(best_data_format, shape, ARRAY_SIZE(shape), buf);
}
#ifdef BPYGPU_USE_GPUOBJ_FREE_METHOD