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>2018-06-25 13:02:57 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-06-25 13:06:51 +0300
commit29c106924408a508b2f37af9e09d9eb46adc6fad (patch)
tree1858cfeb59d259a434da39848ee130ae8aa63627
parent7a4d5b78ea061196f7bf1550928680e9f094e38b (diff)
Cleanup: code style
-rw-r--r--source/blender/blenfont/intern/blf_glyph.c4
-rw-r--r--source/blender/blenkernel/BKE_blender_user_menu.h1
-rw-r--r--source/blender/blenkernel/BKE_mesh_iterators.h2
-rw-r--r--source/blender/blenkernel/BKE_studiolight.h6
-rw-r--r--source/blender/blenkernel/intern/layer.c2
-rw-r--r--source/blender/blenkernel/intern/library.c4
-rw-r--r--source/blender/blenkernel/intern/rigidbody.c2
-rw-r--r--source/blender/blenkernel/intern/studiolight.c53
-rw-r--r--source/blender/blenloader/intern/versioning_280.c5
-rw-r--r--source/blender/depsgraph/intern/builder/deg_builder_nodes.cc7
-rw-r--r--source/blender/depsgraph/intern/depsgraph.cc2
-rw-r--r--source/blender/depsgraph/intern/depsgraph_physics.cc2
-rw-r--r--source/blender/draw/engines/workbench/workbench_deferred.c3
-rw-r--r--source/blender/draw/engines/workbench/workbench_forward.c3
-rw-r--r--source/blender/draw/engines/workbench/workbench_materials.c5
-rw-r--r--source/blender/editors/interface/interface_icons.c5
-rw-r--r--source/blender/editors/object/object_add.c2
-rw-r--r--source/blender/editors/object/object_edit.c4
-rw-r--r--source/blender/editors/screen/screen_user_menu.c4
-rw-r--r--source/blender/editors/space_outliner/outliner_draw.c2
-rw-r--r--source/blender/editors/space_outliner/outliner_tree.c5
-rw-r--r--source/blender/gpu/intern/gpu_texture.c5
-rw-r--r--source/blender/makesrna/intern/rna_modifier.c2
-rw-r--r--source/blender/makesrna/intern/rna_space.c2
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c11
25 files changed, 61 insertions, 82 deletions
diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c
index 51b43d0d168..84388bedb7b 100644
--- a/source/blender/blenfont/intern/blf_glyph.c
+++ b/source/blender/blenfont/intern/blf_glyph.c
@@ -223,7 +223,7 @@ static void blf_glyph_cache_texture(FontBLF *font, GlyphCacheBLF *gc)
if (UNLIKELY(gc->texture_current >= gc->textures_len)) {
gc->textures_len *= 2;
- gc->textures = MEM_recallocN((void *)gc->textures, sizeof(GPUTexture*) * gc->textures_len);
+ gc->textures = MEM_recallocN((void *)gc->textures, sizeof(GPUTexture *) * gc->textures_len);
}
gc->p2_width = (int)blf_next_p2((unsigned int)((gc->glyphs_len_free * gc->glyph_width_max) + (gc->pad * 2)));
@@ -239,7 +239,7 @@ static void blf_glyph_cache_texture(FontBLF *font, GlyphCacheBLF *gc)
}
unsigned char *pixels = MEM_callocN((size_t)gc->p2_width * (size_t)gc->p2_height, "BLF texture init");
- GPUTexture *tex = GPU_texture_create_2D(gc->p2_width, gc->p2_height, GPU_R8, (const float*)pixels, error);
+ GPUTexture *tex = GPU_texture_create_2D(gc->p2_width, gc->p2_height, GPU_R8, (const float *)pixels, error);
MEM_freeN(pixels);
gc->textures[gc->texture_current] = tex;
GPU_texture_bind(tex, 0);
diff --git a/source/blender/blenkernel/BKE_blender_user_menu.h b/source/blender/blenkernel/BKE_blender_user_menu.h
index 9f8d1d62951..ff314314646 100644
--- a/source/blender/blenkernel/BKE_blender_user_menu.h
+++ b/source/blender/blenkernel/BKE_blender_user_menu.h
@@ -19,6 +19,7 @@
*/
#ifndef __BKE_BLENDER_USER_MENU_H__
+#define __BKE_BLENDER_USER_MENU_H__
/** \file BKE_blender_user_menu.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_mesh_iterators.h b/source/blender/blenkernel/BKE_mesh_iterators.h
index cbf156b8052..edd5ad783d2 100644
--- a/source/blender/blenkernel/BKE_mesh_iterators.h
+++ b/source/blender/blenkernel/BKE_mesh_iterators.h
@@ -24,7 +24,7 @@
#ifndef __BKE_MESH_ITERATORS_H__
#define __BKE_MESH_ITERATORS_H__
-/** \file BKE_MESH_ITERATORS.h
+/** \file BKE_mesh_iterators.h
* \ingroup bke
*/
diff --git a/source/blender/blenkernel/BKE_studiolight.h b/source/blender/blenkernel/BKE_studiolight.h
index faa48717210..e3edcca5aca 100644
--- a/source/blender/blenkernel/BKE_studiolight.h
+++ b/source/blender/blenkernel/BKE_studiolight.h
@@ -133,7 +133,7 @@ typedef struct StudioLight {
* that cleans up all icons. just to keep the code simple.
*/
StudioLightFreeFunction *free_function;
- void* free_function_data;
+ void *free_function_data;
} StudioLight;
void BKE_studiolight_init(void);
@@ -141,11 +141,11 @@ void BKE_studiolight_free(void);
struct StudioLight *BKE_studiolight_find(const char *name, int flag);
struct StudioLight *BKE_studiolight_findindex(int index, int flag);
struct StudioLight *BKE_studiolight_find_first(int flag);
-void BKE_studiolight_preview(uint* icon_buffer, StudioLight *sl, int icon_id_type);
+void BKE_studiolight_preview(uint *icon_buffer, StudioLight *sl, int icon_id_type);
struct ListBase *BKE_studiolight_listbase(void);
void BKE_studiolight_ensure_flag(StudioLight *sl, int flag);
void BKE_studiolight_refresh(void);
-StudioLight *BKE_studiolight_new(const char* path, int orientation);
+StudioLight *BKE_studiolight_new(const char *path, int orientation);
void BKE_studiolight_remove(StudioLight *sl);
void BKE_studiolight_set_free_function(StudioLight *sl, StudioLightFreeFunction *free_function, void *data);
void BKE_studiolight_unset_icon_id(StudioLight *sl, int icon_id);
diff --git a/source/blender/blenkernel/intern/layer.c b/source/blender/blenkernel/intern/layer.c
index c44884c3dbf..42e6cec253a 100644
--- a/source/blender/blenkernel/intern/layer.c
+++ b/source/blender/blenkernel/intern/layer.c
@@ -657,7 +657,7 @@ static int layer_collection_sync(
int object_restrict = base->object->restrictflag;
if (((child_restrict & COLLECTION_RESTRICT_VIEW) == 0) &&
- ((object_restrict & OB_RESTRICT_VIEW) == 0))
+ ((object_restrict & OB_RESTRICT_VIEW) == 0))
{
base->flag |= BASE_VISIBLED | BASE_VISIBLE_VIEWPORT;
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index fa9432213f9..c2cdc8df1e6 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -2561,8 +2561,8 @@ void BKE_id_tag_clear_atomic(ID *id, int tag)
/** Check that given ID pointer actually is in G_MAIN.
* Main intended use is for debug asserts in places we cannot easily get rid of G_Main... */
-bool BKE_id_is_in_gobal_main(ID *id) {
+bool BKE_id_is_in_gobal_main(ID *id)
+{
/* We do not want to fail when id is NULL here, even though this is a bit strange behavior... */
return (id == NULL || BLI_findindex(which_libbase(G_MAIN, GS(id->name)), id) != -1);
}
-
diff --git a/source/blender/blenkernel/intern/rigidbody.c b/source/blender/blenkernel/intern/rigidbody.c
index 6d38b9b1188..ab324726812 100644
--- a/source/blender/blenkernel/intern/rigidbody.c
+++ b/source/blender/blenkernel/intern/rigidbody.c
@@ -238,7 +238,7 @@ RigidBodyCon *BKE_rigidbody_copy_constraint(const Object *ob, const int UNUSED(f
/* get the appropriate DerivedMesh based on rigid body mesh source */
static Mesh *rigidbody_get_mesh(Object *ob)
{
- switch(ob->rigidbody_object->mesh_source) {
+ switch (ob->rigidbody_object->mesh_source) {
case RBO_MESH_DEFORM:
return ob->runtime.mesh_deform_eval;
case RBO_MESH_FINAL:
diff --git a/source/blender/blenkernel/intern/studiolight.c b/source/blender/blenkernel/intern/studiolight.c
index a371f89e0b2..b2a1785542c 100644
--- a/source/blender/blenkernel/intern/studiolight.c
+++ b/source/blender/blenkernel/intern/studiolight.c
@@ -211,8 +211,7 @@ static void studiolight_load_equirectangular_image(StudioLight *sl)
if (sl->flag & STUDIOLIGHT_EXTERNAL_FILE) {
ImBuf *ibuf = NULL;
ibuf = IMB_loadiffname(sl->path, 0, NULL);
- if (ibuf == NULL)
- {
+ if (ibuf == NULL) {
float *colbuf = MEM_mallocN(sizeof(float[4]), __func__);
copy_v4_fl4(colbuf, 1.0f, 0.0f, 1.0f, 1.0f);
ibuf = IMB_allocFromBuffer(NULL, colbuf, 1, 1);
@@ -499,8 +498,7 @@ static void studiolight_calculate_spherical_harmonics_coefficient(StudioLight *s
#ifdef STUDIOLIGHT_SPHERICAL_HARMONICS_WINDOWING
static void studiolight_calculate_spherical_harmonics_luminance(StudioLight *sl, float luminance[STUDIOLIGHT_SPHERICAL_HARMONICS_COMPONENTS])
{
- for (int index = 0; index < STUDIOLIGHT_SPHERICAL_HARMONICS_COMPONENTS; index++)
- {
+ for (int index = 0; index < STUDIOLIGHT_SPHERICAL_HARMONICS_COMPONENTS; index++) {
luminance[index] = rgb_to_grayscale(sl->spherical_harmonics_coefs[index]);
}
}
@@ -519,40 +517,34 @@ static void studiolight_apply_spherical_harmonics_windowing(StudioLight *sl, flo
studiolight_calculate_spherical_harmonics_luminance(sl, luminance);
int index = 1;
- for (int level = 1; level <= STUDIOLIGHT_SPHERICAL_HARMONICS_LEVEL; level ++)
- {
+ for (int level = 1; level <= STUDIOLIGHT_SPHERICAL_HARMONICS_LEVEL; level++) {
table_l[level] = (float)(SQUARE(level) * SQUARE(level + 1));
float b = 0.0f;
- for (int m = -1; m <= level; m++)
- {
+ for (int m = -1; m <= level; m++) {
b += SQUARE(luminance[index++]);
}
table_b[level] = b;
}
float squared_lamplacian = 0.0f;
- for (int level = 1; level <= STUDIOLIGHT_SPHERICAL_HARMONICS_LEVEL; level ++)
- {
+ for (int level = 1; level <= STUDIOLIGHT_SPHERICAL_HARMONICS_LEVEL; level++) {
squared_lamplacian += table_l[level] * table_b[level];
}
const float target_squared_laplacian = max_lamplacian * max_lamplacian;
- if (squared_lamplacian <= target_squared_laplacian)
- {
+ if (squared_lamplacian <= target_squared_laplacian) {
return;
}
float lambda = 0.0f;
const int no_iterations = 10000000;
- for (int i = 0; i < no_iterations; ++i)
- {
+ for (int i = 0; i < no_iterations; ++i) {
float f = 0.0f;
float fd = 0.0f;
- for (int level = 1; level <= (int)STUDIOLIGHT_SPHERICAL_HARMONICS_LEVEL; ++level)
- {
+ for (int level = 1; level <= (int)STUDIOLIGHT_SPHERICAL_HARMONICS_LEVEL; ++level) {
f += table_l[level] * table_b[level] / SQUARE(1.0f + lambda * table_l[level]);
fd += (2.0f * SQUARE(table_l[level]) * table_b[level]) / CUBE(1.0f + lambda * table_l[level]);
}
@@ -562,20 +554,17 @@ static void studiolight_apply_spherical_harmonics_windowing(StudioLight *sl, flo
float delta = -f / fd;
lambda += delta;
- if (ABS(delta) < 1e-6f)
- {
+ if (ABS(delta) < 1e-6f) {
break;
}
}
/* Apply windowing lambda */
index = 0;
- for (int level = 0; level <= STUDIOLIGHT_SPHERICAL_HARMONICS_LEVEL; level ++)
- {
+ for (int level = 0; level <= STUDIOLIGHT_SPHERICAL_HARMONICS_LEVEL; level ++) {
float s = 1.0f / (1.0f + lambda * SQUARE(level) * SQUARE(level + 1.0f));
- for (int m = -1; m <= level; m++)
- {
+ for (int m = -1; m <= level; m++) {
mul_v3_fl(sl->spherical_harmonics_coefs[index++], s);
}
}
@@ -726,8 +715,7 @@ static bool studiolight_load_spherical_harmonics_coefficients(StudioLight *sl)
if (sl->flag & STUDIOLIGHT_EXTERNAL_FILE) {
FILE *fp = BLI_fopen(sl->path_sh_cache, "rb");
if (fp) {
- if (fread((void*)(sl->spherical_harmonics_coefs), sizeof(sl->spherical_harmonics_coefs), 1, fp))
- {
+ if (fread((void *)(sl->spherical_harmonics_coefs), sizeof(sl->spherical_harmonics_coefs), 1, fp)) {
sl->flag |= STUDIOLIGHT_SPHERICAL_HARMONICS_COEFFICIENTS_CALCULATED;
fclose(fp);
return true;
@@ -823,7 +811,7 @@ static void studiolight_calculate_light_direction(StudioLight *sl)
sl->flag |= STUDIOLIGHT_LIGHT_DIRECTION_CALCULATED;
}
-static StudioLight* studiolight_add_file(const char *path, int flag)
+static StudioLight *studiolight_add_file(const char *path, int flag)
{
char filename[FILE_MAXFILE];
BLI_split_file_part(path, filename, FILE_MAXFILE);
@@ -901,7 +889,7 @@ static uint alpha_circle_mask(float u, float v, float inner_edge, float outer_ed
#define STUDIOLIGHT_DIAMETER 0.95f
-static void studiolight_radiance_preview(uint* icon_buffer, StudioLight *sl)
+static void studiolight_radiance_preview(uint *icon_buffer, StudioLight *sl)
{
BKE_studiolight_ensure_flag(sl, STUDIOLIGHT_EXTERNAL_IMAGE_LOADED);
@@ -946,7 +934,7 @@ static void studiolight_radiance_preview(uint* icon_buffer, StudioLight *sl)
}
}
-static void studiolight_matcap_preview(uint* icon_buffer, StudioLight *sl, bool flipped)
+static void studiolight_matcap_preview(uint *icon_buffer, StudioLight *sl, bool flipped)
{
BKE_studiolight_ensure_flag(sl, STUDIOLIGHT_EXTERNAL_IMAGE_LOADED);
@@ -977,7 +965,7 @@ static void studiolight_matcap_preview(uint* icon_buffer, StudioLight *sl, bool
}
}
-static void studiolight_irradiance_preview(uint* icon_buffer, StudioLight *sl)
+static void studiolight_irradiance_preview(uint *icon_buffer, StudioLight *sl)
{
BKE_studiolight_ensure_flag(sl, STUDIOLIGHT_SPHERICAL_HARMONICS_COEFFICIENTS_CALCULATED);
@@ -1104,7 +1092,7 @@ struct ListBase *BKE_studiolight_listbase(void)
return &studiolights;
}
-void BKE_studiolight_preview(uint* icon_buffer, StudioLight *sl, int icon_id_type)
+void BKE_studiolight_preview(uint *icon_buffer, StudioLight *sl, int icon_id_type)
{
switch (icon_id_type) {
case STUDIOLIGHT_ICON_ID_TYPE_RADIANCE:
@@ -1170,16 +1158,15 @@ void BKE_studiolight_ensure_flag(StudioLight *sl, int flag)
*/
void BKE_studiolight_remove(StudioLight *sl)
{
- if (sl->flag & STUDIOLIGHT_USER_DEFINED)
- {
+ if (sl->flag & STUDIOLIGHT_USER_DEFINED) {
BLI_remlink(&studiolights, sl);
studiolight_free(sl);
}
}
-StudioLight *BKE_studiolight_new(const char* path, int orientation)
+StudioLight *BKE_studiolight_new(const char *path, int orientation)
{
- StudioLight * sl = studiolight_add_file(path, orientation | STUDIOLIGHT_USER_DEFINED);
+ StudioLight *sl = studiolight_add_file(path, orientation | STUDIOLIGHT_USER_DEFINED);
return sl;
}
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index 08b1e47cbaa..5fb2c4820d1 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -1496,8 +1496,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {
if (sl->spacetype == SPACE_VIEW3D) {
View3D *v3d = (View3D *)sl;
- if (v3d->drawtype == OB_TEXTURE)
- {
+ if (v3d->drawtype == OB_TEXTURE) {
v3d->drawtype = OB_SOLID;
v3d->shading.light = V3D_LIGHTING_STUDIO;
v3d->shading.color_type = V3D_SHADING_TEXTURE_COLOR;
@@ -1516,7 +1515,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {
if (sl->spacetype == SPACE_VIEW3D) {
View3D *v3d = (View3D *)sl;
- float alpha = v3d->flag2 & V3D_SHOW_MODE_SHADE_OVERRIDE? 0.0f: 0.8f;
+ float alpha = v3d->flag2 & V3D_SHOW_MODE_SHADE_OVERRIDE ? 0.0f : 0.8f;
v3d->overlay.texture_paint_mode_opacity = alpha;
v3d->overlay.vertex_paint_mode_opacity = alpha;
v3d->overlay.weight_paint_mode_opacity = alpha;
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
index 524933a5f37..cfb2f1bc8d6 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
@@ -463,9 +463,10 @@ void DepsgraphNodeBuilder::build_collection(
/* Build collection objects. */
LISTBASE_FOREACH (CollectionObject *, cob, &collection->gobject) {
if (allow_restrict_flags) {
- const int restrict_flag = (graph_->mode == DAG_EVAL_VIEWPORT)
- ? OB_RESTRICT_VIEW
- : OB_RESTRICT_RENDER;
+ const int restrict_flag = (
+ (graph_->mode == DAG_EVAL_VIEWPORT) ?
+ OB_RESTRICT_VIEW :
+ OB_RESTRICT_RENDER);
if (cob->ob->restrictflag & restrict_flag) {
continue;
}
diff --git a/source/blender/depsgraph/intern/depsgraph.cc b/source/blender/depsgraph/intern/depsgraph.cc
index 5b7cf3d5a16..bb340492a63 100644
--- a/source/blender/depsgraph/intern/depsgraph.cc
+++ b/source/blender/depsgraph/intern/depsgraph.cc
@@ -94,7 +94,7 @@ Depsgraph::Depsgraph(Scene *scene,
ctime(BKE_scene_frame_get(scene)),
scene_cow(NULL),
is_active(false),
- effector_relations(NULL)
+ effector_relations(NULL)
{
BLI_spin_init(&lock);
id_hash = BLI_ghash_ptr_new("Depsgraph id hash");
diff --git a/source/blender/depsgraph/intern/depsgraph_physics.cc b/source/blender/depsgraph/intern/depsgraph_physics.cc
index d26ba845dd5..fb14c020f81 100644
--- a/source/blender/depsgraph/intern/depsgraph_physics.cc
+++ b/source/blender/depsgraph/intern/depsgraph_physics.cc
@@ -53,7 +53,7 @@ ListBase *DEG_get_effector_relations(const Depsgraph *graph,
return NULL;
}
- return (ListBase*)BLI_ghash_lookup(deg_graph->effector_relations, collection);
+ return (ListBase *)BLI_ghash_lookup(deg_graph->effector_relations, collection);
}
/*********************** Internal API ************************/
diff --git a/source/blender/draw/engines/workbench/workbench_deferred.c b/source/blender/draw/engines/workbench/workbench_deferred.c
index 39a4197bdf3..4fe3e92f10c 100644
--- a/source/blender/draw/engines/workbench/workbench_deferred.c
+++ b/source/blender/draw/engines/workbench/workbench_deferred.c
@@ -584,8 +584,7 @@ static WORKBENCH_MaterialData *get_or_create_material_data(
copy_v4_v4(material->material_data.diffuse_color, material_template.material_data.diffuse_color);
copy_v4_v4(material->material_data.specular_color, material_template.material_data.specular_color);
material->material_data.roughness = material_template.material_data.roughness;
- if (color_type == V3D_SHADING_TEXTURE_COLOR)
- {
+ if (color_type == V3D_SHADING_TEXTURE_COLOR) {
GPUTexture *tex = GPU_texture_from_blender(ima, NULL, GL_TEXTURE_2D, false, 0.0);
DRW_shgroup_uniform_texture(material->shgrp, "image", tex);
}
diff --git a/source/blender/draw/engines/workbench/workbench_forward.c b/source/blender/draw/engines/workbench/workbench_forward.c
index 47fcaa0ca66..9f23cd5b43b 100644
--- a/source/blender/draw/engines/workbench/workbench_forward.c
+++ b/source/blender/draw/engines/workbench/workbench_forward.c
@@ -179,8 +179,7 @@ static WORKBENCH_MaterialData *get_or_create_material_data(
copy_v4_v4(material->material_data.specular_color, material_template.material_data.specular_color);
material->material_data.roughness = material_template.material_data.roughness;
- if (color_type == V3D_SHADING_TEXTURE_COLOR)
- {
+ if (color_type == V3D_SHADING_TEXTURE_COLOR) {
GPUTexture *tex = GPU_texture_from_blender(ima, NULL, GL_TEXTURE_2D, false, 0.0f);
DRW_shgroup_uniform_texture(grp, "image", tex);
}
diff --git a/source/blender/draw/engines/workbench/workbench_materials.c b/source/blender/draw/engines/workbench/workbench_materials.c
index a8c677b4070..76599fdce99 100644
--- a/source/blender/draw/engines/workbench/workbench_materials.c
+++ b/source/blender/draw/engines/workbench/workbench_materials.c
@@ -10,7 +10,7 @@
void workbench_material_update_data(WORKBENCH_PrivateData *wpd, Object *ob, Material *mat, WORKBENCH_MaterialData *data)
{
/* When V3D_SHADING_TEXTURE_COLOR is active, use V3D_SHADING_MATERIAL_COLOR as fallback when no texture could be determined */
- int color_type = wpd->shading.color_type == V3D_SHADING_TEXTURE_COLOR? V3D_SHADING_MATERIAL_COLOR: wpd->shading.color_type;
+ int color_type = wpd->shading.color_type == V3D_SHADING_TEXTURE_COLOR ? V3D_SHADING_MATERIAL_COLOR : wpd->shading.color_type;
static float default_diffuse_color[] = {0.8f, 0.8f, 0.8f, 1.0f};
static float default_specular_color[] = {0.5f, 0.5f, 0.5f, 0.5f};
copy_v4_v4(data->material_data.diffuse_color, default_diffuse_color);
@@ -169,8 +169,7 @@ void workbench_material_set_normal_world_matrix(
int workbench_material_determine_color_type(WORKBENCH_PrivateData *wpd, Image *ima)
{
int color_type = wpd->shading.color_type;
- if (color_type == V3D_SHADING_TEXTURE_COLOR && ima == NULL)
- {
+ if (color_type == V3D_SHADING_TEXTURE_COLOR && ima == NULL) {
color_type = V3D_SHADING_MATERIAL_COLOR;
}
return color_type;
diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c
index 64fca05c082..ec9112247e6 100644
--- a/source/blender/editors/interface/interface_icons.c
+++ b/source/blender/editors/interface/interface_icons.c
@@ -858,7 +858,7 @@ static void ui_studiolight_kill_icon_preview_job(wmWindowManager *wm, int icon_i
icon->obj = NULL;
}
-static void ui_studiolight_free_function(StudioLight * sl, void* data)
+static void ui_studiolight_free_function(StudioLight *sl, void* data)
{
wmWindowManager *wm = data;
@@ -920,7 +920,7 @@ void ui_icon_ensure_deferred(const bContext *C, const int icon_id, const bool bi
di->data.buffer.image = img;
wmJob *wm_job = WM_jobs_get(wm, CTX_wm_window(C), icon, "StudioLight Icon", 0, WM_JOB_TYPE_STUDIOLIGHT);
- Icon** tmp = MEM_callocN(sizeof(Icon*), __func__);
+ Icon **tmp = MEM_callocN(sizeof(Icon*), __func__);
*tmp = icon;
WM_jobs_customdata_set(wm_job, tmp, MEM_freeN);
WM_jobs_timer(wm_job, 0.01, 0, NC_WINDOW);
@@ -1647,4 +1647,3 @@ void UI_icon_draw_preview_aspect_size(float x, float y, int icon_id, float aspec
{
icon_draw_size(x, y, icon_id, aspect, alpha, NULL, ICON_SIZE_PREVIEW, size, false);
}
-
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c
index 336e1075911..b216ebbad7c 100644
--- a/source/blender/editors/object/object_add.c
+++ b/source/blender/editors/object/object_add.c
@@ -1016,7 +1016,7 @@ static int object_lamp_add_exec(bContext *C, wmOperator *op)
float size = RNA_float_get(op->ptr, "radius");
/* Better defaults for lamp size. */
- switch(type) {
+ switch (type) {
case LA_LOCAL:
case LA_SPOT:
break;
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c
index 3139eb911e9..19bcb14f395 100644
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@ -315,7 +315,8 @@ void ED_hide_collections_menu_draw(const bContext *C, uiLayout *layout)
}
if ((view_layer->runtime_flag & VIEW_LAYER_HAS_HIDE) &&
- !(lc->runtime_flag & LAYER_COLLECTION_HAS_VISIBLE_OBJECTS)) {
+ !(lc->runtime_flag & LAYER_COLLECTION_HAS_VISIBLE_OBJECTS))
+ {
uiLayoutSetActive(row, false);
}
@@ -2097,4 +2098,3 @@ void OBJECT_OT_link_to_collection(wmOperatorType *ot)
"Name of the newly added collection");
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
}
-
diff --git a/source/blender/editors/screen/screen_user_menu.c b/source/blender/editors/screen/screen_user_menu.c
index ab5a3a4008c..d942602c896 100644
--- a/source/blender/editors/screen/screen_user_menu.c
+++ b/source/blender/editors/screen/screen_user_menu.c
@@ -88,8 +88,8 @@ bUserMenuItem_Op *ED_screen_user_menu_item_find_operator(
if (umi->type == USER_MENU_TYPE_OPERATOR) {
bUserMenuItem_Op *umi_op = (bUserMenuItem_Op *)umi;
if (STREQ(ot->idname, umi_op->opname) &&
- (opcontext == umi_op->opcontext) &&
- (IDP_EqualsProperties(prop, umi_op->prop)))
+ (opcontext == umi_op->opcontext) &&
+ (IDP_EqualsProperties(prop, umi_op->prop)))
{
return umi_op;
}
diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c
index 4368b74f8a7..64a9c901175 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -1516,7 +1516,7 @@ static void outliner_draw_iconrow(
const int num_subtypes = (i == INDEX_ID_OB) ? OB_TYPE_MAX : 1;
/* See tree_element_id_type_to_index for the index logic. */
int index_base = i;
- if (i > INDEX_ID_OB){
+ if (i > INDEX_ID_OB) {
index_base += OB_TYPE_MAX;
}
for (int j = 0; j < num_subtypes; j++) {
diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c
index 13b62b766f5..01df653c86d 100644
--- a/source/blender/editors/space_outliner/outliner_tree.c
+++ b/source/blender/editors/space_outliner/outliner_tree.c
@@ -1493,7 +1493,8 @@ static void outliner_add_layer_collections_recursive(
const bool exclude = (lc->flag & LAYER_COLLECTION_EXCLUDE) != 0;
if (exclude ||
((layer->runtime_flag & VIEW_LAYER_HAS_HIDE) &&
- !(lc->runtime_flag & LAYER_COLLECTION_HAS_VISIBLE_OBJECTS))) {
+ !(lc->runtime_flag & LAYER_COLLECTION_HAS_VISIBLE_OBJECTS)))
+ {
ten->flag |= TE_DISABLED;
}
@@ -2268,5 +2269,3 @@ void outliner_build_tree(Main *mainvar, Scene *scene, ViewLayer *view_layer, Spa
BKE_main_id_clear_newpoins(mainvar);
}
-
-
diff --git a/source/blender/gpu/intern/gpu_texture.c b/source/blender/gpu/intern/gpu_texture.c
index 6fa2a39bf03..21a3aee5f57 100644
--- a/source/blender/gpu/intern/gpu_texture.c
+++ b/source/blender/gpu/intern/gpu_texture.c
@@ -924,7 +924,7 @@ void GPU_texture_update_sub(
break;
default:
BLI_assert(!"tex->target mode not supported");
- }
+ }
if (tex->bytesize == 1) {
glPixelStorei(GL_UNPACK_ALIGNMENT, alignment);
@@ -1273,8 +1273,7 @@ void GPU_blend(bool enable)
static GLenum gpu_get_gl_blendfunction(GPUBlendFunction blend)
{
- switch (blend)
- {
+ switch (blend) {
case GPU_ONE:
return GL_ONE;
case GPU_SRC_ALPHA:
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index 1e548339e33..48ebc02cee0 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -901,7 +901,7 @@ static const EnumPropertyItem *rna_DataTransferModifier_layers_select_src_itemf(
return rna_enum_dt_layers_select_src_items;
}
- Depsgraph *depsgraph= CTX_data_depsgraph(C);
+ Depsgraph *depsgraph = CTX_data_depsgraph(C);
Scene *scene = CTX_data_scene(C);
/* No active here! */
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index e7ff13fb23b..8dab3551efa 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -2238,7 +2238,7 @@ static void rna_def_space_outliner(BlenderRNA *brna)
static const EnumPropertyItem display_mode_items[] = {
{SO_SCENES, "SCENES", ICON_SCENE_DATA, "Scenes", "Display scenes and their view layers, collections and objects"},
- {SO_VIEW_LAYER, "VIEW_LAYER",ICON_RENDER_RESULT, "View Layer", "Display collections and objects in the view layer"},
+ {SO_VIEW_LAYER, "VIEW_LAYER", ICON_RENDER_RESULT, "View Layer", "Display collections and objects in the view layer"},
{SO_SEQUENCE, "SEQUENCE", ICON_SEQUENCE, "Sequence", "Display sequence data-blocks"},
{SO_LIBRARIES, "LIBRARIES", ICON_FILE_BLEND, "Blender File", "Display data of current file and linked libraries"},
{SO_DATA_API, "DATA_API", ICON_RNA, "Data API", "Display low level Blender data and its properties"},
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index e4bedf53d72..4190303beb9 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -680,7 +680,7 @@ static void rna_StudioLights_remove(UserDef *UNUSED(userdef), StudioLight *studi
BKE_studiolight_remove(studio_light);
}
-static StudioLight* rna_StudioLights_new(UserDef *UNUSED(userdef), const char* path, int orientation)
+static StudioLight *rna_StudioLights_new(UserDef *UNUSED(userdef), const char *path, int orientation)
{
return BKE_studiolight_new(path, orientation);
}
@@ -724,8 +724,7 @@ static void rna_UserDef_studiolight_path_irr_cache_get(PointerRNA *ptr, char *va
static int rna_UserDef_studiolight_path_irr_cache_length(PointerRNA *ptr)
{
StudioLight *sl = (StudioLight *)ptr->data;
- if (sl->path_irr_cache)
- {
+ if (sl->path_irr_cache) {
return strlen(sl->path_irr_cache);
}
return 0;
@@ -744,8 +743,7 @@ static void rna_UserDef_studiolight_path_sh_cache_get(PointerRNA *ptr, char *val
static int rna_UserDef_studiolight_path_sh_cache_length(PointerRNA *ptr)
{
StudioLight *sl = (StudioLight *)ptr->data;
- if (sl->path_sh_cache)
- {
+ if (sl->path_sh_cache) {
return strlen(sl->path_sh_cache);
}
return 0;
@@ -777,8 +775,7 @@ static void rna_UserDef_studiolight_spherical_harmonics_coefficients_get(Pointer
{
StudioLight *sl = (StudioLight *)ptr->data;
float *value = values;
- for (int i = 0; i < STUDIOLIGHT_SPHERICAL_HARMONICS_COMPONENTS; i++)
- {
+ for (int i = 0; i < STUDIOLIGHT_SPHERICAL_HARMONICS_COMPONENTS; i++) {
copy_v3_v3(value, sl->spherical_harmonics_coefs[i]);
value += 3;
}