Cleanup: style

This commit is contained in:
Campbell Barton
2018-08-26 20:34:33 +10:00
parent 03fd1da3ee
commit 3ee0ce27fa
13 changed files with 35 additions and 29 deletions

View File

@@ -701,9 +701,9 @@ static void rigidbody_validate_sim_object(RigidBodyWorld *rbw, Object *ob, bool
/* --------------------- */
static void rigidbody_constraint_init_spring(
RigidBodyCon *rbc, void (*set_spring)(rbConstraint*,int,int),
void (*set_stiffness)(rbConstraint*,int,float), void (*set_damping)(rbConstraint*,int,float)
) {
RigidBodyCon *rbc, void (*set_spring)(rbConstraint *, int, int),
void (*set_stiffness)(rbConstraint *, int, float), void (*set_damping)(rbConstraint *, int, float))
{
set_spring(rbc->physics_constraint, RB_LIMIT_LIN_X, rbc->flag & RBC_FLAG_USE_SPRING_X);
set_stiffness(rbc->physics_constraint, RB_LIMIT_LIN_X, rbc->spring_stiffness_x);
set_damping(rbc->physics_constraint, RB_LIMIT_LIN_X, rbc->spring_damping_x);
@@ -729,7 +729,7 @@ static void rigidbody_constraint_init_spring(
set_damping(rbc->physics_constraint, RB_LIMIT_ANG_Z, rbc->spring_damping_ang_z);
}
static void rigidbody_constraint_set_limits(RigidBodyCon *rbc, void (*set_limits)(rbConstraint*,int,float,float))
static void rigidbody_constraint_set_limits(RigidBodyCon *rbc, void (*set_limits)(rbConstraint *, int, float, float))
{
if (rbc->flag & RBC_FLAG_USE_LIMIT_LIN_X)
set_limits(rbc->physics_constraint, RB_LIMIT_LIN_X, rbc->limit_lin_x_lower, rbc->limit_lin_x_upper);

View File

@@ -1772,8 +1772,9 @@ static float check_zone(WipeZone *wipezone, int x, int y, Sequence *seq, float f
/* BOX WIPE IS NOT WORKING YET */
#if 0
case DO_BOX_WIPE:
if (!wipe->forward)
facf0 = 1.0f - facf0; /* Go the other direction */
if (!wipe->forward) {
facf0 = 1.0f - facf0; /* Go the other direction */
}
width = (int)(wipe->edgeWidth * ((xo + yo) / 2.0));
hwidth = (float)width / 2.0;
@@ -1806,8 +1807,9 @@ static float check_zone(WipeZone *wipezone, int x, int y, Sequence *seq, float f
output = in_band(hwidth, hyp2, 1, 1) * in_band(hwidth, hyp, 1, 1);
}
if (!wipe->forward)
facf0 = 1.0f - facf0; /* Go the other direction */
if (!wipe->forward) {
facf0 = 1.0f - facf0; /* Go the other direction */
}
angle = -1 / angle;
b1 = posy / 2 - (-angle) * posx / 2;
b3 = (yo - posy / 2) - (-angle) * (xo - posx / 2);

View File

@@ -22,7 +22,7 @@
CryptomatteOperation::CryptomatteOperation(size_t num_inputs) : NodeOperation()
{
for(size_t i = 0; i < num_inputs; i++) {
for (size_t i = 0; i < num_inputs; i++) {
this->addInputSocket(COM_DT_COLOR);
}
inputs.resize(num_inputs);

View File

@@ -68,7 +68,9 @@ struct CyclesSolverState {
: graph(graph),
traversal_stack(BLI_stack_new(sizeof(StackEntry),
"DEG detect cycles stack")),
num_cycles(0) {
num_cycles(0)
{
/* pass */
}
~CyclesSolverState() {
BLI_stack_free(traversal_stack);

View File

@@ -54,7 +54,8 @@ void BuilderMap::tagBuild(ID *id) {
BLI_gset_insert(set, id);
}
bool BuilderMap::checkIsBuiltAndTag(ID *id) {
bool BuilderMap::checkIsBuiltAndTag(ID *id)
{
void **key_p;
if (!BLI_gset_ensure_p_ex(set, id, &key_p)) {
*key_p = id;

View File

@@ -264,7 +264,8 @@ OperationDepsNode *DepsgraphNodeBuilder::find_operation_node(
void DepsgraphNodeBuilder::begin_build() {
}
void DepsgraphNodeBuilder::build_id(ID* id) {
void DepsgraphNodeBuilder::build_id(ID *id)
{
if (id == NULL) {
return;
}

View File

@@ -126,7 +126,7 @@ struct DepsgraphNodeBuilder {
const char *name = "",
int name_tag = -1);
void build_id(ID* id);
void build_id(ID *id);
void build_scene(Scene *scene);
void build_group(Base *base, Group *group);
void build_object(Base *base, Object *object);

View File

@@ -287,7 +287,7 @@ void DEG_scene_relations_update(Main *bmain, Scene *scene)
BLI_gset_clear(graph->entry_tags, NULL);
/* Build new nodes and relations. */
DEG_graph_build_from_scene(reinterpret_cast< ::Depsgraph * >(graph),
DEG_graph_build_from_scene(reinterpret_cast< ::Depsgraph *>(graph),
bmain,
scene);
@@ -349,7 +349,7 @@ void DEG_add_forcefield_relations(DepsNodeHandle *handle,
if (effectors == NULL) {
return;
}
for (EffectorCache *eff = (EffectorCache*)effectors->first; eff; eff = eff->next) {
for (EffectorCache *eff = (EffectorCache *)effectors->first; eff; eff = eff->next) {
if (eff->ob != object && eff->pd->forcefield != skip_forcefield) {
DEG_add_object_relation(handle, eff->ob, DEG_OB_COMP_TRANSFORM, name);
if (eff->psys) {

View File

@@ -221,7 +221,7 @@ static opj_stream_t *opj_stream_create_from_buffer(
if (l_stream == NULL) {
return NULL;
}
opj_stream_set_user_data(l_stream, p_file , opj_read_from_buffer_free);
opj_stream_set_user_data(l_stream, p_file, opj_read_from_buffer_free);
opj_stream_set_user_data_length(l_stream, p_file->len);
opj_stream_set_read_function(l_stream, opj_read_from_buffer);
#if 0 /* UNUSED */

View File

@@ -7049,7 +7049,7 @@ static void def_cmp_cryptomatte(StructRNA *srna)
RNA_def_struct_sdna_from(srna, "NodeCryptomatte", "storage");
prop = RNA_def_property(srna, "matte_id", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, "rna_NodeCryptomatte_matte_get", "rna_NodeCryptomatte_matte_length",
"rna_NodeCryptomatte_matte_set");
"rna_NodeCryptomatte_matte_set");
RNA_def_property_ui_text(prop, "Matte Objects", "List of object and material crypto IDs to include in matte");
RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");

View File

@@ -125,7 +125,7 @@ static void updateDepgraph(ModifierData *md, const ModifierUpdateDepsgraphContex
if (clmd) {
/* Actual code uses get_collisionobjects */
#ifdef WITH_LEGACY_DEPSGRAPH
dag_add_collision_relations(ctx->forest, ctx->scene, ctx->object, ctx->obNode, clmd->coll_parms->group, ctx->object->lay|ctx->scene->lay, eModifierType_Collision, NULL, true, "Cloth Collision");
dag_add_collision_relations(ctx->forest, ctx->scene, ctx->object, ctx->obNode, clmd->coll_parms->group, ctx->object->lay | ctx->scene->lay, eModifierType_Collision, NULL, true, "Cloth Collision");
dag_add_forcefield_relations(ctx->forest, ctx->scene, ctx->object, ctx->obNode, clmd->sim_parms->effector_weights, true, 0, "Cloth Field");
#else
(void)ctx;
@@ -138,7 +138,7 @@ static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphConte
ClothModifierData *clmd = (ClothModifierData *)md;
if (clmd != NULL) {
/* Actual code uses get_collisionobjects */
DEG_add_collision_relations(ctx->node, ctx->scene, ctx->object, clmd->coll_parms->group, ctx->object->lay|ctx->scene->lay, eModifierType_Collision, NULL, true, "Cloth Collision");
DEG_add_collision_relations(ctx->node, ctx->scene, ctx->object, clmd->coll_parms->group, ctx->object->lay | ctx->scene->lay, eModifierType_Collision, NULL, true, "Cloth Collision");
DEG_add_forcefield_relations(ctx->node, ctx->scene, ctx->object, clmd->sim_parms->effector_weights, true, 0, "Cloth Field");
}

View File

@@ -163,7 +163,7 @@ static bool particle_skip(ParticleInstanceModifierData *pimd, ParticleSystem *ps
if (p >= psys->totpart) {
ChildParticle *cpa = psys->child + (p - psys->totpart);
pa = psys->particles + (between? cpa->pa[0]: cpa->parent);
pa = psys->particles + (between ? cpa->pa[0] : cpa->parent);
}
else {
pa = psys->particles + p;
@@ -187,8 +187,8 @@ static bool particle_skip(ParticleInstanceModifierData *pimd, ParticleSystem *ps
/* TODO make randomization optional? */
randp = (int)(psys_frand(psys, 3578 + p) * totpart) % totpart;
minp = (int)(totpart * pimd->particle_offset) % (totpart+1);
maxp = (int)(totpart * (pimd->particle_offset + pimd->particle_amount)) % (totpart+1);
minp = (int)(totpart * pimd->particle_offset) % (totpart + 1);
maxp = (int)(totpart * (pimd->particle_offset + pimd->particle_amount)) % (totpart + 1);
if (maxp > minp) {
return randp < minp || randp >= maxp;
@@ -354,7 +354,7 @@ static DerivedMesh *applyModifier(
for (p = part_start, p_skip = 0; p < part_end; p++) {
float prev_dir[3];
float frame[4]; /* frame orientation quaternion */
float p_random = psys_frand(psys, 77091 + 283*p);
float p_random = psys_frand(psys, 77091 + 283 * p);
/* skip particle? */
if (particle_skip(pimd, psys, p))
@@ -418,7 +418,7 @@ static DerivedMesh *applyModifier(
pa = psys->particles + p;
else {
ChildParticle *cpa = psys->child + (p - psys->totpart);
pa = psys->particles + (between? cpa->pa[0]: cpa->parent);
pa = psys->particles + (between ? cpa->pa[0] : cpa->parent);
}
psys_mat_hair_to_global(sim.ob, sim.psmd->dm_final, sim.psys->part->from, pa, hairmat);
copy_m3_m4(mat, hairmat);
@@ -426,7 +426,7 @@ static DerivedMesh *applyModifier(
mat3_to_quat(frame, mat);
if (pimd->rotation > 0.0f || pimd->random_rotation > 0.0f) {
float angle = 2.0f*M_PI * (pimd->rotation + pimd->random_rotation * (psys_frand(psys, 19957323 + p) - 0.5f));
float angle = 2.0f * M_PI * (pimd->rotation + pimd->random_rotation * (psys_frand(psys, 19957323 + p) - 0.5f));
float eul[3] = { 0.0f, 0.0f, angle };
float rot[4];

View File

@@ -138,8 +138,8 @@ static void updateDepgraph(ModifierData *md, const ModifierUpdateDepsgraphContex
if (smd && (smd->type & MOD_SMOKE_TYPE_DOMAIN) && smd->domain) {
/* Actual code uses get_collisionobjects */
#ifdef WITH_LEGACY_DEPSGRAPH
dag_add_collision_relations(ctx->forest, ctx->scene, ctx->object, ctx->obNode, smd->domain->fluid_group, ctx->object->lay|ctx->scene->lay, eModifierType_Smoke, is_flow_cb, true, "Smoke Flow");
dag_add_collision_relations(ctx->forest, ctx->scene, ctx->object, ctx->obNode, smd->domain->coll_group, ctx->object->lay|ctx->scene->lay, eModifierType_Smoke, is_coll_cb, true, "Smoke Coll");
dag_add_collision_relations(ctx->forest, ctx->scene, ctx->object, ctx->obNode, smd->domain->fluid_group, ctx->object->lay | ctx->scene->lay, eModifierType_Smoke, is_flow_cb, true, "Smoke Flow");
dag_add_collision_relations(ctx->forest, ctx->scene, ctx->object, ctx->obNode, smd->domain->coll_group, ctx->object->lay | ctx->scene->lay, eModifierType_Smoke, is_coll_cb, true, "Smoke Coll");
dag_add_forcefield_relations(ctx->forest, ctx->scene, ctx->object, ctx->obNode, smd->domain->effector_weights, true, PFIELD_SMOKEFLOW, "Smoke Force Field");
#else
(void)ctx;
@@ -153,8 +153,8 @@ static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphConte
if (smd && (smd->type & MOD_SMOKE_TYPE_DOMAIN) && smd->domain) {
/* Actual code uses get_collisionobjects */
DEG_add_collision_relations(ctx->node, ctx->scene, ctx->object, smd->domain->fluid_group, ctx->object->lay|ctx->scene->lay, eModifierType_Smoke, is_flow_cb, true, "Smoke Flow");
DEG_add_collision_relations(ctx->node, ctx->scene, ctx->object, smd->domain->coll_group, ctx->object->lay|ctx->scene->lay, eModifierType_Smoke, is_coll_cb, true, "Smoke Coll");
DEG_add_collision_relations(ctx->node, ctx->scene, ctx->object, smd->domain->fluid_group, ctx->object->lay | ctx->scene->lay, eModifierType_Smoke, is_flow_cb, true, "Smoke Flow");
DEG_add_collision_relations(ctx->node, ctx->scene, ctx->object, smd->domain->coll_group, ctx->object->lay | ctx->scene->lay, eModifierType_Smoke, is_coll_cb, true, "Smoke Coll");
DEG_add_forcefield_relations(ctx->node, ctx->scene, ctx->object, smd->domain->effector_weights, true, PFIELD_SMOKEFLOW, "Smoke Force Field");
}