Cleanup: style
authorCampbell Barton <ideasman42@gmail.com>
Sat, 21 Apr 2018 18:42:27 +0000 (20:42 +0200)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 21 Apr 2018 18:42:27 +0000 (20:42 +0200)
23 files changed:
source/blender/blenfont/intern/blf_internal_types.h
source/blender/blenkernel/intern/dynamicpaint.c
source/blender/blenlib/intern/math_color.c
source/blender/blenloader/intern/versioning_280.c
source/blender/draw/engines/eevee/eevee_engine.c
source/blender/draw/engines/eevee/eevee_temporal_sampling.c
source/blender/draw/engines/workbench/workbench_materials.c
source/blender/draw/intern/draw_manager.c
source/blender/draw/intern/draw_manager_exec.c
source/blender/draw/modes/overlay_mode.c
source/blender/editors/mesh/editmesh_tools.c
source/blender/editors/screen/area.c
source/blender/editors/screen/screen_edit.c
source/blender/editors/transform/transform_generics.c
source/blender/editors/transform/transform_manipulator.c
source/blender/editors/uvedit/uvedit_draw.c
source/blender/gpu/GPU_framebuffer.h
source/blender/gpu/GPU_material.h
source/blender/gpu/intern/gpu_texture.c
source/blender/makesdna/DNA_space_types.h
source/blender/makesdna/DNA_view3d_types.h
source/blender/modifiers/intern/MOD_uvproject.c
source/blender/windowmanager/message_bus/intern/wm_message_bus_static.c

index 1d70980d33d5eeda2c9b688aa70c8676ce291e27..c80b542206181680ef3207d224da16bde0e73eee 100644 (file)
@@ -35,7 +35,7 @@
 
 #define BLF_BATCH_DRAW_LEN_MAX 2048 /* in glyph */
 
