diff options
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/image.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/mball_tessellate.c | 11 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/packedFile.c | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/particle.c | 6 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/rigidbody.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/seqmodifier.c | 15 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/softbody.c | 6 |
7 files changed, 26 insertions, 20 deletions
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index 2db13f9c778..026e8aea74f 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -1238,7 +1238,7 @@ char BKE_imtype_valid_channels(const char imtype, bool write_file) switch (imtype) { case R_IMF_IMTYPE_BMP: if (write_file) break; - /* fall-through */ + ATTR_FALLTHROUGH; case R_IMF_IMTYPE_TARGA: case R_IMF_IMTYPE_RAWTGA: case R_IMF_IMTYPE_IRIS: diff --git a/source/blender/blenkernel/intern/mball_tessellate.c b/source/blender/blenkernel/intern/mball_tessellate.c index afbc1c5dca3..d897213d362 100644 --- a/source/blender/blenkernel/intern/mball_tessellate.c +++ b/source/blender/blenkernel/intern/mball_tessellate.c @@ -317,12 +317,12 @@ static float densfunc(const MetaElem *ball, float x, float y, float z) if (dvec[2] > ball->expz) dvec[2] -= ball->expz; else if (dvec[2] < -ball->expz) dvec[2] += ball->expz; else dvec[2] = 0.0; - /* fall through */ + ATTR_FALLTHROUGH; case MB_PLANE: if (dvec[1] > ball->expy) dvec[1] -= ball->expy; else if (dvec[1] < -ball->expy) dvec[1] += ball->expy; else dvec[1] = 0.0; - /* fall through */ + ATTR_FALLTHROUGH; case MB_TUBE: if (dvec[0] > ball->expx) dvec[0] -= ball->expx; else if (dvec[0] < -ball->expx) dvec[0] += ball->expx; @@ -661,7 +661,7 @@ static void makecubetable(void) for (i = 0; i < 256; i++) { for (e = 0; e < 12; e++) done[e] = 0; for (c = 0; c < 8; c++) pos[c] = MB_BIT(i, c); - for (e = 0; e < 12; e++) + for (e = 0; e < 12; e++) { if (!done[e] && (pos[corner1[e]] != pos[corner2[e]])) { INTLIST *ints = NULL; INTLISTS *lists = MEM_callocN(sizeof(INTLISTS), "mball_intlist"); @@ -688,6 +688,7 @@ static void makecubetable(void) lists->next = cubetable[i]; cubetable[i] = lists; } + } } for (i = 0; i < 256; i++) { @@ -1194,10 +1195,10 @@ static void init_meta(EvaluationContext *eval_ctx, PROCESS *process, Scene *scen break; case MB_CUBE: /* cube is "expanded" by expz, expy and expx */ expz += ml->expz; - /* fall through */ + ATTR_FALLTHROUGH; case MB_PLANE: /* plane is "expanded" by expy and expx */ expy += ml->expy; - /* fall through */ + ATTR_FALLTHROUGH; case MB_TUBE: /* tube is "expanded" by expx */ expx += ml->expx; break; diff --git a/source/blender/blenkernel/intern/packedFile.c b/source/blender/blenkernel/intern/packedFile.c index 489fc2f3710..64f90ef5c52 100644 --- a/source/blender/blenkernel/intern/packedFile.c +++ b/source/blender/blenkernel/intern/packedFile.c @@ -450,7 +450,7 @@ char *unpackFile(ReportList *reports, const char *abs_name, const char *local_na break; } /* else create it */ - /* fall-through */ + ATTR_FALLTHROUGH; } case PF_WRITE_LOCAL: if (writePackedFile(reports, local_name, pf, 1) == RET_OK) { @@ -471,7 +471,7 @@ char *unpackFile(ReportList *reports, const char *abs_name, const char *local_na break; } /* else create it */ - /* fall-through */ + ATTR_FALLTHROUGH; } case PF_WRITE_ORIGINAL: if (writePackedFile(reports, abs_name, pf, 1) == RET_OK) { diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index 30ad808a650..7901dff129e 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -3471,7 +3471,8 @@ static void get_cpa_texture(DerivedMesh *dm, ParticleSystem *psys, ParticleSetti case TEXCO_UV: if (fw && get_particle_uv(dm, NULL, face_index, fw, mtex->uvname, texvec)) break; - /* no break, failed to get uv's, so let's try orco's */ + /* no break, failed to get uv's, so let's try orco's */ + ATTR_FALLTHROUGH; case TEXCO_ORCO: copy_v3_v3(texvec, orco); break; @@ -3543,7 +3544,8 @@ void psys_get_texture(ParticleSimulationData *sim, ParticleData *pa, ParticleTex case TEXCO_UV: if (get_particle_uv(sim->psmd->dm_final, pa, 0, pa->fuv, mtex->uvname, texvec)) break; - /* no break, failed to get uv's, so let's try orco's */ + /* no break, failed to get uv's, so let's try orco's */ + ATTR_FALLTHROUGH; case TEXCO_ORCO: psys_particle_on_emitter(sim->psmd, sim->psys->part->from, pa->num, pa->num_dmcache, pa->fuv, pa->foffset, co, 0, 0, 0, texvec, 0); diff --git a/source/blender/blenkernel/intern/rigidbody.c b/source/blender/blenkernel/intern/rigidbody.c index 6618b307b63..aec635feffa 100644 --- a/source/blender/blenkernel/intern/rigidbody.c +++ b/source/blender/blenkernel/intern/rigidbody.c @@ -821,7 +821,7 @@ static void rigidbody_validate_sim_constraint(RigidBodyWorld *rbw, Object *ob, b RB_constraint_set_damping_6dof_spring(rbc->physics_constraint, RB_LIMIT_ANG_Z, rbc->spring_damping_ang_z); RB_constraint_set_equilibrium_6dof_spring(rbc->physics_constraint); - /* fall-through */ + ATTR_FALLTHROUGH; case RBC_TYPE_6DOF: if (rbc->type == RBC_TYPE_6DOF) /* a litte awkward but avoids duplicate code for limits */ rbc->physics_constraint = RB_constraint_new_6dof(loc, rot, rb1, rb2); diff --git a/source/blender/blenkernel/intern/seqmodifier.c b/source/blender/blenkernel/intern/seqmodifier.c index 89c2f76c661..e2f74dbab3c 100644 --- a/source/blender/blenkernel/intern/seqmodifier.c +++ b/source/blender/blenkernel/intern/seqmodifier.c @@ -202,21 +202,22 @@ static void whiteBalance_apply_threaded(int width, int height, unsigned char *re for (y = 0; y < height; y++) { for (x = 0; x < width; x++) { int pixel_index = (y * width + x) * 4; - float result[4], mask[3] = {1.0f, 1.0f, 1.0f}; + float rgba[4], result[4], mask[3] = {1.0f, 1.0f, 1.0f}; if (rect_float) { - copy_v3_v3(result, rect_float + pixel_index); + copy_v3_v3(rgba, rect_float + pixel_index); } else { - straight_uchar_to_premul_float(result, rect + pixel_index); + straight_uchar_to_premul_float(rgba, rect + pixel_index); } + copy_v4_v4(result, rgba); #if 0 mul_v3_v3(result, multiplier); #else /* similar to division without the clipping */ for (int i = 0; i < 3; i++) { - result[i] = 1.0f - powf(1.0f - result[i], multiplier[i]); + result[i] = 1.0f - powf(1.0f - rgba[i], multiplier[i]); } #endif @@ -227,9 +228,9 @@ static void whiteBalance_apply_threaded(int width, int height, unsigned char *re rgb_uchar_to_float(mask, mask_rect + pixel_index); } - result[0] = result[0] * (1.0f - mask[0]) + result[0] * mask[0]; - result[1] = result[1] * (1.0f - mask[1]) + result[1] * mask[1]; - result[2] = result[2] * (1.0f - mask[2]) + result[2] * mask[2]; + result[0] = rgba[0] * (1.0f - mask[0]) + result[0] * mask[0]; + result[1] = rgba[1] * (1.0f - mask[1]) + result[1] * mask[1]; + result[2] = rgba[2] * (1.0f - mask[2]) + result[2] * mask[2]; if (rect_float) { copy_v3_v3(rect_float + pixel_index, result); diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c index 421a0e30036..11c692077c0 100644 --- a/source/blender/blenkernel/intern/softbody.c +++ b/source/blender/blenkernel/intern/softbody.c @@ -1856,19 +1856,21 @@ static void dfdx_spring(int ia, int ic, int op, float dir[3], float L, float len float m, delta_ij; int i, j; if (L < len) { - for (i=0;i<3;i++) + for (i=0;i<3;i++) { for (j=0;j<3;j++) { delta_ij = (i==j ? (1.0f): (0.0f)); m=factor*(dir[i]*dir[j] + (1-L/len)*(delta_ij - dir[i]*dir[j])); EIG_linear_solver_matrix_add(ia+i, op+ic+j, m); } + } } else { - for (i=0;i<3;i++) + for (i=0;i<3;i++) { for (j=0;j<3;j++) { m=factor*dir[i]*dir[j]; EIG_linear_solver_matrix_add(ia+i, op+ic+j, m); } + } } } |