[Bf-blender-cvs] [4cbf2ebd] master: Cleanup: style

Campbell Barton noreply at git.blender.org
Fri Feb 6 03:55:44 CET 2015


Commit: 4cbf2ebdc924db94681bb154e58385f32d1ba9a3
Author: Campbell Barton
Date:   Fri Feb 6 13:54:38 2015 +1100
Branches: master
https://developer.blender.org/rB4cbf2ebdc924db94681bb154e58385f32d1ba9a3

Cleanup: style

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

M	source/blender/blenfont/intern/blf_lang.c
M	source/blender/blenloader/intern/versioning_250.c
M	source/blender/compositor/operations/COM_PlaneDistortCommonOperation.cpp
M	source/blender/editors/sculpt_paint/paint_image_proj.c
M	source/blender/editors/sculpt_paint/sculpt.c
M	source/blender/editors/space_view3d/view3d_draw.c
M	source/blender/gpu/intern/gpu_material.c
M	source/blender/modifiers/intern/MOD_normal_edit.c
M	source/blender/windowmanager/intern/wm_event_system.c

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

diff --git a/source/blender/blenfont/intern/blf_lang.c b/source/blender/blenfont/intern/blf_lang.c
index 7206d71..99e1aa5 100644
--- a/source/blender/blenfont/intern/blf_lang.c
+++ b/source/blender/blenfont/intern/blf_lang.c
@@ -209,7 +209,7 @@ void BLF_lang_init(void)
 	 * Would also be good to find nicer way to check if LANG is correct.
 	 */
 	const char *lang = getenv("LANG");
-	if(lang != NULL) {
+	if (lang != NULL) {
 		char *old_locale = setlocale(LC_ALL, NULL);
 		/* Make a copy so subsequenct setlocale() doesn't interfere. */
 		old_locale = BLI_strdup(old_locale);
diff --git a/source/blender/blenloader/intern/versioning_250.c b/source/blender/blenloader/intern/versioning_250.c
index b71a402..4125451 100644
--- a/source/blender/blenloader/intern/versioning_250.c
+++ b/source/blender/blenloader/intern/versioning_250.c
@@ -323,7 +323,7 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb)
 					SpaceNla *snla = (SpaceNla *)sl;
 					memcpy(&ar->v2d, &snla->v2d, sizeof(View2D));
 
-					ar->v2d.tot.ymin = (float)(-sa->winy)/3.0f;
+					ar->v2d.tot.ymin = (float)(-sa->winy) / 3.0f;
 					ar->v2d.tot.ymax = 0.0f;
 
 					ar->v2d.scroll |= (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_HORIZONTAL);
@@ -338,8 +338,8 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb)
 
 					/* we totally reinit the view for the Action Editor, as some old instances had some weird cruft set */
 					ar->v2d.tot.xmin = -20.0f;
-					ar->v2d.tot.ymin = (float)(-sa->winy)/3.0f;
-					ar->v2d.tot.xmax = (float)((sa->winx > 120)? (sa->winx) : 120);
+					ar->v2d.tot.ymin = (float)(-sa->winy) / 3.0f;
+					ar->v2d.tot.xmax = (float)((sa->winx > 120) ? (sa->winx) : 120);
 					ar->v2d.tot.ymax = 0.0f;
 
 					ar->v2d.cur = ar->v2d.tot;
diff --git a/source/blender/compositor/operations/COM_PlaneDistortCommonOperation.cpp b/source/blender/compositor/operations/COM_PlaneDistortCommonOperation.cpp
index e3095f7..8133f39 100644
--- a/source/blender/compositor/operations/COM_PlaneDistortCommonOperation.cpp
+++ b/source/blender/compositor/operations/COM_PlaneDistortCommonOperation.cpp
@@ -229,7 +229,7 @@ void PlaneDistortMaskOperation::executePixelSampled(float output[4], float x, fl
 				                              sample_data->frameSpaceCorners[2]) ||
 				    isect_point_tri_v2(point, sample_data->frameSpaceCorners[0],
 				                              sample_data->frameSpaceCorners[2],
-			                                  sample_data->frameSpaceCorners[3]))
+				                              sample_data->frameSpaceCorners[3]))
 				{
 					inside_counter++;
 				}
diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c
index 1216983..ff82688 100644
--- a/source/blender/editors/sculpt_paint/paint_image_proj.c
+++ b/source/blender/editors/sculpt_paint/paint_image_proj.c
@@ -3279,7 +3279,7 @@ static void proj_paint_state_vert_flags_init(ProjPaintState *ps)
 #ifndef PROJ_DEBUG_NOSEAMBLEED
 static void project_paint_bleed_add_face_user(
         const ProjPaintState *ps, MemArena *arena,
-		const MFace *mf, const int face_index)
+        const MFace *mf, const int face_index)
 {
 	/* add face user if we have bleed enabled, set the UV seam flags later */
 	/* annoying but we need to add all faces even ones we never use elsewhere */
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 122acf3..69428c0 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -4248,14 +4248,14 @@ static void sculpt_stroke_update_step(bContext *C, struct PaintStroke *UNUSED(st
 	sculpt_restore_mesh(sd, ob);
 
 	if (sd->flags & SCULPT_DYNTOPO_DETAIL_CONSTANT) {
-		BKE_pbvh_bmesh_detail_size_set(ss->pbvh,
-			sd->constant_detail / 100.0f);
+		BKE_pbvh_bmesh_detail_size_set(ss->pbvh, sd->constant_detail / 100.0f);
 	}
 	else {
-		BKE_pbvh_bmesh_detail_size_set(ss->pbvh,
-		                               (ss->cache->radius /
-		                                (float)ups->pixel_radius) *
-		                               (float)(sd->detail_size * U.pixelsize)/ 0.4f);
+		BKE_pbvh_bmesh_detail_size_set(
+		        ss->pbvh,
+		        (ss->cache->radius /
+		        (float)ups->pixel_radius) *
+		        (float)(sd->detail_size * U.pixelsize) / 0.4f);
 	}
 
 	if (sculpt_stroke_dynamic_topology(ss, brush)) {
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index ac1c075..929929c 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -1829,15 +1829,15 @@ static void view3d_draw_bgpic(Scene *scene, ARegion *ar, View3D *v3d,
 			ED_region_pixelspace(ar);
 
 			glTranslatef(centx, centy, 0.0);
-			if(rv3d->persp != RV3D_CAMOB) {
+			if (rv3d->persp != RV3D_CAMOB) {
 				glRotatef(RAD2DEGF(-bgpic->rotation), 0.0f, 0.0f, 1.0f);
 			}
 
-			if(bgpic->flag & V3D_BGPIC_FLIP_X) {
+			if (bgpic->flag & V3D_BGPIC_FLIP_X) {
 				zoomx *= -1.0f;
 				x1 = x2;
 			}
-			if(bgpic->flag & V3D_BGPIC_FLIP_Y) {
+			if (bgpic->flag & V3D_BGPIC_FLIP_Y) {
 				zoomy *= -1.0f;
 				y1 = y2;
 			}
diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c
index 53e20ec..41049e8 100644
--- a/source/blender/gpu/intern/gpu_material.c
+++ b/source/blender/gpu/intern/gpu_material.c
@@ -1768,10 +1768,10 @@ static void gpu_lamp_calc_winmat(GPULamp *lamp)
 		orthographic_m4(lamp->winmat, -wsize, wsize, -wsize, wsize, lamp->d, lamp->clipend);
 	}
 	else {
-		angle= saacos(lamp->spotsi);
-		temp= 0.5f*lamp->size*cosf(angle)/sinf(angle);
-		pixsize= (lamp->d)/temp;
-		wsize= pixsize*0.5f*lamp->size;
+		angle = saacos(lamp->spotsi);
+		temp = 0.5f * lamp->size * cosf(angle) / sinf(angle);
+		pixsize = lamp->d / temp;
+		wsize = pixsize * 0.5f * lamp->size;
 		perspective_m4(lamp->winmat, -wsize, wsize, -wsize, wsize, lamp->d, lamp->clipend);
 	}
 }
diff --git a/source/blender/modifiers/intern/MOD_normal_edit.c b/source/blender/modifiers/intern/MOD_normal_edit.c
index 39881f4..3bf6051 100644
--- a/source/blender/modifiers/intern/MOD_normal_edit.c
+++ b/source/blender/modifiers/intern/MOD_normal_edit.c
@@ -164,14 +164,19 @@ static void normalEditModifier_do_radial(
 
 	generate_vert_coordinates(dm, ob, smd->target, smd->offset, num_verts, cos, size);
 
-	/* size gives us our spheroid coefficients (A, B, C).
+	/**
+	 * size gives us our spheroid coefficients ``(A, B, C)``.
 	 * Then, we want to find out for each vert its (a, b, c) triple (proportional to (A, B, C) one).
 	 *
-	 * Ellipsoid basic equation: (x^2/a^2) + (y^2/b^2) + (z^2/c^2) = 1.
+	 * Ellipsoid basic equation: ``(x^2/a^2) + (y^2/b^2) + (z^2/c^2) = 1.``
 	 * Since we want to find (a, b, c) matching this equation and proportional to (A, B, C), we can do:
+	 * <pre>
 	 *     m = B / A
 	 *     n = C / A
+	 * </pre>
+	 *
 	 * hence:
+	 * <pre>
 	 *     (x^2/a^2) + (y^2/b^2) + (z^2/c^2) = 1
 	 *  -> b^2*c^2*x^2 + a^2*c^2*y^2 + a^2*b^2*z^2 = a^2*b^2*c^2
 	 *     b = ma
@@ -181,9 +186,12 @@ static void normalEditModifier_do_radial(
 	 *  -> a^2 = (m^2*n^2*x^2 + n^2y^2 + m^2z^2) / (m^2*n^2) = x^2 + (y^2 / m^2) + (z^2 / n^2)
 	 *  -> b^2 = (m^2*n^2*x^2 + n^2y^2 + m^2z^2) / (n^2)     = (m^2 * x^2) + y^2 + (m^2 * z^2 / n^2)
 	 *  -> c^2 = (m^2*n^2*x^2 + n^2y^2 + m^2z^2) / (m^2)     = (n^2 * x^2) + (n^2 * y^2 / m^2) + z^2
+	 * </pre>
 	 *
 	 * All we have to do now is compute normal of the spheroid at that point:
+	 * <pre>
 	 *     n = (x / a^2, y / b^2, z / c^2)
+	 * </pre>
 	 * And we are done!
 	 */
 	{
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index 62f46cc..4b8af99 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -729,7 +729,7 @@ static int wm_operator_exec(bContext *C, wmOperator *op, const bool repeat, cons
 	/* XXX Disabled the repeat check to address part 2 of #31840.
 	 *     Carefully checked all calls to wm_operator_exec and WM_operator_repeat, don't see any reason
 	 *     why this was needed, but worth to note it in case something turns bad. (mont29) */
-	if (retval & (OPERATOR_FINISHED | OPERATOR_CANCELLED)/* && repeat == 0 */)
+	if (retval & (OPERATOR_FINISHED | OPERATOR_CANCELLED) /* && repeat == 0 */)
 		wm_operator_reports(C, op, retval, false);
 	
 	if (retval & OPERATOR_FINISHED) {




More information about the Bf-blender-cvs mailing list