-typedef struct BatchBLF{
+typedef struct BatchBLF {
        struct FontBLF *font; /* can only batch glyph from the same font */
        struct Gwn_Batch *batch;
        struct Gwn_VertBuf *verts;
index 27840af291b4abcc432d5bec5ea5e744e1f5a469..187edd5b4a5addc96f5317acab2a8e6c7ad713d8 100644 (file)
@@ -5967,12 +5967,12 @@ static int dynamicPaint_doStep(struct Depsgraph *depsgraph, Scene *scene, Object
 
                                        /* Apply brush on the surface depending on it's collision type */
                                        if (brush->psys && brush->psys->part &&
-                                               ELEM(brush->psys->part->type, PART_EMITTER, PART_FLUID) &&
-                                               psys_check_enabled(brushObj, brush->psys, G.is_rendering))
+                                           ELEM(brush->psys->part->type, PART_EMITTER, PART_FLUID) &&
+                                           psys_check_enabled(brushObj, brush->psys, G.is_rendering))
                                        {
                                                /* Paint a particle system */
                                                BKE_animsys_evaluate_animdata(scene, &brush->psys->part->id, brush->psys->part->adt,
-                                                                                                         BKE_scene_frame_get(scene), ADT_RECALC_ANIM);
+                                                                             BKE_scene_frame_get(scene), ADT_RECALC_ANIM);
                                                dynamicPaint_paintParticles(surface, brush->psys, brush, timescale);
                                        }
                                        /* Object center distance: */
index 534abeb913db6cdd877c6f5349b1e68d6ba51199..3879a4096751482513015d58f76cd6f3142fce2c 100644 (file)
@@ -693,22 +693,22 @@ static const float blackbody_table_b[6][4] = {
 
 static void blackbody_temperature_to_rgb(float rgb[3], float t)
 {
-       if(t >= 12000.0f) {
+       if (t >= 12000.0f) {
                rgb[0] = 0.826270103f;
                rgb[1] = 0.994478524f;
                rgb[2] = 1.56626022f;
        }
-       else if(t < 965.0f) {
+       else if (t < 965.0f) {
                rgb[0] = 4.70366907f;
                rgb[1] = 0.0f;
                rgb[2] = 0.0f;
        }
        else {
-               int i = (t >= 6365.0f)? 5:
-                       (t >= 3315.0f)? 4:
-                       (t >= 1902.0f)? 3:
-                       (t >= 1449.0f)? 2:
-                       (t >= 1167.0f)? 1: 0;
+               int i = (t >= 6365.0f) ? 5 :
+                       (t >= 3315.0f) ? 4 :
+                       (t >= 1902.0f) ? 3 :
+                       (t >= 1449.0f) ? 2 :
+                       (t >= 1167.0f) ? 1 : 0;
 
                const float *r = blackbody_table_r[i];
                const float *g = blackbody_table_g[i];
index 4a22c935b683eb4e3884943d9fdf2b45e75026f4..ff4a0351a7bd752a32ef04b7c36998d2b4774780 100644 (file)
@@ -533,8 +533,8 @@ void do_versions_after_linking_280(Main *main)
                /* Due to several changes to particle RNA and draw code particles from older files may no longer
                 * be visible. Here we correct this by setting a default draw size for those files. */
                for (Object *object = main->object.first; object; object = object->id.next) {
-                       for (ParticleSystem *psys = object->particlesystem.first; psys; psys=psys->next) {
-                               if(psys->part->draw_size == 0.0f) {
+                       for (ParticleSystem *psys = object->particlesystem.first; psys; psys = psys->next) {
+                               if (psys->part->draw_size == 0.0f) {
                                        psys->part->draw_size = 0.1f;
                                }
                        }
@@ -617,7 +617,7 @@ void do_versions_after_linking_280(Main *main)
                                        }
                                }
                        }
-                       else if (object->transflag & OB_DUPLI){
+                       else if (object->transflag & OB_DUPLI) {
                                object->duplicator_visibility_flag = OB_DUPLI_FLAG_VIEWPORT;
                        }
                        else {
@@ -837,7 +837,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *main)
                }
 
                for (Group *group = main->group.first; group; group = group->id.next) {
-                       if (group->view_layer != NULL){
+                       if (group->view_layer != NULL) {
                                do_version_view_layer_visibility(group->view_layer);
                        }
                }
@@ -933,7 +933,8 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *main)
                /* Blender Internal removal */
                for (Scene *scene = main->scene.first; scene; scene = scene->id.next) {
                        if (STREQ(scene->r.engine, "BLENDER_RENDER") ||
-                           STREQ(scene->r.engine, "BLENDER_GAME")) {
+                           STREQ(scene->r.engine, "BLENDER_GAME"))
+                       {
                                BLI_strncpy(scene->r.engine, RE_engine_id_BLENDER_EEVEE, sizeof(scene->r.engine));
                        }
 
index 2c459f5ae3ba01c4946f40fdbb991f627595e314..4fa7561e6c4cf70d850827afabb0bf8e8787480b 100644 (file)
@@ -207,7 +207,7 @@ static void eevee_draw_background(void *vedata)
                bool taa_use_reprojection = (stl->effects->enabled_effects & EFFECT_TAA_REPROJECT) != 0;
 
                if (DRW_state_is_image_render() ||
-                       taa_use_reprojection ||
+                   taa_use_reprojection ||
                    ((stl->effects->enabled_effects & EFFECT_TAA) != 0))
                {
                        int samp = taa_use_reprojection
index 98a4371eb4c4caa8349fc2eb60df8d329444d752..dea6c362afab7b663819e3813aab051aba938909 100644 (file)
@@ -196,7 +196,7 @@ int EEVEE_temporal_sampling_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data
 
        int repro_flag = 0;
        if (!DRW_state_is_image_render() &&
-               BKE_collection_engine_property_value_get_bool(props, "taa_reprojection"))
+           BKE_collection_engine_property_value_get_bool(props, "taa_reprojection"))
        {
                repro_flag = EFFECT_TAA_REPROJECT | EFFECT_VELOCITY_BUFFER | EFFECT_DEPTH_DOUBLE_BUFFER | EFFECT_DOUBLE_BUFFER | EFFECT_POST_BUFFER;
                effects->taa_reproject_sample = ((effects->taa_reproject_sample + 1) % 16);
index f9646deca8eb9c9f687eeed04e9d351f0a1d033f..97d370795bc25e670c368ce7027e0b3ec978245c 100644 (file)
@@ -61,7 +61,8 @@ static void get_material_solid_color(WORKBENCH_PrivateData *wpd, Object *ob, flo
                unsigned int obhash = BLI_ghashutil_strhash(ob->id.name);
                cpack_to_rgb(obhash, &color[0], &color[1], &color[2]);
 
-       } else {
+       }
+       else {
                copy_v3_v3(color, ob->col);
        }
 }
@@ -142,7 +143,7 @@ void workbench_materials_solid_cache_populate(WORKBENCH_Data *vedata, Object *ob
                DRW_shgroup_call_add(stl->g_data->depth_shgrp, geom, ob->obmat);
 
                /* Solid */
-               GPUShader *shader = wpd->drawtype_lighting == V3D_LIGHTING_FLAT?e_data.solid_flat_sh:e_data.solid_studio_sh;
+               GPUShader *shader = wpd->drawtype_lighting == V3D_LIGHTING_FLAT ? e_data.solid_flat_sh : e_data.solid_studio_sh;
 
                float color[3];
                get_material_solid_color(wpd, ob, color);
index dcc005d190af98ef947ac8329a0aedb60cc3a6a6..d42bb09684cfa88a1d785c4944d36217c6b93118 100644 (file)
@@ -984,7 +984,8 @@ static void drw_engines_enable_from_mode(int mode)
        }
 }
 
-static void drw_engines_enable_from_overlays(int draw_overlays) {
+static void drw_engines_enable_from_overlays(int draw_overlays)
+{
        if (draw_overlays) {
                use_drw_engine(&draw_engine_overlay_type);
        }
index ff29d7d7f3da2f65a32d4f54b47527bcc6e32790..159a19a94c23c16f32633325ca7445c108b63ff7 100644 (file)
@@ -565,13 +565,13 @@ static void draw_clipping_setup_from_view(void)
                /* distance to view Z axis */
                f = len_v2(farpoint);
                /* get corresponding point on the near plane */
-               mul_v2_v2fl(farxy, farpoint, s/e);
+               mul_v2_v2fl(farxy, farpoint, s / e);
                /* this formula preserve the sign of n */
                sub_v2_v2(nearpoint, farxy);
                n = f * s / e - len_v2(nearpoint);
                c = len_v2(farcenter) / e;
                /* the big formula, it simplifies to (F-N)/(2(e-s)) for the symmetric case */
-               z = (F-N) / (2.0f * (e-s + c*(f-n)));
+               z = (F - N) / (2.0f * (e - s + c * (f - n)));
 
                bsphere->center[0] = farcenter[0] * z / e;
                bsphere->center[1] = farcenter[1] * z / e;
index 59e34ee7ba99a51823e5e1babf34541537082bcd..6ad1205a29625c50c68f6d8af3fe26debbea33d0 100644 (file)
@@ -110,8 +110,7 @@ static void overlay_cache_init(void *vedata)
        }
 
        /* Face Orientation Pass */
-       if (stl->g_data->overlays & V3D_OVERLAY_FACE_ORIENTATION)
-       {
+       if (stl->g_data->overlays & V3D_OVERLAY_FACE_ORIENTATION) {
                int state = DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_EQUAL | bm_face_orientation;
                psl->face_orientation_pass = DRW_pass_create("Face Orientation", state);
                stl->g_data->face_orientation_shgrp = DRW_shgroup_create(e_data.face_orientation_sh, psl->face_orientation_pass);
index 371f42e17b31eb9fc07922a129d532a718cc0931..88a4e1d148a9d3dbed86476b435b7f94448d0ac6 100644 (file)
@@ -1482,8 +1482,7 @@ static int edbm_face_make_planar_exec(bContext *C, wmOperator *op)
        const int repeat = RNA_int_get(op->ptr, "repeat");
        const float fac = RNA_float_get(op->ptr, "factor");
 
-       for (uint ob_index = 0; ob_index < objects_len; ob_index++)
-       {
+       for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
                Object *obedit = objects[ob_index];
                BMEditMesh *em = BKE_editmesh_from_object(obedit);
                if (em->bm->totfacesel == 0) {
@@ -1491,8 +1490,8 @@ static int edbm_face_make_planar_exec(bContext *C, wmOperator *op)
                }
 
                if (!EDBM_op_callf(
-                               em, op, "planar_faces faces=%hf iterations=%i factor=%f",
-                               BM_ELEM_SELECT, repeat, fac))
+                           em, op, "planar_faces faces=%hf iterations=%i factor=%f",
+                           BM_ELEM_SELECT, repeat, fac))
                {
                        continue;
                }
@@ -4488,8 +4487,8 @@ static int edbm_decimate_exec(bContext *C, wmOperator *op)
                }
 
                BM_mesh_decimate_collapse(
-                               em->bm, ratio_adjust, vweights, vertex_group_factor, false,
-                               symmetry_axis, symmetry_eps);
+                       em->bm, ratio_adjust, vweights, vertex_group_factor, false,
+                       symmetry_axis, symmetry_eps);
 
                MEM_freeN(vweights);
 
@@ -6093,9 +6092,9 @@ static int mesh_symmetrize_exec(bContext *C, wmOperator *op)
                const float thresh = RNA_float_get(op->ptr, "threshold");
 
                EDBM_op_init(
-                               em, &bmop, op,
-                               "symmetrize input=%hvef direction=%i dist=%f",
-                               BM_ELEM_SELECT, RNA_enum_get(op->ptr, "direction"), thresh);
+                       em, &bmop, op,
+                       "symmetrize input=%hvef direction=%i dist=%f",
+                       BM_ELEM_SELECT, RNA_enum_get(op->ptr, "direction"), thresh);
                BMO_op_exec(em->bm, &bmop);
 
                EDBM_flag_disable_all(em, BM_ELEM_SELECT);
index 2d058c7c0bfa2ca841eac5b689a2701eb01faf59..53ad1a47cf8000c6c50472f00b653c4a6d01eb11 100644 (file)
@@ -2221,7 +2221,7 @@ void ED_region_header(const bContext *C, ARegion *ar)
        UI_view2d_view_ortho(&ar->v2d);
 
        xco = maxco = start_ofs;
-       yco = headery + (ar->winy - headery)/2 - floor(0.2f * UI_UNIT_Y);
+       yco = headery + (ar->winy - headery) / 2 - floor(0.2f * UI_UNIT_Y);
 
        /* XXX workaround for 1 px alignment issue. Not sure what causes it... Would prefer a proper fix - Julian */
        if (CTX_wm_area(C)->spacetype == SPACE_TOPBAR) {
index 00bff69cd02c5f13400dfac7a912e741c4388b39..dba44909189154c513a1485529003b34f0b76923 100644 (file)
@@ -1527,7 +1527,7 @@ ScrArea *ED_screen_state_toggle(bContext *C, wmWindow *win, ScrArea *sa, const s
                        for (ar = newa->regionbase.first; ar; ar = ar->next) {
                                ar->flagfullscreen = ar->flag;
 
-                               if (ELEM(ar->regiontype, RGN_TYPE_UI, RGN_TYPE_HEADER, RGN_TYPE_TOOLS)){
+                               if (ELEM(ar->regiontype, RGN_TYPE_UI, RGN_TYPE_HEADER, RGN_TYPE_TOOLS)) {
                                        ar->flag |= RGN_FLAG_HIDDEN;
                                }
                        }
index 68240da1ccbf92e5833a39ee7aae44a5ae7394d5..a5ff091321e562556641d1ca7f552498385cb2bd 100644 (file)
@@ -1592,7 +1592,7 @@ void postTrans(bContext *C, TransInfo *t)
                FOREACH_TRANS_DATA_CONTAINER (t, tc) {
                        /* free data malloced per trans-data */
                        if (ELEM(t->obedit_type, OB_CURVE, OB_SURF) ||
-                               (t->spacetype == SPACE_IPO))
+                           (t->spacetype == SPACE_IPO))
                        {
                                TransData *td = tc->data;
                                for (int a = 0; a < tc->data_len; a++, td++) {
index 8221412b32a4a8ab783a8a402cb57b3037b232e5..46d3d9dd8944c92bc0ec2e1b064dd282cdfd6f13 100644 (file)
@@ -1597,7 +1597,7 @@ static void WIDGETGROUP_xform_cage_setup(const bContext *UNUSED(C), wmManipulato
                     ED_MANIPULATOR_CAGE2D_XFORM_FLAG_TRANSLATE);
 
        mpr->color[0] = 1;
-       mpr->color_hi[0] =1;
+       mpr->color_hi[0] = 1;
 
        mgroup->customdata = xmgroup;
 
index 945d30eabb504a1e2b018ddef7c814a9791eddf6..beaae691e5e3bc848bddf598740c107f56b198ad 100644 (file)
@@ -753,7 +753,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, ViewLayer *view_layer, Obje
 
        /* For more efficiency first transfer the entire buffer to vram. */
        Gwn_Batch *loop_batch = immBeginBatchAtMost(GWN_PRIM_LINE_LOOP, bm->totloop);
-       Gwn_VertBufloop_vbo = loop_batch->verts[0];
+       Gwn_VertBuf *loop_vbo = loop_batch->verts[0];
        BM_ITER_MESH(efa, &iter, bm, BM_FACES_OF_MESH) {
                if (!BM_elem_flag_test(efa, BM_ELEM_TAG))
                        continue;
index 0ab15a4ea4711e768bfbcae56e19b2b3c618a701..c99733ec6daa89a93e892d485de9b019f2e8ff35 100644 (file)
@@ -43,7 +43,7 @@ typedef struct GPUAttachment {
        int mip, layer;
 } GPUAttachment;
 
-typedef enum GPUFrameBufferBits{
+typedef enum GPUFrameBufferBits {
        GPU_COLOR_BIT    = (1 << 0),
        GPU_DEPTH_BIT    = (1 << 1),
        GPU_STENCIL_BIT  = (1 << 2),
index c9ef5ca3ae6433e3077e5bcd8d714d733729eafc..95492016f254bd6844aae73d7f5a2f80f0077340 100644 (file)
@@ -248,7 +248,7 @@ GPUMaterial *GPU_material_from_nodetree_find(
 GPUMaterial *GPU_material_from_nodetree(
         struct Scene *scene, struct bNodeTree *ntree, struct ListBase *gpumaterials, const void *engine_type, int options);
 void GPU_material_generate_pass(
-               GPUMaterial *mat, const char *vert_code, const char *geom_code, const char *frag_lib, const char *defines);
+        GPUMaterial *mat, const char *vert_code, const char *geom_code, const char *frag_lib, const char *defines);
 void GPU_material_free(struct ListBase *gpumaterial);
 
 void GPU_materials_free(void);
index bccc818aa3450703a40bf8756adbd3b576ba98f9..30c83091448ac4137c9631e00bff3e418491bf2b 100644 (file)
@@ -51,7 +51,7 @@ static struct GPUTextureGlobal {
 /* Maximum number of FBOs a texture can be attached to. */
 #define GPU_TEX_MAX_FBO_ATTACHED 8
 
-typedef enum GPUTextureFormatFlag{
+typedef enum GPUTextureFormatFlag {
        GPU_FORMAT_DEPTH     = (1 << 0),
        GPU_FORMAT_STENCIL   = (1 << 1),
        GPU_FORMAT_INTEGER   = (1 << 2),
index 403e22dac730621d1b42d603643eca8bb9589134..61bae6828b20faad704751a5391a9adb57bda5af 100644 (file)
@@ -296,11 +296,11 @@ typedef enum eSpaceOutliner_Filter {
        SO_FILTER_NO_OB_CAMERA     = (1 << 10),
        SO_FILTER_NO_OB_OTHERS     = (1 << 11),
 
-       SO_FILTER_OB_STATE         = (1 << 12),
-       SO_FILTER_OB_STATE_VISIBLE = (1 << 13), /* Not set via DNA. */
-       SO_FILTER_OB_STATE_SELECTED= (1 << 14), /* Not set via DNA. */
-       SO_FILTER_OB_STATE_ACTIVE  = (1 << 15), /* Not set via DNA. */
-       SO_FILTER_NO_COLLECTION    = (1 << 16),
+       SO_FILTER_OB_STATE          = (1 << 12),
+       SO_FILTER_OB_STATE_VISIBLE  = (1 << 13), /* Not set via DNA. */
+       SO_FILTER_OB_STATE_SELECTED = (1 << 14), /* Not set via DNA. */
+       SO_FILTER_OB_STATE_ACTIVE   = (1 << 15), /* Not set via DNA. */
+       SO_FILTER_NO_COLLECTION     = (1 << 16),
 } eSpaceOutliner_Filter;
 
 #define SO_FILTER_NO_OB_ALL (SO_FILTER_NO_OB_MESH | \
index d7f9e33d6beb87ad4f98b094150c3413661bdec0..d2bac12e9c81fa5f1c450130526cae0eaa1337b8 100644 (file)
@@ -81,7 +81,7 @@ enum {
 };
 
 enum {
-       V3D_DRAWOPTION_RANDOMIZE = (1<<0),
+       V3D_DRAWOPTION_RANDOMIZE = (1 << 0),
 };
 
 enum {
index fba0663571ec8a5d9043c0dca06ab1c3a4ea8241..1cffdeb0586d8aa5267488ee0d81f064ffb96369 100644 (file)
@@ -273,8 +273,7 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd,
                        best_projector = &projectors[0];
 
                        for (j = 1; j < num_projectors; ++j) {
-                               float tmp_dot = dot_v3v3(projectors[j].normal,
-                                                                                face_no);
+                               float tmp_dot = dot_v3v3(projectors[j].normal, face_no);
                                if (tmp_dot > best_dot) {
                                        best_dot = tmp_dot;
                                        best_projector = &projectors[j];
index d768e77c8fe6c75b0d4fdf3d2b8527a9eb8e14fb..da98cb75162803836670520b8888871bf782e885 100644 (file)
@@ -18,7 +18,7 @@
  * ***** END GPL LICENSE BLOCK *****
  */
 
-/** \file blender/windowmanager/intern/message_bus/wm_message_bus_static.c
+/** \file blender/windowmanager/message_bus/intern/wm_message_bus_static.c
  *  \ingroup wm
  */