[Bf-blender-cvs] [ee2e30683c1] blender2.8: Cleanup: style
Campbell Barton
noreply at git.blender.org
Sun Oct 7 08:53:37 CEST 2018
Commit: ee2e30683c1c4ebe14096d8e5f64a5a0099343e6
Author: Campbell Barton
Date: Sun Oct 7 17:49:22 2018 +1100
Branches: blender2.8
https://developer.blender.org/rBee2e30683c1c4ebe14096d8e5f64a5a0099343e6
Cleanup: style
===================================================================
M source/blender/editors/armature/armature_add.c
M source/blender/editors/armature/armature_edit.c
M source/blender/editors/armature/armature_naming.c
M source/blender/makesrna/intern/rna_gpencil.c
M source/blender/python/generic/py_capi_utils.h
M source/blender/python/gpu/gpu_py_vertex_format.c
===================================================================
diff --git a/source/blender/editors/armature/armature_add.c b/source/blender/editors/armature/armature_add.c
index 514ae696cb6..ee9ef9debaf 100644
--- a/source/blender/editors/armature/armature_add.c
+++ b/source/blender/editors/armature/armature_add.c
@@ -505,7 +505,7 @@ static int armature_duplicate_selected_exec(bContext *C, wmOperator *op)
if (arm->flag & ARM_MIRROR_EDIT) {
for (ebone_iter = arm->edbo->first; ebone_iter; ebone_iter = ebone_iter->next) {
if (EBONE_VISIBLE(arm, ebone_iter) &&
- (ebone_iter->flag & BONE_SELECTED))
+ (ebone_iter->flag & BONE_SELECTED))
{
EditBone *ebone;
@@ -520,7 +520,7 @@ static int armature_duplicate_selected_exec(bContext *C, wmOperator *op)
/* Find the selected bones and duplicate them as needed */
for (ebone_iter = arm->edbo->first; ebone_iter && ebone_iter != ebone_first_dupe; ebone_iter = ebone_iter->next) {
if (EBONE_VISIBLE(arm, ebone_iter) &&
- (ebone_iter->flag & BONE_SELECTED))
+ (ebone_iter->flag & BONE_SELECTED))
{
EditBone *ebone;
char new_bone_name_buff[MAXBONENAME];
@@ -547,7 +547,7 @@ static int armature_duplicate_selected_exec(bContext *C, wmOperator *op)
/* Run though the list and fix the pointers */
for (ebone_iter = arm->edbo->first; ebone_iter && ebone_iter != ebone_first_dupe; ebone_iter = ebone_iter->next) {
if (EBONE_VISIBLE(arm, ebone_iter) &&
- (ebone_iter->flag & BONE_SELECTED))
+ (ebone_iter->flag & BONE_SELECTED))
{
EditBone *ebone = ebone_iter->temp.ebone;
@@ -660,7 +660,7 @@ static int armature_symmetrize_exec(bContext *C, wmOperator *op)
/* Select mirrored bones */
for (ebone_iter = arm->edbo->first; ebone_iter; ebone_iter = ebone_iter->next) {
if (EBONE_VISIBLE(arm, ebone_iter) &&
- (ebone_iter->flag & BONE_SELECTED))
+ (ebone_iter->flag & BONE_SELECTED))
{
char name_flip[MAXBONENAME];
@@ -718,9 +718,9 @@ static int armature_symmetrize_exec(bContext *C, wmOperator *op)
/* Find the selected bones and duplicate them as needed, with mirrored name */
for (ebone_iter = arm->edbo->first; ebone_iter && ebone_iter != ebone_first_dupe; ebone_iter = ebone_iter->next) {
if (EBONE_VISIBLE(arm, ebone_iter) &&
- (ebone_iter->flag & BONE_SELECTED) &&
- /* will be set if the mirror bone already exists (no need to make a new one) */
- (ebone_iter->temp.ebone == NULL))
+ (ebone_iter->flag & BONE_SELECTED) &&
+ /* will be set if the mirror bone already exists (no need to make a new one) */
+ (ebone_iter->temp.ebone == NULL))
{
char name_flip[MAXBONENAME];
@@ -759,9 +759,10 @@ static int armature_symmetrize_exec(bContext *C, wmOperator *op)
}
else {
/* the parent may have been duplicated, if not lookup the mirror parent */
- EditBone *ebone_parent =
- (ebone_iter->parent->temp.ebone ?
- ebone_iter->parent->temp.ebone : ED_armature_ebone_get_mirrored(arm->edbo, ebone_iter->parent));
+ EditBone *ebone_parent = (
+ ebone_iter->parent->temp.ebone ?
+ ebone_iter->parent->temp.ebone :
+ ED_armature_ebone_get_mirrored(arm->edbo, ebone_iter->parent));
if (ebone_parent == NULL) {
/* If the mirror lookup failed, (but the current bone has a parent)
@@ -796,14 +797,20 @@ static int armature_symmetrize_exec(bContext *C, wmOperator *op)
* so we don't need this anymore */
/* Deselect the old bones and select the new ones */
- for (ebone_iter = arm->edbo->first; ebone_iter && ebone_iter != ebone_first_dupe; ebone_iter = ebone_iter->next) {
+ for (ebone_iter = arm->edbo->first;
+ ebone_iter && ebone_iter != ebone_first_dupe;
+ ebone_iter = ebone_iter->next)
+ {
if (EBONE_VISIBLE(arm, ebone_iter)) {
ebone_iter->flag &= ~(BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
}
}
/* New bones will be selected, but some of the bones may already exist */
- for (ebone_iter = arm->edbo->first; ebone_iter && ebone_iter != ebone_first_dupe; ebone_iter = ebone_iter->next) {
+ for (ebone_iter = arm->edbo->first;
+ ebone_iter && ebone_iter != ebone_first_dupe;
+ ebone_iter = ebone_iter->next)
+ {
EditBone *ebone = ebone_iter->temp.ebone;
if (ebone && EBONE_SELECTABLE(arm, ebone)) {
ED_armature_ebone_select_set(ebone, true);
@@ -936,7 +943,8 @@ static int armature_extrude_exec(bContext *C, wmOperator *op)
copy_v3_v3(newbone->tail, newbone->head);
newbone->parent = ebone;
- newbone->flag = ebone->flag & (BONE_TIPSEL | BONE_RELATIVE_PARENTING); // copies it, in case mirrored bone
+ /* copies it, in case mirrored bone */
+ newbone->flag = ebone->flag & (BONE_TIPSEL | BONE_RELATIVE_PARENTING);
if (newbone->parent) newbone->flag |= BONE_CONNECTED;
}
diff --git a/source/blender/editors/armature/armature_edit.c b/source/blender/editors/armature/armature_edit.c
index 2e0d49b9683..16e5450423b 100644
--- a/source/blender/editors/armature/armature_edit.c
+++ b/source/blender/editors/armature/armature_edit.c
@@ -966,7 +966,7 @@ static int armature_merge_exec(bContext *C, wmOperator *op)
/* get chains (ends on chains) */
chains_find_tips(arm->edbo, &chains);
if (BLI_listbase_is_empty(&chains)) {
- continue;
+ continue;
}
/* each 'chain' is the last bone in the chain (with no children) */
@@ -982,8 +982,8 @@ static int armature_merge_exec(bContext *C, wmOperator *op)
for (ebo = chain->data; ebo; child = ebo, ebo = ebo->parent) {
/* check if visible + selected */
if (EBONE_VISIBLE(arm, ebo) &&
- ((ebo->flag & BONE_CONNECTED) || (ebo->parent == NULL)) &&
- (ebo->flag & BONE_SELECTED) )
+ ((ebo->flag & BONE_CONNECTED) || (ebo->parent == NULL)) &&
+ (ebo->flag & BONE_SELECTED) )
{
/* set either end or start (end gets priority, unless it is already set) */
if (bend == NULL) {
diff --git a/source/blender/editors/armature/armature_naming.c b/source/blender/editors/armature/armature_naming.c
index 687dad4745e..15247399401 100644
--- a/source/blender/editors/armature/armature_naming.c
+++ b/source/blender/editors/armature/armature_naming.c
@@ -429,10 +429,10 @@ static int armature_flip_names_exec(bContext *C, wmOperator *op)
BLI_addtail(&bones_names, BLI_genericNodeN(ebone->name));
if (arm->flag & ARM_MIRROR_EDIT) {
- EditBone *flipbone = ED_armature_ebone_get_mirrored(arm->edbo, ebone);
- if ((flipbone) && !(flipbone->flag & BONE_SELECTED)) {
- BLI_addtail(&bones_names, BLI_genericNodeN(flipbone->name));
- }
+ EditBone *flipbone = ED_armature_ebone_get_mirrored(arm->edbo, ebone);
+ if ((flipbone) && !(flipbone->flag & BONE_SELECTED)) {
+ BLI_addtail(&bones_names, BLI_genericNodeN(flipbone->name));
+ }
}
}
}
diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c
index 57bb41aab9b..36330f1e17a 100644
--- a/source/blender/makesrna/intern/rna_gpencil.c
+++ b/source/blender/makesrna/intern/rna_gpencil.c
@@ -1252,10 +1252,10 @@ static void rna_def_gpencil_grid(BlenderRNA *brna)
srna = RNA_def_struct(brna, "GreasePencilGrid", NULL);
RNA_def_struct_sdna(srna, "bGPgrid");
RNA_def_struct_nested(brna, srna, "GreasePencil");
-
+
RNA_def_struct_path_func(srna, "rna_GreasePencilGrid_path");
RNA_def_struct_ui_text(srna, "Grid and Canvas Settings",
- "Settings for grid and canvas in 3D viewport");
+ "Settings for grid and canvas in 3D viewport");
prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "scale");
diff --git a/source/blender/python/generic/py_capi_utils.h b/source/blender/python/generic/py_capi_utils.h
index 523712d0cb0..609f8dc1bed 100644
--- a/source/blender/python/generic/py_capi_utils.h
+++ b/source/blender/python/generic/py_capi_utils.h
@@ -132,7 +132,7 @@ Py_LOCAL_INLINE(int64_t) PyC_Long_AsI64(PyObject *value) { return (int64_t)PyLo
Py_LOCAL_INLINE(uint64_t) PyC_Long_AsU64(PyObject *value) { return (uint64_t)PyLong_AsUnsignedLongLong(value); }
/* utils for format string in `struct` module style syntax */
-Py_LOCAL_INLINE(char) PyC_Formatstr_get(char *typestr)
+Py_LOCAL_INLINE(char) PyC_Formatstr_get(const char *typestr)
{
switch (typestr[0]) {
case '!':
diff --git a/source/blender/python/gpu/gpu_py_vertex_format.c b/source/blender/python/gpu/gpu_py_vertex_format.c
index f05e7bd29d0..65d41a7baf1 100644
--- a/source/blender/python/gpu/gpu_py_vertex_format.c
+++ b/source/blender/python/gpu/gpu_py_vertex_format.c
@@ -146,10 +146,9 @@ static int bpygpu_ParseVertFetchMode(PyObject *o, void *p)
static int get_default_fetch_mode(GPUVertCompType type)
{
- switch (type)
- {
- case GPU_COMP_F32: return GPU_FETCH_FLOAT;
- default: return -1;
+ switch (type) {
+ case GPU_COMP_F32: return GPU_FETCH_FLOAT;
+ default: return -1;
}
}
More information about the Bf-blender-cvs
mailing list