[Bf-blender-cvs] [c29c4269253] master: Cleanup: use braces w/ particle loop macros

Campbell Barton noreply at git.blender.org
Tue Aug 14 02:10:58 CEST 2018


Commit: c29c426925311eeb79e3988609e914e72b61013b
Author: Campbell Barton
Date:   Tue Aug 14 10:14:05 2018 +1000
Branches: master
https://developer.blender.org/rBc29c426925311eeb79e3988609e914e72b61013b

Cleanup: use braces w/ particle loop macros

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

M	source/blender/blenkernel/intern/particle_system.c
M	source/blender/editors/physics/particle_edit.c

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

diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index fd63285ea85..353c75d63c6 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -169,8 +169,9 @@ void psys_reset(ParticleSystem *psys, int mode)
 	}
 	else if (mode == PSYS_RESET_CACHE_MISS) {
 		/* set all particles to be skipped */
-		LOOP_PARTICLES
+		LOOP_PARTICLES {
 			pa->flag |= PARS_NO_DISP;
+		}
 	}
 
 	/* reset children */
@@ -273,8 +274,9 @@ static void realloc_particles(ParticleSimulationData *sim, int new_totpart)
 		psys->totpart=totpart;
 
 		if (newboids) {
-			LOOP_PARTICLES
+			LOOP_PARTICLES {
 				pa->boid = newboids++;
+			}
 		}
 	}
 
@@ -4129,14 +4131,16 @@ void psys_check_boid_data(ParticleSystem *psys)
 			if (!pa->boid) {
 				bpa = MEM_callocN(psys->totpart * sizeof(BoidParticle), "Boid Data");
 
-				LOOP_PARTICLES
+				LOOP_PARTICLES {
 					pa->boid = bpa++;
+				}
 			}
 		}
 		else if (pa->boid) {
 			MEM_freeN(pa->boid);
-			LOOP_PARTICLES
+			LOOP_PARTICLES {
 				pa->boid = NULL;
+			}
 		}
 }
 
diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c
index 5699c1f59f8..ad4c377879d 100644
--- a/source/blender/editors/physics/particle_edit.c
+++ b/source/blender/editors/physics/particle_edit.c
@@ -1141,25 +1141,29 @@ static void PE_update_selection(Main *bmain, Scene *scene, Object *ob, int usefl
 
 	/* flag all particles to be updated if not using flag */
 	if (!useflag)
-		LOOP_POINTS
-		point->flag |= PEP_EDIT_RECALC;
+		LOOP_POINTS {
+			point->flag |= PEP_EDIT_RECALC;
+		}
 
 	/* flush edit key flag to hair key flag to preserve selection
 	 * on save */
-	if (edit->psys) LOOP_POINTS {
+	if (edit->psys) {
+		LOOP_POINTS {
 			hkey = edit->psys->particles[p].hair;
 			LOOP_KEYS {
 				hkey->editflag = key->flag;
 				hkey++;
 			}
 		}
+	}
 
-		psys_cache_edit_paths(scene, ob, edit, CFRA, G.is_rendering);
+	psys_cache_edit_paths(scene, ob, edit, CFRA, G.is_rendering);
 
 
 	/* disable update flag */
-	LOOP_POINTS
-	point->flag &= ~PEP_EDIT_RECALC;
+	LOOP_POINTS {
+		point->flag &= ~PEP_EDIT_RECALC;
+	}
 }
 
 void update_world_cos(Object *ob, PTCacheEdit *edit)
@@ -1894,8 +1898,9 @@ static int hide_exec(bContext *C, wmOperator *op)
 			point->flag |= PEP_HIDE;
 			point->flag |= PEP_EDIT_RECALC;
 
-			LOOP_KEYS
-			key->flag &= ~PEK_SELECT;
+			LOOP_KEYS {
+				key->flag &= ~PEK_SELECT;
+			}
 		}
 	}
 	else {
@@ -1903,8 +1908,9 @@ static int hide_exec(bContext *C, wmOperator *op)
 			point->flag |= PEP_HIDE;
 			point->flag |= PEP_EDIT_RECALC;
 
-			LOOP_KEYS
-			key->flag &= ~PEK_SELECT;
+			LOOP_KEYS {
+				key->flag &= ~PEK_SELECT;
+			}
 		}
 	}



More information about the Bf-blender-cvs mailing list