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>2015-08-04 11:34:20 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-08-04 11:49:42 +0300
commitcff288cf3a0d71b610fa20875a321ea3b8db2388 (patch)
tree32d172a1953c6f5777690e616a8581fd8801be53 /source/blender/python/intern/bpy_utils_units.c
parent62c8f46ab6f16f99bcf848936a690e01f4c9e770 (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/intern/bpy_utils_units.c')
-rw-r--r--source/blender/python/intern/bpy_utils_units.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/python/intern/bpy_utils_units.c b/source/blender/python/intern/bpy_utils_units.c
index d40e7e070ac..057df4ccd41 100644
--- a/source/blender/python/intern/bpy_utils_units.c
+++ b/source/blender/python/intern/bpy_utils_units.c
@@ -249,12 +249,17 @@ static PyObject *bpyunits_to_string(PyObject *UNUSED(self), PyObject *args, PyOb
char *usys_str = NULL, *ucat_str = NULL;
double value = 0.0;
- int precision = 3, split_unit = false, compatible_unit = false;
+ int precision = 3;
+ bool split_unit = false, compatible_unit = false;
int usys, ucat;
- if (!PyArg_ParseTupleAndKeywords(args, kw, "ssd|ipp:bpy.utils.units.to_string", (char **)kwlist,
- &usys_str, &ucat_str, &value, &precision, &split_unit, &compatible_unit))
+ if (!PyArg_ParseTupleAndKeywords(
+ args, kw,
+ "ssd|iO&O&:bpy.utils.units.to_string", (char **)kwlist,
+ &usys_str, &ucat_str, &value, &precision,
+ PyC_ParseBool, &split_unit,
+ PyC_ParseBool, &compatible_unit))
{
return NULL;
}