Cleanup: style
authorCampbell Barton <ideasman42@gmail.com>
Mon, 24 Apr 2017 11:58:28 +0000 (21:58 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 24 Apr 2017 12:00:46 +0000 (22:00 +1000)
15 files changed:
source/blender/blenkernel/intern/depsgraph.c
source/blender/blenkernel/intern/idprop.c
source/blender/blenkernel/intern/library_query.c
source/blender/blenkernel/intern/mesh_evaluate.c
source/blender/blenkernel/intern/object_dupli.c
source/blender/blenlib/BLI_hash.h
source/blender/blenloader/intern/versioning_270.c
source/blender/blenloader/intern/writefile.c
source/blender/editors/gpencil/gpencil_interpolate.c
source/blender/editors/gpencil/gpencil_select.c
source/blender/editors/object/object_relations.c
source/blender/gpu/intern/gpu_draw.c
source/blender/modifiers/intern/MOD_surfacedeform.c
source/blender/nodes/shader/nodes/node_shader_object_info.c
source/blender/python/intern/bpy_rna.c

index 302e55a1f5a25399120f9db3dd7564db15faeb59..019e0df1623aa8ea2c993ee0e8f264caa94faa86 100644 (file)
@@ -3053,7 +3053,7 @@ void DAG_id_type_tag(Main *bmain, short idtype)
                DAG_id_type_tag(bmain, ID_SCE);
        }
 
-       atomic_fetch_and_or_uint8((uint8_t*)&bmain->id_tag_update[BKE_idcode_to_index(idtype)], 1);
+       atomic_fetch_and_or_uint8((uint8_t *)&bmain->id_tag_update[BKE_idcode_to_index(idtype)], 1);
 }
 
 int DAG_id_type_tagged(Main *bmain, short idtype)
index 074a9a12fe087f1e50c5ca873f00112ab7441cc2..e98181be4440ec79fabe943b54fe7b35442a8e0e 100644 (file)
@@ -953,7 +953,7 @@ IDProperty *IDP_New(const char type, const IDPropertyTemplate *val, const char *
                                prop->len = prop->totallen = val->array.len;
                                break;
                        }
-                       printf("%s: bad array type.\n",__func__);
+                       printf("%s: bad array type.\n", __func__);
                        return NULL;
                }
                case IDP_STRING:
index 7d56b4a55534eacba40a553658246e4225ee581a..3d65fa9b6e1bfe9f2705ce6817ebb277e5370a55 100644 (file)
@@ -978,6 +978,7 @@ void BKE_library_foreach_ID_link(Main *bmain, ID *id, LibraryIDLinkCallback call
                                for (bGPDlayer *gp_layer = gpencil->layers.first; gp_layer; gp_layer = gp_layer->next) {
                                        CALLBACK_INVOKE(gp_layer->parent, IDWALK_CB_NOP);
                                }
+                               break;
                        }
 
                        /* Nothing needed for those... */
