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:
authormano-wii <germano.costa@ig.com.br>2018-09-27 06:22:57 +0300
committermano-wii <germano.costa@ig.com.br>2018-09-27 06:22:57 +0300
commit1e647a570d9c42de915bc1204ff21ea5fa4e6b17 (patch)
tree3d67b4865447bc8592bf8f39bfed5e7808defbc9 /source/blender/python/gpu/gpu_py_batch.c
parentd559eaffd46e3a0e4e289e7307fabd79a4a29a11 (diff)
Python GPU module: replace `PyArg_ParseTupleAndKeywords` by `_PyArg_ParseTupleAndKeywordsFast`
part of T47811 ("for faster argument parsing").
Diffstat (limited to 'source/blender/python/gpu/gpu_py_batch.c')
-rw-r--r--source/blender/python/gpu/gpu_py_batch.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/source/blender/python/gpu/gpu_py_batch.c b/source/blender/python/gpu/gpu_py_batch.c
index 2a4868d61d0..4e7804f382f 100644
--- a/source/blender/python/gpu/gpu_py_batch.c
+++ b/source/blender/python/gpu/gpu_py_batch.c
@@ -96,16 +96,15 @@ success:
static PyObject *bpygpu_Batch_new(PyTypeObject *UNUSED(type), PyObject *args, PyObject *kwds)
{
- const char * const keywords[] = {"type", "buf", NULL};
-
struct {
GPUPrimType type_id;
BPyGPUVertBuf *py_buf;
} params;
- if (!PyArg_ParseTupleAndKeywords(
- args, kwds,
- "$O&O!:GPUBatch.__new__", (char **)keywords,
+ static const char *_keywords[] = {"type", "buf", NULL};
+ static _PyArg_Parser _parser = {"$O&O!:GPUBatch.__new__", _keywords, 0};
+ if (!_PyArg_ParseTupleAndKeywordsFast(
+ args, kwds, &_parser,
bpygpu_ParsePrimType, &params.type_id,
&BPyGPUVertBuf_Type, &params.py_buf))
{
@@ -183,14 +182,14 @@ PyDoc_STRVAR(bpygpu_VertBatch_program_set_builtin_doc,
);
static PyObject *bpygpu_VertBatch_program_set_builtin(BPyGPUBatch *self, PyObject *args, PyObject *kwds)
{
- static const char *kwlist[] = {"id", NULL};
-
struct {
const char *shader;
} params;
- if (!PyArg_ParseTupleAndKeywords(
- args, kwds, "s:program_set_builtin", (char **)kwlist,
+ static const char *_keywords[] = {"id", NULL};
+ static _PyArg_Parser _parser = {"s:program_set_builtin", _keywords, 0};
+ if (!_PyArg_ParseTupleAndKeywordsFast(
+ args, kwds, &_parser,
&params.shader))
{
return NULL;