Cleanup: style
authorCampbell Barton <ideasman42@gmail.com>
Sun, 7 Oct 2018 06:49:22 +0000 (17:49 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 7 Oct 2018 06:49:22 +0000 (17:49 +1100)
source/blender/editors/armature/armature_add.c
source/blender/editors/armature/armature_edit.c
source/blender/editors/armature/armature_naming.c
source/blender/makesrna/intern/rna_gpencil.c
source/blender/python/generic/py_capi_utils.h
source/blender/python/gpu/gpu_py_vertex_format.c

index 514ae69..ee9ef9d 100644 (file)
@@ -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;
                                                }
index 2e0d49b..16e5450 100644 (file)
@@ -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) {
index 687dad4..1524739 100644 (file)
@@ -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));
+                                               }
                                        }
                                }
                        }
index 57bb41a..36330f1 100644 (file)
@@ -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");
index 523712d..609f8dc 100644 (file)
@@ -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 '!':
index f05e7bd..65d41a7 100644 (file)
@@ -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;
        }
 }