index 0d0055113b7fcc6d459ef10ddfa3698492b81881..c725e884b58753389d50418f0f750d3c3061a574 100644 (file)
@@ -1026,7 +1026,7 @@ static bool loop_split_generator_check_cyclic_smooth_fan(
        BLI_assert(!BLI_BITMAP_TEST(skip_loops, mlfan_vert_index));
        BLI_BITMAP_ENABLE(skip_loops, mlfan_vert_index);
 
-       while(true) {
+       while (true) {
                /* Find next loop of the smooth fan. */
                loop_manifold_fan_around_vert_next(
                            mloops, mpolys, loop_to_poly, e2lfan_curr, mv_pivot_index,
index eb7abc2f0046bcb35413ecbce96613c7bf571efc..e9ebd397df0b6435db068a95a87f24e1679eb218 100644 (file)
@@ -186,8 +186,9 @@ static DupliObject *make_dupli(const DupliContext *ctx,
        dob->random_id = BLI_hash_string(dob->ob->id.name + 2);
 
        if (dob->persistent_id[0] != INT_MAX) {
-               for(i = 0; i < MAX_DUPLI_RECUR*2; i++)
+               for (i = 0; i < MAX_DUPLI_RECUR * 2; i++) {
                        dob->random_id = BLI_hash_int_2d(dob->random_id, (unsigned int)dob->persistent_id[i]);
+               }
        }
        else {
                dob->random_id = BLI_hash_int_2d(dob->random_id, 0);
index 50c7a7f9f0f197e37735dec5257fd3cb308eb590..e849e5f8f6165af4e8687ffc810be17e2e4a649e 100644 (file)
@@ -27,7 +27,7 @@
 
 BLI_INLINE unsigned int BLI_hash_int_2d(unsigned int kx, unsigned int ky)
 {
-#define rot(x,k) (((x)<<(k)) | ((x)>>(32-(k))))
+#define rot(x, k) (((x) << (k)) | ((x) >> (32 - (k))))
 
        unsigned int a, b, c;
 
@@ -35,13 +35,13 @@ BLI_INLINE unsigned int BLI_hash_int_2d(unsigned int kx, unsigned int ky)
        a += kx;
        b += ky;
 
-       c ^= b; c -= rot(b,14);
-       a ^= c; a -= rot(c,11);
-       b ^= a; b -= rot(a,25);
-       c ^= b; c -= rot(b,16);
-       a ^= c; a -= rot(c,4);
-       b ^= a; b -= rot(a,14);
-       c ^= b; c -= rot(b,24);
+       c ^= b; c -= rot(b, 14);
+       a ^= c; a -= rot(c, 11);
+       b ^= a; b -= rot(a, 25);
+       c ^= b; c -= rot(b, 16);
+       a ^= c; a -= rot(c, 4);
+       b ^= a; b -= rot(a, 14);
+       c ^= b; c -= rot(b, 24);
 
        return c;
 
@@ -52,9 +52,9 @@ BLI_INLINE unsigned int BLI_hash_string(const char *str)
 {
        unsigned int i = 0, c;
 
-       while((c = *str++))
+       while ((c = *str++)) {
                i = i * 37 + c;
-
+       }
        return i;
 }
 
index d3f33cf725f852586a6959e676b0083d109f9ab9..bc88bbb899783b4eb39e2215d1b493e34dc36ec1 100644 (file)
@@ -1259,7 +1259,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
 
                for (Camera *camera = main->camera.first; camera != NULL; camera = camera->id.next) {
                        if (camera->stereo.pole_merge_angle_from == 0.0f &&
-                               camera->stereo.pole_merge_angle_to == 0.0f)
+                           camera->stereo.pole_merge_angle_to == 0.0f)
                        {
                                camera->stereo.pole_merge_angle_from = DEG2RADF(60.0f);
                                camera->stereo.pole_merge_angle_to = DEG2RADF(75.0f);
index 57be237be6fc7cf25b682009a17b0f7428f7470f..723b7929667d335d9568948892c756f06023c2f3 100644 (file)
@@ -1317,8 +1317,8 @@ static void write_particlesettings(WriteData *wd, ParticleSettings *part)
                                dw->index = 0;
                                if (part->dup_group) { /* can be NULL if lining fails or set to None */
                                        for (GroupObject *go = part->dup_group->gobject.first;
-                                                go && go->ob != dw->ob;
-                                                go = go->next, dw->index++);
+                                            go && go->ob != dw->ob;
+                                            go = go->next, dw->index++);
                                }
                        }
                        writestruct(wd, DATA, ParticleDupliWeight, 1, dw);
@@ -2654,8 +2654,8 @@ static void write_scene(WriteData *wd, Scene *sce)
                                }
                                if (seq->type == SEQ_TYPE_IMAGE) {
                                        writestruct(wd, DATA, StripElem,
-                                                               MEM_allocN_len(strip->stripdata) / sizeof(struct StripElem),
-                                                               strip->stripdata);
+                                                   MEM_allocN_len(strip->stripdata) / sizeof(struct StripElem),
+                                                   strip->stripdata);
                                }
                                else if (ELEM(seq->type, SEQ_TYPE_MOVIE, SEQ_TYPE_SOUND_RAM, SEQ_TYPE_SOUND_HD)) {
                                        writestruct(wd, DATA, StripElem, 1, strip->stripdata);
@@ -3362,13 +3362,13 @@ static void write_mask(WriteData *wd, Mask *mask)
                        }
 
                        for (masklay_shape = masklay->splines_shapes.first;
-                                masklay_shape;
-                                masklay_shape = masklay_shape->next)
+                            masklay_shape;
+                            masklay_shape = masklay_shape->next)
                        {
                                writestruct(wd, DATA, MaskLayerShape, 1, masklay_shape);
                                writedata(wd, DATA,
-                                                 masklay_shape->tot_vert * sizeof(float) * MASK_OBJECT_SHAPE_ELEM_SIZE,
-                                                 masklay_shape->data);
+                                         masklay_shape->tot_vert * sizeof(float) * MASK_OBJECT_SHAPE_ELEM_SIZE,
+                                         masklay_shape->data);
                        }
                }
        }
