[Bf-blender-cvs] [4c22807e69c] blender2.8: Cleanup: style

Campbell Barton noreply at git.blender.org
Wed Oct 3 00:11:05 CEST 2018


Commit: 4c22807e69c0c31f23e3fea8249035729577137c
Author: Campbell Barton
Date:   Wed Oct 3 08:10:48 2018 +1000
Branches: blender2.8
https://developer.blender.org/rB4c22807e69c0c31f23e3fea8249035729577137c

Cleanup: style

===================================================================

M	source/blender/blenkernel/intern/constraint.c
M	source/blender/draw/intern/draw_cache_impl_mesh.c
M	source/blender/draw/intern/draw_common.c
M	source/blender/editors/armature/armature_select.c
M	source/blender/editors/mesh/editmesh_extrude_spin_gizmo.c

===================================================================

diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c
index 575f534c7ca..095aabb793c 100644
--- a/source/blender/blenkernel/intern/constraint.c
+++ b/source/blender/blenkernel/intern/constraint.c
@@ -3550,8 +3550,7 @@ static void shrinkwrap_get_tarmat(struct Depsgraph *depsgraph, bConstraint *con,
 						                              &hit, treeData.raycast_callback, &treeData);
 					}
 
-					if (hit.index < 0)
-					{
+					if (hit.index < 0) {
 						fail = true;
 						break;
 					}
diff --git a/source/blender/draw/intern/draw_cache_impl_mesh.c b/source/blender/draw/intern/draw_cache_impl_mesh.c
index ae842b7de6a..8a18d2adcbb 100644
--- a/source/blender/draw/intern/draw_cache_impl_mesh.c
+++ b/source/blender/draw/intern/draw_cache_impl_mesh.c
@@ -4779,7 +4779,7 @@ static void uvedit_fill_buffer_data(
 		BM_elem_flag_set(efa, BM_ELEM_TAG, uvedit_face_visible_test(scene, ob, ima, efa));
 
 		if ((state & UVEDIT_STRETCH_AREA) &&
-			BM_elem_flag_test(efa, BM_ELEM_TAG))
+		    BM_elem_flag_test(efa, BM_ELEM_TAG))
 		{
 			const int efa_len = efa->len;
 			float (*tf_uv)[2] = (float (*)[2])BLI_buffer_reinit_data(&vec2_buf, vec2f, efa_len);
diff --git a/source/blender/draw/intern/draw_common.c b/source/blender/draw/intern/draw_common.c
index d4cac6fb549..de300201f1b 100644
--- a/source/blender/draw/intern/draw_common.c
+++ b/source/blender/draw/intern/draw_common.c
@@ -949,7 +949,7 @@ bool DRW_object_axis_orthogonal_to_view(Object *ob, int axis)
 	return false;
 }
 
-static void DRW_evaluate_weight_to_color(float *result, float weight)
+static void DRW_evaluate_weight_to_color(const float weight, float result[4])
 {
 	if (U.flag & USER_CUSTOM_RANGE) {
 		BKE_colorband_evaluate(&U.coba_weight, weight, result);
@@ -959,7 +959,7 @@ static void DRW_evaluate_weight_to_color(float *result, float weight)
 		 * increasing widens yellow/cyan vs red/green/blue.
 		 * Gamma 1.0 produces the original 2.79 color ramp. */
 		const float gamma = 1.5f;
-		float hsv[3] = { (2.0f / 3.0f) * (1.0f - weight), 1.0f, pow(0.5f + 0.5f * weight, gamma) };
+		float hsv[3] = {(2.0f / 3.0f) * (1.0f - weight), 1.0f, pow(0.5f + 0.5f * weight, gamma)};
 
 		hsv_to_rgb_v(hsv, result);
 
@@ -972,11 +972,11 @@ static void DRW_evaluate_weight_to_color(float *result, float weight)
 static GPUTexture *DRW_create_weight_colorramp_texture(void)
 {
 	char error[256];
-	float pixels[256 * 4];
+	float pixels[256][4];
 	for (int i = 0 ; i < 256 ; i ++) {
-		DRW_evaluate_weight_to_color(&pixels[i*4], i / 255.0f);
-		pixels[(i * 4) + 3] = 1.0f;
+		DRW_evaluate_weight_to_color(i / 255.0f, pixels[i]);
+		pixels[i][3] = 1.0f;
 	}
 
-	return GPU_texture_create_1D(256, GPU_RGBA8, pixels, error);
+	return GPU_texture_create_1D(256, GPU_RGBA8, pixels[0], error);
 }
diff --git a/source/blender/editors/armature/armature_select.c b/source/blender/editors/armature/armature_select.c
index e6cea45cc2b..15ccc24ebe2 100644
--- a/source/blender/editors/armature/armature_select.c
+++ b/source/blender/editors/armature/armature_select.c
@@ -1011,7 +1011,7 @@ static void select_similar_length(bContext *C, const float thresh)
 			if (EBONE_SELECTABLE(arm, ebone)) {
 				const float len_iter = bone_length_squared_worldspace_get(ob, ebone);
 				if ((len_iter > len_min) &&
-					(len_iter < len_max))
+				    (len_iter < len_max))
 				{
 					ED_armature_ebone_select_set(ebone, true);
 					changed = true;
@@ -1494,7 +1494,7 @@ static int armature_select_mirror_exec(bContext *C, wmOperator *op)
 				int flag_new = extend ? EBONE_PREV_FLAG_GET(ebone) : 0;
 
 				if ((ebone_mirror = ED_armature_ebone_get_mirrored(arm->edbo, ebone)) &&
-					(EBONE_VISIBLE(arm, ebone_mirror)))
+				    (EBONE_VISIBLE(arm, ebone_mirror)))
 				{
 					const int flag_mirror = EBONE_PREV_FLAG_GET(ebone_mirror);
 					flag_new |= flag_mirror;
diff --git a/source/blender/editors/mesh/editmesh_extrude_spin_gizmo.c b/source/blender/editors/mesh/editmesh_extrude_spin_gizmo.c
index 18bd5771866..db2bb3bc66d 100644
--- a/source/blender/editors/mesh/editmesh_extrude_spin_gizmo.c
+++ b/source/blender/editors/mesh/editmesh_extrude_spin_gizmo.c
@@ -26,17 +26,15 @@
 
 #include "BKE_context.h"
 
+#include "RNA_define.h"
 #include "RNA_access.h"
+#include "RNA_enum_types.h"
 
 #include "WM_api.h"
 #include "WM_types.h"
 #include "WM_message.h"
 #include "WM_toolsystem.h"
 
-#include "RNA_define.h"
-#include "RNA_access.h"
-#include "RNA_enum_types.h"
-
 #include "ED_gizmo_utils.h"
 #include "ED_screen.h"
 #include "ED_view3d.h"



More information about the Bf-blender-cvs mailing list