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>2019-05-31 16:21:16 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-05-31 16:22:52 +0300
commitaba4e6810f8b4d0e459137b64e061a2cadc457d1 (patch)
tree2b6159c7ba0f23c020600b71276772fa4a882b5b /source/blender/python/intern/bpy_rna.c
parent72a563cdee8fef198a200ff65b57ddb847c01795 (diff)
Cleanup: style, use braces in source/ (include disabled blocks)
Diffstat (limited to 'source/blender/python/intern/bpy_rna.c')
-rw-r--r--source/blender/python/intern/bpy_rna.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c
index 092c9061bb7..01d0a1f0c19 100644
--- a/source/blender/python/intern/bpy_rna.c
+++ b/source/blender/python/intern/bpy_rna.c
@@ -2822,18 +2822,22 @@ static int pyrna_prop_collection_ass_subscript(BPy_PropertyRNA *self,
Py_ssize_t start = 0, stop = PY_SSIZE_T_MAX;
/* avoid PySlice_GetIndicesEx because it needs to know the length ahead of time. */
- if (key_slice->start != Py_None && !_PyEval_SliceIndex(key_slice->start, &start))
+ if (key_slice->start != Py_None && !_PyEval_SliceIndex(key_slice->start, &start)) {
return NULL;
- if (key_slice->stop != Py_None && !_PyEval_SliceIndex(key_slice->stop, &stop))
+ }
+ if (key_slice->stop != Py_None && !_PyEval_SliceIndex(key_slice->stop, &stop)) {
return NULL;
+ }
if (start < 0 || stop < 0) {
/* only get the length for negative values */
Py_ssize_t len = (Py_ssize_t)RNA_property_collection_length(&self->ptr, self->prop);
- if (start < 0)
+ if (start < 0) {
start += len;
- if (stop < 0)
+ }
+ if (stop < 0) {
stop += len;
+ }
}
if (stop - start <= 0) {
@@ -4301,8 +4305,9 @@ static PyObject *pyrna_struct_getattro(BPy_StructRNA *self, PyObject *pyname)
static int pyrna_struct_pydict_contains(PyObject *self, PyObject *pyname)
{
PyObject *dict = *(_PyObject_GetDictPtr((PyObject *)self));
- if (dict == NULL) /* unlikely */
+ if (UNLIKELY(dict == NULL)) {
return 0;
+ }
return PyDict_Contains(dict, pyname);
}
@@ -4331,7 +4336,7 @@ static PyObject *pyrna_struct_meta_idprop_getattro(PyObject *cls, PyObject *attr
* Disable for now,
* this is faking internal behavior in a way that's too tricky to maintain well. */
# if 0
- if (ret == NULL) { // || pyrna_is_deferred_prop(ret)
+ if ((ret == NULL) /* || pyrna_is_deferred_prop(ret) */ ) {
StructRNA *srna = srna_from_self(cls, "StructRNA.__getattr__");
if (srna) {
PropertyRNA *prop = RNA_struct_type_find_property(srna, _PyUnicode_AsString(attr));