diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-08-04 11:34:20 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-08-04 11:49:42 +0300 |
commit | cff288cf3a0d71b610fa20875a321ea3b8db2388 (patch) | |
tree | 32d172a1953c6f5777690e616a8581fd8801be53 /source/blender/python/bmesh/bmesh_py_api.c | |
parent | 62c8f46ab6f16f99bcf848936a690e01f4c9e770 (diff) |
Use PyC_ParseBool to parse bools
This could cause problems since they could be any int,
then passed directly to internal functions that assume bools.
Diffstat (limited to 'source/blender/python/bmesh/bmesh_py_api.c')
-rw-r--r-- | source/blender/python/bmesh/bmesh_py_api.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/source/blender/python/bmesh/bmesh_py_api.c b/source/blender/python/bmesh/bmesh_py_api.c index f74737ba8f4..7c5d1961849 100644 --- a/source/blender/python/bmesh/bmesh_py_api.c +++ b/source/blender/python/bmesh/bmesh_py_api.c @@ -116,11 +116,14 @@ static PyObject *bpy_bm_update_edit_mesh(PyObject *UNUSED(self), PyObject *args, static const char *kwlist[] = {"mesh", "tessface", "destructive", NULL}; PyObject *py_me; Mesh *me; - int do_tessface = true; - int is_destructive = true; - - if (!PyArg_ParseTupleAndKeywords(args, kw, "O|ii:update_edit_mesh", (char **)kwlist, - &py_me, &do_tessface, &is_destructive)) + bool do_tessface = true; + bool is_destructive = true; + + if (!PyArg_ParseTupleAndKeywords( + args, kw, "O|O&O&:update_edit_mesh", (char **)kwlist, + &py_me, + PyC_ParseBool, &do_tessface, + PyC_ParseBool, &is_destructive)) { return NULL; } |