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

Campbell Barton noreply at git.blender.org
Mon Oct 1 01:23:10 CEST 2018


Commit: 8ee4fd0bdfed1faaf89cc3e131e35cda5e8068b6
Author: Campbell Barton
Date:   Mon Oct 1 08:42:26 2018 +1000
Branches: blender2.8
https://developer.blender.org/rB8ee4fd0bdfed1faaf89cc3e131e35cda5e8068b6

Cleanup: style

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

M	source/blender/blenloader/intern/versioning_280.c
M	source/blender/draw/engines/gpencil/gpencil_draw_utils.c
M	source/blender/draw/intern/draw_common.c
M	source/blender/editors/armature/armature_edit.c
M	source/blender/editors/gpencil/annotate_paint.c
M	source/blender/editors/gpencil/gpencil_brush.c
M	source/blender/editors/interface/interface_handlers.c
M	source/blender/editors/interface/interface_icons.c
M	source/blender/editors/interface/interface_panel.c
M	source/blender/editors/interface/interface_widgets.c
M	source/blender/modifiers/intern/MOD_collision.c
M	source/blender/modifiers/intern/MOD_meshdeform.c
M	source/blender/python/gpu/gpu_py_element.c
M	source/blender/windowmanager/intern/wm_dragdrop.c

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

diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index 10fcbf6d557..c32cfa433bd 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -2080,7 +2080,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
 			for (Object *ob = bmain->object.first; ob; ob = ob->id.next) {
 				for (ModifierData *md = ob->modifiers.first; md; md = md->next) {
 					if (md->type == eModifierType_Shrinkwrap) {
-						ShrinkwrapModifierData *smd = (ShrinkwrapModifierData*)md;
+						ShrinkwrapModifierData *smd = (ShrinkwrapModifierData *)md;
 						if (smd->shrinkOpts & MOD_SHRINKWRAP_KEEP_ABOVE_SURFACE) {
 							smd->shrinkMode = MOD_SHRINKWRAP_ABOVE_SURFACE;
 							smd->shrinkOpts &= ~MOD_SHRINKWRAP_KEEP_ABOVE_SURFACE;
diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
index 345b0f0c577..f7823a2fced 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
@@ -881,8 +881,8 @@ static void gpencil_draw_strokes(
 
 		/* edit points (only in edit mode and not play animation not render) */
 		if ((draw_ctx->obact == ob) && (src_gps) &&
-			(!playing) && (!is_render) && (!cache_ob->is_dup_ob)
-			&& ((gpl->flag & GP_LAYER_LOCKED) == 0))
+		    (!playing) && (!is_render) && (!cache_ob->is_dup_ob) &&
+		    ((gpl->flag & GP_LAYER_LOCKED) == 0))
 		{
 			if (!stl->g_data->shgrps_edit_line) {
 				stl->g_data->shgrps_edit_line = DRW_shgroup_create(e_data->gpencil_line_sh, psl->edit_pass);
@@ -970,9 +970,9 @@ void DRW_gpencil_populate_buffer_strokes(GPENCIL_e_data *e_data, void *vedata, T
 				        stl->storage->unit_matrix);
 
 				if ((gpd->runtime.sbuffer_size >= 3) &&
-					(gpd->runtime.sfill[3] > GPENCIL_ALPHA_OPACITY_THRESH) &&
+				    (gpd->runtime.sfill[3] > GPENCIL_ALPHA_OPACITY_THRESH) &&
 				    ((gpd->runtime.sbuffer_sflag & GP_STROKE_NOFILL) == 0) &&
-					((brush->gpencil_settings->flag & GP_BRUSH_DISSABLE_LASSO) == 0))
+				    ((brush->gpencil_settings->flag & GP_BRUSH_DISSABLE_LASSO) == 0))
 				{
 					/* if not solid, fill is simulated with solid color */
 					if (gpd->runtime.bfill_style > 0) {
diff --git a/source/blender/draw/intern/draw_common.c b/source/blender/draw/intern/draw_common.c
index faa4d980cd1..d4cac6fb549 100644
--- a/source/blender/draw/intern/draw_common.c
+++ b/source/blender/draw/intern/draw_common.c
@@ -52,7 +52,7 @@ struct GPUTexture *globals_weight_ramp = NULL;
 static bool weight_ramp_custom = false;
 static ColorBand weight_ramp_copy;
 
-static struct GPUTexture* DRW_create_weight_colorramp_texture(void);
+static struct GPUTexture *DRW_create_weight_colorramp_texture(void);
 
 void DRW_globals_update(void)
 {
@@ -187,7 +187,8 @@ void DRW_globals_update(void)
 	bool user_weight_ramp = (U.flag & USER_CUSTOM_RANGE) != 0;
 
 	if (weight_ramp_custom != user_weight_ramp ||
-	    (user_weight_ramp && memcmp(&weight_ramp_copy, &U.coba_weight, sizeof(ColorBand)) != 0)) {
+	    (user_weight_ramp && memcmp(&weight_ramp_copy, &U.coba_weight, sizeof(ColorBand)) != 0))
+	{
 		DRW_TEXTURE_FREE_SAFE(globals_weight_ramp);
 	}
 
@@ -950,8 +951,7 @@ bool DRW_object_axis_orthogonal_to_view(Object *ob, int axis)
 
 static void DRW_evaluate_weight_to_color(float *result, float weight)
 {
-	if (U.flag & USER_CUSTOM_RANGE)
-	{
+	if (U.flag & USER_CUSTOM_RANGE) {
 		BKE_colorband_evaluate(&U.coba_weight, weight, result);
 	}
 	else {
@@ -964,18 +964,18 @@ static void DRW_evaluate_weight_to_color(float *result, float weight)
 		hsv_to_rgb_v(hsv, result);
 
 		for (int i = 0; i < 3; i++) {
-			result[i] = pow(result[i], 1.0f/gamma);
+			result[i] = pow(result[i], 1.0f / gamma);
 		}
 	}
 }
 
-static GPUTexture* DRW_create_weight_colorramp_texture(void)
+static GPUTexture *DRW_create_weight_colorramp_texture(void)
 {
 	char error[256];
 	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;
+		pixels[(i * 4) + 3] = 1.0f;
 	}
 
 	return GPU_texture_create_1D(256, GPU_RGBA8, pixels, error);
diff --git a/source/blender/editors/armature/armature_edit.c b/source/blender/editors/armature/armature_edit.c
index 1ca44f9e2a2..eff66880afa 100644
--- a/source/blender/editors/armature/armature_edit.c
+++ b/source/blender/editors/armature/armature_edit.c
@@ -1486,13 +1486,13 @@ static int armature_dissolve_selected_exec(bContext *C, wmOperator *UNUSED(op))
 		for (ebone = arm->edbo->first; ebone; ebone = ebone->next) {
 			/* break connections for unseen bones */
 			if (((arm->layer & ebone->layer) &&
-				 ((ED_armature_ebone_selectflag_get(ebone) & (BONE_TIPSEL | BONE_SELECTED)))) == 0)
+			     ((ED_armature_ebone_selectflag_get(ebone) & (BONE_TIPSEL | BONE_SELECTED)))) == 0)
 			{
 				ebone->temp.ebone = NULL;
 			}
 
 			if (((arm->layer & ebone->layer) &&
-				((ED_armature_ebone_selectflag_get(ebone) & (BONE_ROOTSEL | BONE_SELECTED)))) == 0)
+			     ((ED_armature_ebone_selectflag_get(ebone) & (BONE_ROOTSEL | BONE_SELECTED)))) == 0)
 			{
 				if (ebone->parent && (ebone->flag & BONE_CONNECTED)) {
 					ebone->parent->temp.ebone = NULL;
@@ -1504,7 +1504,7 @@ static int armature_dissolve_selected_exec(bContext *C, wmOperator *UNUSED(op))
 		for (ebone = arm->edbo->first; ebone; ebone = ebone->next) {
 
 			if (ebone->parent &&
-				(ebone->parent->temp.ebone == ebone))
+			    (ebone->parent->temp.ebone == ebone))
 			{
 				ebone->flag |= BONE_DONE;
 			}
@@ -1528,8 +1528,8 @@ static int armature_dissolve_selected_exec(bContext *C, wmOperator *UNUSED(op))
 		if (changed) {
 			for (ebone = arm->edbo->first; ebone; ebone = ebone->next) {
 				if (ebone->parent &&
-					ebone->parent->temp.ebone &&
-					(ebone->flag & BONE_CONNECTED))
+				    ebone->parent->temp.ebone &&
+				    (ebone->flag & BONE_CONNECTED))
 				{
 					ebone->rad_head = ebone->parent->rad_tail;
 				}
diff --git a/source/blender/editors/gpencil/annotate_paint.c b/source/blender/editors/gpencil/annotate_paint.c
index d6d2ce8585a..97834e6836c 100644
--- a/source/blender/editors/gpencil/annotate_paint.c
+++ b/source/blender/editors/gpencil/annotate_paint.c
@@ -1866,8 +1866,7 @@ static int gpencil_draw_invoke(bContext *C, wmOperator *op, const wmEvent *event
 	tGPsdata *p = NULL;
 
 	/* GPXX Need a better solution */
-	if (sa && sa->spacetype == SPACE_VIEW3D)
-	{
+	if (sa && sa->spacetype == SPACE_VIEW3D) {
 		if ((ob != NULL) && (ob->type == OB_GPENCIL)) {
 			BKE_report(op->reports, RPT_ERROR, "Cannot draw annotation with a Grease Pencil object active");
 			return OPERATOR_CANCELLED;
diff --git a/source/blender/editors/gpencil/gpencil_brush.c b/source/blender/editors/gpencil/gpencil_brush.c
index 1e64a41e914..20c3449c208 100644
--- a/source/blender/editors/gpencil/gpencil_brush.c
+++ b/source/blender/editors/gpencil/gpencil_brush.c
@@ -1230,9 +1230,7 @@ static bool gpsculpt_brush_init(bContext *C, wmOperator *op)
 	gso->cfra = INT_MAX; /* NOTE: So that first stroke will get handled in init_stroke() */
 
 	/* some brushes cannot use pressure for radius */
-	if ((gso->brush_type == GP_EDITBRUSH_TYPE_GRAB) ||
-		(gso->brush_type == GP_EDITBRUSH_TYPE_CLONE))
-	{
+	if (ELEM(gso->brush_type, GP_EDITBRUSH_TYPE_GRAB, GP_EDITBRUSH_TYPE_CLONE)) {
 		gso->brush->flag &= ~GP_EDITBRUSH_FLAG_PRESSURE_RADIUS;
 	}
 
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index c08384c3ef0..1891687b28b 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -2163,7 +2163,8 @@ static void ui_but_paste_numeric_value(bContext *C, uiBut *but, uiHandleButtonDa
 		data->value = value;
 		ui_but_string_set(C, but, buf_paste);
 		button_activate_state(C, but, BUTTON_STATE_EXIT);
-	} else {
+	}
+	else {
 		WM_report(RPT_ERROR, "Expected a number");
 	}
 }
@@ -2313,54 +2314,53 @@ static void ui_but_copy(bContext *C, uiBut *but, const bool copy_array)
 
 	bool has_required_data = !(but->poin == NULL && but->rnapoin.data == NULL);
 
-	switch (but->type)
-	{
-	case UI_BTYPE_NUM:
-	case UI_BTYPE_NUM_SLIDER:
-		if (!has_required_data) break;
-		if (copy_array && ui_but_has_array_value(but)) {
-			ui_but_copy_numeric_array(but, buffer_to_copy, max_copy_length);
-		}
-		else {
-			ui_but_copy_numeric_value(but, buffer_to_copy, max_copy_length);
-		}
-		break;
+	switch (but->type) {
+		case UI_BTYPE_NUM:
+		case UI_BTYPE_NUM_SLIDER:
+			if (!has_required_data) break;
+			if (copy_array && ui_but_has_array_value(but)) {
+				ui_but_copy_numeric_array(but, buffer_to_copy, max_copy_length);
+			}
+			else {
+				ui_but_copy_numeric_value(but, buffer_to_copy, max_copy_length);
+			}
+			break;
 
-	case UI_BTYPE_UNITVEC:
-		if (!has_required_data) break;
-		ui_but_copy_numeric_array(but, buffer_to_copy, max_copy_length);
-		break;
+		case UI_BTYPE_UNITVEC:
+			if (!has_required_data) break;
+			ui_but_copy_numeric_array(but, buffer_to_copy, max_copy_length);
+			break;
 
-	case UI_BTYPE_COLOR:
-		if (!has_required_data) break;
-		ui_but_copy_color(but, buffer_to_copy, max_copy_length);
-		break;
+		case UI_BTYPE_COLOR:
+			if (!has_required_data) break;
+			ui_but_copy_color(but, buffer_to_copy, max_copy_length);
+			break;
 
-	case UI_BTYPE_TEXT:
-	case UI_BTYPE_SEARCH_MENU:
-		if (!has_required_data) break;
-		ui_but_copy_text(but, buffer_to_copy, max_copy_length);
-		break;
+		case UI_BTYPE_TEXT:
+		case UI_BTYPE_SEARCH_MENU:
+			if (!has_required_data) break;
+			ui_but_copy_text(but, buffer_to_copy, max_copy_length);
+			break;
 
-	case UI_BTYPE_COLORBAND:
-		ui_but_copy_colorband(but);
-		break;
+		case UI_BTYPE_COLORBAND:
+			ui_but_copy_colorband(but);
+			break;
 
-	case UI_BTYPE_CURVE:
-		ui_but_copy_curvemapping(but);
-		break;
+		case UI_BTYPE_CURVE:
+			ui_but_copy_curvemapping(but);
+			break;
 
-	case UI_BTYPE_BUT:
-		ui_but_copy_operator(C, but, buffer_to_copy, max_copy_length);
-		break;
+		case UI_BTYPE_BUT:
+			ui_but_copy_operator(C, but, buffer_to_copy, max_copy_length);


@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list