@@ -3854,7 +3854,7 @@ static bool write_file_handle(
                                        write_scene(wd, (Scene *)id);
                                        break;
                                case ID_CU:
-                                       write_curve(wd,(Curve *)id);
+                                       write_curve(wd, (Curve *)id);
                                        break;
                                case ID_MB:
                                        write_mball(wd, (MetaBall *)id);
index d2360fea67206e101ee7cb01bc69b5656ea06515..6947ca6b3766d0f6597616b0732c6f3b05862346 100644 (file)
@@ -77,7 +77,6 @@
 #include "ED_object.h"
 #include "ED_screen.h"
 #include "ED_view3d.h"
-#include "ED_screen.h"
 #include "ED_space_api.h"
 
 #include "gpencil_intern.h"
index 45dbde802848d17b7e2130ddfb76b2c401fdf9c1..2912a1ac4eb628fc8cabffe36cafbcb28e4e5215 100644 (file)
@@ -1012,7 +1012,7 @@ static int gpencil_lasso_select_exec(bContext *C, wmOperator *op)
                        }
                        /* test if in lasso boundbox + within the lasso noose */
                        if ((!ELEM(V2D_IS_CLIPPED, x0, y0)) && BLI_rcti_isect_pt(&rect, x0, y0) &&
-                               BLI_lasso_is_point_inside(mcords, mcords_tot, x0, y0, INT_MAX))
+                           BLI_lasso_is_point_inside(mcords, mcords_tot, x0, y0, INT_MAX))
                        {
                                if (select) {
                                        pt->flag |= GP_SPOINT_SELECT;
index 861e249b0eecdfb521a1c0ec53acc0ffb0290a13..5a0921f711933931f05d80eca7e4fc37defba32f 100644 (file)
@@ -2109,7 +2109,7 @@ void ED_object_single_users(Main *bmain, Scene *scene, const bool full, const bo
                for (Base *base = scene->base.first; base; base = base->next) {
                        Object *ob = base->object;
                        if (!ID_IS_LINKED_DATABLOCK(ob)) {
-                                       IDP_RelinkProperty(ob->id.properties);
+                               IDP_RelinkProperty(ob->id.properties);
                        }
                }
 
index 79934190cbcbcc0ccc345c395a61686dad387c49..1583d16ca27ef8637e446dfca14ceca797cc3782 100644 (file)
@@ -1912,7 +1912,7 @@ static void GPU_get_object_info(float oi[3], Material *mat)
        else {
                random = BLI_hash_int_2d(BLI_hash_string(GMS.gob->id.name + 2), 0);
        }
-       oi[2] = random * (1.0f/(float)0xFFFFFFFF);
+       oi[2] = random * (1.0f / (float)0xFFFFFFFF);
 }
 
 int GPU_object_material_bind(int nr, void *attribs)
index e9ec90198c41e74096e036ad0d9ec4862111579b..79e3eb5f3dfacac1fc0aa35dcd25cec6fa9ac88c 100644 (file)
@@ -1152,9 +1152,11 @@ static void surfacedeformModifier_do(ModifierData *md, float (*vertexCos)[3], un
        }
 
        /* Actual vertex location update starts here */
-       SDefDeformData data = {.bind_verts = smd->verts,
-                                  .targetCos = MEM_mallocN(sizeof(float[3]) * tnumverts, "SDefTargetVertArray"),
-                                  .vertexCos = vertexCos};
+       SDefDeformData data = {
+               .bind_verts = smd->verts,
+               .targetCos = MEM_mallocN(sizeof(float[3]) * tnumverts, "SDefTargetVertArray"),
+               .vertexCos = vertexCos,
+       };
 
        if (data.targetCos != NULL) {
                bool tdm_vert_alloc;
index 165d565a5b40388fba75ab2b92e1a8689e4f5ab9..63d3bac88a0123c90e00cecbd033aa8eb21674af 100644 (file)
@@ -48,7 +48,7 @@ static void node_shader_exec_object_info(void *data, int UNUSED(thread), bNode *
        copy_v4_v4(out[0]->vec, RE_object_instance_get_matrix(scd->shi->obi, RE_OBJECT_INSTANCE_MATRIX_OB)[3]);
        out[1]->vec[0] = RE_object_instance_get_object_pass_index(scd->shi->obi);
        out[2]->vec[0] = scd->shi->mat->index;
-       out[3]->vec[0] = RE_object_instance_get_random_id(scd->shi->obi) * (1.0f/(float)0xFFFFFFFF);;
+       out[3]->vec[0] = RE_object_instance_get_random_id(scd->shi->obi) * (1.0f / (float)0xFFFFFFFF);
 }
 
 /* node type definition */
index 00627030db3c9190b070b0c66cd77a7422eb493e..dc247f28539cd6a077aa7f6e74d6c77fe9d92a62 100644 (file)
@@ -7107,8 +7107,8 @@ static int deferred_register_prop(StructRNA *srna, PyObject *key, PyObject *item
                                    RNA_struct_idprops_contains_datablock(type_srna))
                                {
                                        PyErr_Format(PyExc_ValueError,
-                                                                "bpy_struct \"%.200s\" doesn't support datablock properties \n",
-                                                                RNA_struct_identifier(srna));
+                                                    "bpy_struct \"%.200s\" doesn't support datablock properties \n",
+                                                    RNA_struct_identifier(srna));
                                        return -1;
                                }
                        }