diff options
author | mano-wii <germano.costa@ig.com.br> | 2018-09-27 06:22:57 +0300 |
---|---|---|
committer | mano-wii <germano.costa@ig.com.br> | 2018-09-27 06:22:57 +0300 |
commit | 1e647a570d9c42de915bc1204ff21ea5fa4e6b17 (patch) | |
tree | 3d67b4865447bc8592bf8f39bfed5e7808defbc9 /source/blender/python/gpu/gpu_py_shader.c | |
parent | d559eaffd46e3a0e4e289e7307fabd79a4a29a11 (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_shader.c')
-rw-r--r-- | source/blender/python/gpu/gpu_py_shader.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/source/blender/python/gpu/gpu_py_shader.c b/source/blender/python/gpu/gpu_py_shader.c index a10fe22a7f2..2fc5f5278f0 100644 --- a/source/blender/python/gpu/gpu_py_shader.c +++ b/source/blender/python/gpu/gpu_py_shader.c @@ -85,10 +85,6 @@ static int bpygpu_pyLong_as_shader_enum(PyObject *o) static PyObject *bpygpu_shader_new(PyTypeObject *UNUSED(type), PyObject *args, PyObject *kwds) { - static const char *kwlist[] = { - "vertexcode", "fragcode", "geocode", - "libcode", "defines", NULL}; - struct { const char *vertexcode; const char *fragcode; @@ -97,8 +93,13 @@ static PyObject *bpygpu_shader_new(PyTypeObject *UNUSED(type), PyObject *args, P const char *defines; } params = {0}; - if (!PyArg_ParseTupleAndKeywords( - args, kwds, "ss|$sss:GPUShader.__new__", (char **)kwlist, + static const char *_keywords[] = { + "vertexcode", "fragcode", "geocode", + "libcode", "defines", NULL}; + + static _PyArg_Parser _parser = {"ss|$sss:GPUShader.__new__", _keywords, 0}; + if (!_PyArg_ParseTupleAndKeywordsFast( + args, kwds, &_parser, ¶ms.vertexcode, ¶ms.fragcode, ¶ms.geocode, ¶ms.libcode, ¶ms.defines)) { |