[Bf-blender-cvs] [121e273] master: Cleanup: reduce scope for versioning vars

Campbell Barton noreply at git.blender.org
Tue Mar 22 07:24:47 CET 2016


Commit: 121e273bb3c9fedc8bf7ccbb7891f8c709f4c9b5
Author: Campbell Barton
Date:   Tue Mar 22 17:18:35 2016 +1100
Branches: master
https://developer.blender.org/rB121e273bb3c9fedc8bf7ccbb7891f8c709f4c9b5

Cleanup: reduce scope for versioning vars

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

M	source/blender/blenloader/intern/versioning_defaults.c

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

diff --git a/source/blender/blenloader/intern/versioning_defaults.c b/source/blender/blenloader/intern/versioning_defaults.c
index 5b30aed..e9d93a1 100644
--- a/source/blender/blenloader/intern/versioning_defaults.c
+++ b/source/blender/blenloader/intern/versioning_defaults.c
@@ -75,17 +75,11 @@ void BLO_update_defaults_userpref_blend(void)
  * This function can be emptied each time the startup.blend is updated. */
 void BLO_update_defaults_startup_blend(Main *bmain)
 {
-	Scene *scene;
-	SceneRenderLayer *srl;
-	FreestyleLineStyle *linestyle;
-	Mesh *me;
-	Material *mat;
-
-	for (scene = bmain->scene.first; scene; scene = scene->id.next) {
+	for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
 		scene->r.im_format.planes = R_IMF_PLANES_RGBA;
 		scene->r.im_format.compress = 15;
 
-		for (srl = scene->r.layers.first; srl; srl = srl->next) {
+		for (SceneRenderLayer *srl = scene->r.layers.first; srl; srl = srl->next) {
 			srl->freestyleConfig.sphere_radius = 0.1f;
 			srl->pass_alpha_threshold = 0.5f;
 		}
@@ -158,7 +152,7 @@ void BLO_update_defaults_startup_blend(Main *bmain)
 		scene->r.ffcodecdata.audio_mixrate = 48000;
 	}
 
-	for (linestyle = bmain->linestyle.first; linestyle; linestyle = linestyle->id.next) {
+	for (FreestyleLineStyle *linestyle = bmain->linestyle.first; linestyle; linestyle = linestyle->id.next) {
 		linestyle->flag = LS_SAME_OBJECT | LS_NO_SORTING | LS_TEXTURE;
 		linestyle->sort_key = LS_SORT_KEY_DISTANCE_FROM_CAMERA;
 		linestyle->integration_type = LS_INTEGRATION_MEAN;
@@ -166,42 +160,38 @@ void BLO_update_defaults_startup_blend(Main *bmain)
 		linestyle->chain_count = 10;
 	}
 
-	{
-		bScreen *screen;
-
-		for (screen = bmain->screen.first; screen; screen = screen->id.next) {
-			ScrArea *area;
-			for (area = screen->areabase.first; area; area = area->next) {
-				SpaceLink *space_link;
-				ARegion *ar;
-
-				for (space_link = area->spacedata.first; space_link; space_link = space_link->next) {
-					if (space_link->spacetype == SPACE_CLIP) {
-						SpaceClip *space_clip = (SpaceClip *) space_link;
-						space_clip->flag &= ~SC_MANUAL_CALIBRATION;
-					}
+	for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) {
+		ScrArea *area;
+		for (area = screen->areabase.first; area; area = area->next) {
+			SpaceLink *space_link;
+			ARegion *ar;
+
+			for (space_link = area->spacedata.first; space_link; space_link = space_link->next) {
+				if (space_link->spacetype == SPACE_CLIP) {
+					SpaceClip *space_clip = (SpaceClip *) space_link;
+					space_clip->flag &= ~SC_MANUAL_CALIBRATION;
 				}
+			}
 
-				for (ar = area->regionbase.first; ar; ar = ar->next) {
-					/* Remove all stored panels, we want to use defaults (order, open/closed) as defined by UI code here! */
-					BLI_freelistN(&ar->panels);
+			for (ar = area->regionbase.first; ar; ar = ar->next) {
+				/* Remove all stored panels, we want to use defaults (order, open/closed) as defined by UI code here! */
+				BLI_freelistN(&ar->panels);
 
-					/* some toolbars have been saved as initialized,
-					 * we don't want them to have odd zoom-level or scrolling set, see: T47047 */
-					if (ELEM(ar->regiontype, RGN_TYPE_UI, RGN_TYPE_TOOLS, RGN_TYPE_TOOL_PROPS)) {
-						ar->v2d.flag &= ~V2D_IS_INITIALISED;
-					}
+				/* some toolbars have been saved as initialized,
+				 * we don't want them to have odd zoom-level or scrolling set, see: T47047 */
+				if (ELEM(ar->regiontype, RGN_TYPE_UI, RGN_TYPE_TOOLS, RGN_TYPE_TOOL_PROPS)) {
+					ar->v2d.flag &= ~V2D_IS_INITIALISED;
 				}
 			}
 		}
 	}
 
-	for (me = bmain->mesh.first; me; me = me->id.next) {
+	for (Mesh *me = bmain->mesh.first; me; me = me->id.next) {
 		me->smoothresh = DEG2RADF(180.0f);
 		me->flag &= ~ME_TWOSIDED;
 	}
 
-	for (mat = bmain->mat.first; mat; mat = mat->id.next) {
+	for (Material *mat = bmain->mat.first; mat; mat = mat->id.next) {
 		mat->line_col[0] = mat->line_col[1] = mat->line_col[2] = 0.0f;
 		mat->line_col[3] = 1.0f;
 	}




More information about the Bf-blender-cvs mailing list