diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-05-20 07:19:05 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-05-20 07:19:05 +0300 |
commit | 65aab6cdae822822122f5e180baf10e39f600bf2 (patch) | |
tree | fc8556ec5590a0e47c41e2c18131fede4b67732b /source/blender | |
parent | 996bf65730257d0a80c6ada03a38d0a321b1e87e (diff) | |
parent | 81e584ed17902878579131776b4e5a9f7b54cdab (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender')
55 files changed, 146 insertions, 129 deletions
diff --git a/source/blender/alembic/intern/abc_curves.cc b/source/blender/alembic/intern/abc_curves.cc index 67b2cb8ae8c..f54abd6563e 100644 --- a/source/blender/alembic/intern/abc_curves.cc +++ b/source/blender/alembic/intern/abc_curves.cc @@ -297,6 +297,7 @@ void read_curve_sample(Curve *cu, const ICurvesSchema &schema, const ISampleSele nu->orderu = static_cast<short>((*orders)[i]); break; } + ATTR_FALLTHROUGH; case Alembic::AbcGeom::kLinear: default: nu->orderu = 2; 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); } + } } } diff --git a/source/blender/blenlib/BLI_compiler_attrs.h b/source/blender/blenlib/BLI_compiler_attrs.h index f0d32670229..4c548654e33 100644 --- a/source/blender/blenlib/BLI_compiler_attrs.h +++ b/source/blender/blenlib/BLI_compiler_attrs.h @@ -92,4 +92,12 @@ # define ATTR_PRINTF_FORMAT(format_param, dots_param) #endif +/* Use to suppress '-Wimplicit-fallthrough' (in place of 'break'). */ +#if defined(__GNUC__) && (__GNUC__ >= 7) /* gcc7.0+ only */ +#define ATTR_FALLTHROUGH __attribute__((fallthrough)) +#else +#define ATTR_FALLTHROUGH ((void)0) +#endif + + #endif /* __BLI_COMPILER_ATTRS_H__ */ diff --git a/source/blender/blenlib/intern/hash_mm2a.c b/source/blender/blenlib/intern/hash_mm2a.c index af6ef4f355f..e8ca9244f25 100644 --- a/source/blender/blenlib/intern/hash_mm2a.c +++ b/source/blender/blenlib/intern/hash_mm2a.c @@ -36,6 +36,8 @@ * for temporary data. */ +#include "BLI_compiler_attrs.h" + #include "BLI_hash_mm2a.h" /* own include */ /* Helpers. */ @@ -128,10 +130,10 @@ uint32_t BLI_hash_mm2(const unsigned char *data, size_t len, uint32_t seed) switch (len) { case 3: h ^= data[2] << 16; - /* fall through */ + ATTR_FALLTHROUGH; case 2: h ^= data[1] << 8; - /* fall through */ + ATTR_FALLTHROUGH; case 1: h ^= data[0]; h *= MM2A_M; diff --git a/source/blender/blenlib/intern/string.c b/source/blender/blenlib/intern/string.c index f62ffe9e985..6022732025b 100644 --- a/source/blender/blenlib/intern/string.c +++ b/source/blender/blenlib/intern/string.c @@ -332,7 +332,7 @@ size_t BLI_strescape(char *__restrict dst, const char *__restrict src, const siz goto escape_finish; case '\\': case '"': - /* fall-through */ + ATTR_FALLTHROUGH; /* less common but should also be support */ case '\t': @@ -346,7 +346,7 @@ size_t BLI_strescape(char *__restrict dst, const char *__restrict src, const siz /* not enough space to escape */ break; } - /* fall-through */ + ATTR_FALLTHROUGH; default: *dst = *src; break; diff --git a/source/blender/blenlib/intern/string_utf8.c b/source/blender/blenlib/intern/string_utf8.c index 83d4a75952f..b7e5e3e101e 100644 --- a/source/blender/blenlib/intern/string_utf8.c +++ b/source/blender/blenlib/intern/string_utf8.c @@ -205,11 +205,11 @@ int BLI_utf8_invalid_strip(char *str, size_t length) while (*src != '\0' && (utf8_size = utf8_skip_data[*src]) < maxncpy) {\ maxncpy -= utf8_size; \ switch (utf8_size) { \ - case 6: *dst ++ = *src ++; \ - case 5: *dst ++ = *src ++; \ - case 4: *dst ++ = *src ++; \ - case 3: *dst ++ = *src ++; \ - case 2: *dst ++ = *src ++; \ + case 6: *dst ++ = *src ++; ATTR_FALLTHROUGH; \ + case 5: *dst ++ = *src ++; ATTR_FALLTHROUGH; \ + case 4: *dst ++ = *src ++; ATTR_FALLTHROUGH; \ + case 3: *dst ++ = *src ++; ATTR_FALLTHROUGH; \ + case 2: *dst ++ = *src ++; ATTR_FALLTHROUGH; \ case 1: *dst ++ = *src ++; \ } \ } \ diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index f44fe3327c9..a7e0a84bccf 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -8803,7 +8803,8 @@ BlendFileData *blo_read_file_internal(FileData *fd, const char *filepath) /* in 2.50+ files, the file identifier for screens is patched, forward compatibility */ case ID_SCRN: bhead->code = ID_SCR; - /* deliberate pass on to default */ + /* pass on to default */ + ATTR_FALLTHROUGH; default: if (fd->skip_flags & BLO_READ_SKIP_DATA) { bhead = blo_nextbhead(fd, bhead); diff --git a/source/blender/blenloader/intern/versioning_260.c b/source/blender/blenloader/intern/versioning_260.c index ab3d14af882..77542d8deb9 100644 --- a/source/blender/blenloader/intern/versioning_260.c +++ b/source/blender/blenloader/intern/versioning_260.c @@ -1000,7 +1000,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main) { /* convert extended ascii to utf-8 for text editor */ Text *text; - for (text = main->text.first; text; text = text->id.next) + for (text = main->text.first; text; text = text->id.next) { if (!(text->flags & TXT_ISEXT)) { TextLine *tl; @@ -1013,6 +1013,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main) text->curc = 0; } } + } } { /* set new dynamic paint values */ diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c index d8f1da3b6b4..d4ba9c72aba 100644 --- a/source/blender/blenloader/intern/versioning_270.c +++ b/source/blender/blenloader/intern/versioning_270.c @@ -1615,6 +1615,8 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main) bNode *node; for (node = ntree->nodes.first; node; node = node->next) { if (node->type == CMP_NODE_R_LAYERS) { + /* Make sure new sockets are properly created. */ + node_verify_socket_templates(ntree, node); int pass_index = 0; const char *sockname; for (bNodeSocket *sock = node->outputs.first; sock && pass_index < 31; sock = sock->next, pass_index++) { diff --git a/source/blender/blenloader/intern/versioning_legacy.c b/source/blender/blenloader/intern/versioning_legacy.c index f2d42849bcc..c29ffbb76f2 100644 --- a/source/blender/blenloader/intern/versioning_legacy.c +++ b/source/blender/blenloader/intern/versioning_legacy.c @@ -2296,11 +2296,12 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main) /* during 2.41 images with this name were used for viewer node output, lets fix that */ if (main->versionfile == 241) { Image *ima; - for (ima = main->image.first; ima; ima = ima->id.next) + for (ima = main->image.first; ima; ima = ima->id.next) { if (STREQ(ima->name, "Compositor")) { strcpy(ima->id.name + 2, "Viewer Node"); strcpy(ima->name, "Viewer Node"); } + } } } diff --git a/source/blender/compositor/operations/COM_TextureOperation.cpp b/source/blender/compositor/operations/COM_TextureOperation.cpp index 6bfd8ae3888..d0c72935b16 100644 --- a/source/blender/compositor/operations/COM_TextureOperation.cpp +++ b/source/blender/compositor/operations/COM_TextureOperation.cpp @@ -41,6 +41,7 @@ TextureBaseOperation::TextureBaseOperation() : NodeOperation() this->m_rd = NULL; this->m_pool = NULL; this->m_sceneColorManage = false; + setComplex(true); } TextureOperation::TextureOperation() : TextureBaseOperation() { @@ -155,31 +156,3 @@ void TextureBaseOperation::executePixelSampled(float output[4], float x, float y output[0] = output[1] = output[2] = output[3]; } } - -MemoryBuffer *TextureBaseOperation::createMemoryBuffer(rcti * /*rect2*/) -{ - int height = getHeight(); - int width = getWidth(); - DataType datatype = this->getOutputSocket()->getDataType(); - int add = 4; - if (datatype == COM_DT_VALUE) { - add = 1; - } - - rcti rect; - rect.xmin = 0; - rect.ymin = 0; - rect.xmax = width; - rect.ymax = height; - MemoryBuffer *result = new MemoryBuffer(datatype, &rect); - - float *data = result->getBuffer(); - - for (int y = 0; y < height; y++) { - for (int x = 0; x < width; x++, data += add) { - this->executePixelSampled(data, x, y, COM_PS_NEAREST); - } - } - - return result; -} diff --git a/source/blender/compositor/operations/COM_TextureOperation.h b/source/blender/compositor/operations/COM_TextureOperation.h index 4cc203b54a2..59ff58a7289 100644 --- a/source/blender/compositor/operations/COM_TextureOperation.h +++ b/source/blender/compositor/operations/COM_TextureOperation.h @@ -59,8 +59,6 @@ protected: * Constructor */ TextureBaseOperation(); - - MemoryBuffer *createMemoryBuffer(rcti *rect2); public: void executePixelSampled(float output[4], float x, float y, PixelSampler sampler); diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c index a2ad5c582d5..6127f77d7d6 100644 --- a/source/blender/editors/animation/anim_draw.c +++ b/source/blender/editors/animation/anim_draw.c @@ -601,6 +601,7 @@ void ANIM_center_frame(struct bContext *C, int smooth_viewtx) break; } /* else drop through, keep range instead */ + ATTR_FALLTHROUGH; case ZOOM_FRAME_MODE_KEEP_RANGE: default: diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c index 4566f0d9837..7ec19d12fb6 100644 --- a/source/blender/editors/animation/anim_markers.c +++ b/source/blender/editors/animation/anim_markers.c @@ -906,7 +906,8 @@ static int ed_marker_move_modal(bContext *C, wmOperator *op, const wmEvent *even ed_marker_move_cancel(C, op); return OPERATOR_CANCELLED; } - /* else continue; <--- see if release event should be caught for tweak-end */ + /* else continue; <--- see if release event should be caught for tweak-end */ + ATTR_FALLTHROUGH; case RETKEY: case PADENTER: diff --git a/source/blender/editors/armature/pose_slide.c b/source/blender/editors/armature/pose_slide.c index 21cb405c32b..8dfcd5acab8 100644 --- a/source/blender/editors/armature/pose_slide.c +++ b/source/blender/editors/armature/pose_slide.c @@ -885,6 +885,7 @@ static int pose_slide_modal(bContext *C, wmOperator *op, const wmEvent *event) break; } default: + { if ((event->val == KM_PRESS) && handleNumInput(C, &pso->num, event)) { float value; @@ -972,6 +973,7 @@ static int pose_slide_modal(bContext *C, wmOperator *op, const wmEvent *event) /* allow to pass through */ return OPERATOR_RUNNING_MODAL | OPERATOR_PASS_THROUGH; } + } } diff --git a/source/blender/editors/armature/reeb.c b/source/blender/editors/armature/reeb.c index d8bef20b118..0eb44085bae 100644 --- a/source/blender/editors/armature/reeb.c +++ b/source/blender/editors/armature/reeb.c @@ -2240,9 +2240,9 @@ static void glueByMergeSort(ReebGraph *rg, ReebArc *a0, ReebArc *a1, ReebEdge *e else { a1 = nextArcMappedToEdge(a1, e1); } + } } } -} static void mergePaths(ReebGraph *rg, ReebEdge *e0, ReebEdge *e1, ReebEdge *e2) { diff --git a/source/blender/editors/gpencil/gpencil_interpolate.c b/source/blender/editors/gpencil/gpencil_interpolate.c index 6947ca6b376..59b5b41f114 100644 --- a/source/blender/editors/gpencil/gpencil_interpolate.c +++ b/source/blender/editors/gpencil/gpencil_interpolate.c @@ -625,6 +625,7 @@ static int gpencil_interpolate_modal(bContext *C, wmOperator *op, const wmEvent break; } default: + { if ((event->val == KM_PRESS) && handleNumInput(C, &tgpi->num, event)) { const float factor = tgpi->init_factor; float value; @@ -649,6 +650,7 @@ static int gpencil_interpolate_modal(bContext *C, wmOperator *op, const wmEvent /* unhandled event - allow to pass through */ return OPERATOR_RUNNING_MODAL | OPERATOR_PASS_THROUGH; } + } } /* still running... */ diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 6dcdb312256..59064ec332e 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -3371,7 +3371,7 @@ static void ui_do_but_textedit( if (event->type == WHEELDOWNMOUSE) { break; } - /* fall-through */ + ATTR_FALLTHROUGH; case ENDKEY: ui_textedit_move(but, data, STRCUR_DIR_NEXT, event->shift != 0, STRCUR_JUMP_ALL); @@ -3389,7 +3389,7 @@ static void ui_do_but_textedit( if (event->type == WHEELUPMOUSE) { break; } - /* fall-through */ + ATTR_FALLTHROUGH; case HOMEKEY: ui_textedit_move(but, data, STRCUR_DIR_PREV, event->shift != 0, STRCUR_JUMP_ALL); @@ -8409,7 +8409,7 @@ static int ui_handle_button_event(bContext *C, const wmEvent *event, uiBut *but) case MIDDLEMOUSE: case MOUSEPAN: UI_but_tooltip_timer_remove(C, but); - /* fall-through */ + ATTR_FALLTHROUGH; default: /* handle button type specific events */ retval = ui_do_button(C, block, but, event); @@ -9203,23 +9203,23 @@ static int ui_handle_menu_event( break; case ONEKEY: case PAD1: - act = 1; + act = 1; ATTR_FALLTHROUGH; case TWOKEY: case PAD2: - if (act == 0) act = 2; + if (act == 0) act = 2; ATTR_FALLTHROUGH; case THREEKEY: case PAD3: - if (act == 0) act = 3; + if (act == 0) act = 3; ATTR_FALLTHROUGH; case FOURKEY: case PAD4: - if (act == 0) act = 4; + if (act == 0) act = 4; ATTR_FALLTHROUGH; case FIVEKEY: case PAD5: - if (act == 0) act = 5; + if (act == 0) act = 5; ATTR_FALLTHROUGH; case SIXKEY: case PAD6: - if (act == 0) act = 6; + if (act == 0) act = 6; ATTR_FALLTHROUGH; case SEVENKEY: case PAD7: - if (act == 0) act = 7; + if (act == 0) act = 7; ATTR_FALLTHROUGH; case EIGHTKEY: case PAD8: - if (act == 0) act = 8; + if (act == 0) act = 8; ATTR_FALLTHROUGH; case NINEKEY: case PAD9: - if (act == 0) act = 9; + if (act == 0) act = 9; ATTR_FALLTHROUGH; case ZEROKEY: case PAD0: if (act == 0) act = 10; @@ -9814,13 +9814,13 @@ static int ui_pie_handler(bContext *C, const wmEvent *event, uiPopupBlockHandle case (ZEROKEY + n): case (PAD0 + n): \ { if (num_dir == UI_RADIAL_NONE) num_dir = d; } (void)0 - CASE_NUM_TO_DIR(1, UI_RADIAL_SW); - CASE_NUM_TO_DIR(2, UI_RADIAL_S); - CASE_NUM_TO_DIR(3, UI_RADIAL_SE); - CASE_NUM_TO_DIR(4, UI_RADIAL_W); - CASE_NUM_TO_DIR(6, UI_RADIAL_E); - CASE_NUM_TO_DIR(7, UI_RADIAL_NW); - CASE_NUM_TO_DIR(8, UI_RADIAL_N); + CASE_NUM_TO_DIR(1, UI_RADIAL_SW); ATTR_FALLTHROUGH; + CASE_NUM_TO_DIR(2, UI_RADIAL_S); ATTR_FALLTHROUGH; + CASE_NUM_TO_DIR(3, UI_RADIAL_SE); ATTR_FALLTHROUGH; + CASE_NUM_TO_DIR(4, UI_RADIAL_W); ATTR_FALLTHROUGH; + CASE_NUM_TO_DIR(6, UI_RADIAL_E); ATTR_FALLTHROUGH; + CASE_NUM_TO_DIR(7, UI_RADIAL_NW); ATTR_FALLTHROUGH; + CASE_NUM_TO_DIR(8, UI_RADIAL_N); ATTR_FALLTHROUGH; CASE_NUM_TO_DIR(9, UI_RADIAL_NE); { but = ui_block_pie_dir_activate(block, event, num_dir); diff --git a/source/blender/editors/mask/mask_ops.c b/source/blender/editors/mask/mask_ops.c index eef03852007..35de390274c 100644 --- a/source/blender/editors/mask/mask_ops.c +++ b/source/blender/editors/mask/mask_ops.c @@ -889,7 +889,7 @@ static int slide_point_modal(bContext *C, wmOperator *op, const wmEvent *event) if (ELEM(event->type, LEFTSHIFTKEY, RIGHTSHIFTKEY)) data->is_accurate = (event->val == KM_PRESS); - /* fall-through */ /* update CV position */ + ATTR_FALLTHROUGH; /* update CV position */ case MOUSEMOVE: { ScrArea *sa = CTX_wm_area(C); @@ -1376,7 +1376,7 @@ static int slide_spline_curvature_modal(bContext *C, wmOperator *op, const wmEve } - /* fall-through */ /* update CV position */ + ATTR_FALLTHROUGH; /* update CV position */ case MOUSEMOVE: { float B[2], mouse_coord[2], delta[2]; diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c index a8f3d1739bd..93cc9f30868 100644 --- a/source/blender/editors/render/render_opengl.c +++ b/source/blender/editors/render/render_opengl.c @@ -1070,7 +1070,7 @@ static int screen_opengl_render_modal(bContext *C, wmOperator *op, const wmEvent /* render frame? */ if (oglrender->timer == event->customdata) break; - /* fall-through */ + ATTR_FALLTHROUGH; default: /* nothing to do */ return OPERATOR_RUNNING_MODAL; diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index 3380131e446..d80c312c623 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -1863,10 +1863,11 @@ void ED_update_for_newframe(Main *bmain, Scene *scene, int UNUSED(mute)) /* update animated texture nodes */ { Tex *tex; - for (tex = bmain->tex.first; tex; tex = tex->id.next) + for (tex = bmain->tex.first; tex; tex = tex->id.next) { if (tex->use_nodes && tex->nodetree) { ntreeTexTagAnimated(tex->nodetree); } + } } } diff --git a/source/blender/editors/space_clip/space_clip.c b/source/blender/editors/space_clip/space_clip.c index a142d40e7b9..eed2acbfc68 100644 --- a/source/blender/editors/space_clip/space_clip.c +++ b/source/blender/editors/space_clip/space_clip.c @@ -337,7 +337,7 @@ static void clip_listener(bScreen *UNUSED(sc), ScrArea *sa, wmNotifier *wmn, con switch (wmn->data) { case ND_FRAME: clip_scopes_tag_refresh(sa); - /* fall-through */ + ATTR_FALLTHROUGH; case ND_FRAME_RANGE: ED_area_tag_redraw(sa); diff --git a/source/blender/editors/space_clip/tracking_ops.c b/source/blender/editors/space_clip/tracking_ops.c index 169eb76399b..56c240c3d20 100644 --- a/source/blender/editors/space_clip/tracking_ops.c +++ b/source/blender/editors/space_clip/tracking_ops.c @@ -875,8 +875,7 @@ static int slide_marker_modal(bContext *C, wmOperator *op, const wmEvent *event) if (ELEM(event->type, LEFTSHIFTKEY, RIGHTSHIFTKEY)) { data->accurate = event->val == KM_PRESS; } - - /* fall-through */ + ATTR_FALLTHROUGH; case MOUSEMOVE: mdelta[0] = event->mval[0] - data->mval[0]; mdelta[1] = event->mval[1] - data->mval[1]; diff --git a/source/blender/editors/space_clip/tracking_ops_plane.c b/source/blender/editors/space_clip/tracking_ops_plane.c index 4332f3ea765..aa8518befaa 100644 --- a/source/blender/editors/space_clip/tracking_ops_plane.c +++ b/source/blender/editors/space_clip/tracking_ops_plane.c @@ -301,8 +301,7 @@ static int slide_plane_marker_modal(bContext *C, if (ELEM(event->type, LEFTSHIFTKEY, RIGHTSHIFTKEY)) { data->accurate = event->val == KM_PRESS; } - - /* fall-through */ + ATTR_FALLTHROUGH; case MOUSEMOVE: mdelta[0] = event->mval[0] - data->previous_mval[0]; mdelta[1] = event->mval[1] - data->previous_mval[1]; diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c index ad9fb49baef..8037c2deb5b 100644 --- a/source/blender/editors/space_image/image_buttons.c +++ b/source/blender/editors/space_image/image_buttons.c @@ -1208,7 +1208,7 @@ void uiTemplateImageStereo3d(uiLayout *layout, PointerRNA *stereo3d_format_ptr) case S3D_DISPLAY_SIDEBYSIDE: { uiItemR(col, stereo3d_format_ptr, "use_sidebyside_crosseyed", 0, NULL, ICON_NONE); - /* fall-through */ + ATTR_FALLTHROUGH; } case S3D_DISPLAY_TOPBOTTOM: { diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index bb6a8676cc1..561c29b68cc 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -391,7 +391,7 @@ static void nla_draw_strip(SpaceNla *snla, AnimData *adt, NlaTrack *nlt, NlaStri /* draw the rect to the edge of the screen */ immRectf(shdr_pos, v2d->cur.xmin, yminc, strip->start, ymaxc); } - /* fall-through */ + ATTR_FALLTHROUGH; /* this only draws after the strip */ case NLASTRIP_EXTEND_HOLD_FORWARD: diff --git a/source/blender/editors/space_node/node_add.c b/source/blender/editors/space_node/node_add.c index bcd0f6623e1..dc6b06790e0 100644 --- a/source/blender/editors/space_node/node_add.c +++ b/source/blender/editors/space_node/node_add.c @@ -107,13 +107,15 @@ static bool add_reroute_intersect_check(bNodeLink *link, float mcoords[][2], int if (node_link_bezier_points(NULL, NULL, link, coord_array, NODE_LINK_RESOL)) { - for (i = 0; i < tot - 1; i++) - for (b = 0; b < NODE_LINK_RESOL; b++) + for (i = 0; i < tot - 1; i++) { + for (b = 0; b < NODE_LINK_RESOL; b++) { if (isect_seg_seg_v2(mcoords[i], mcoords[i + 1], coord_array[b], coord_array[b + 1]) > 0) { result[0] = (mcoords[i][0] + mcoords[i + 1][0]) / 2.0f; result[1] = (mcoords[i][1] + mcoords[i + 1][1]) / 2.0f; return 1; } + } + } } return 0; } diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index 8963eb760ce..f87a0b5e7af 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -562,7 +562,7 @@ int seq_effect_find_selected(Scene *scene, Sequence *activeseq, int type, Sequen } if (seq1 == NULL) seq1 = seq2; if (seq3 == NULL) seq3 = seq2; - /* fall-through */ + ATTR_FALLTHROUGH; case 2: if (seq1 == NULL || seq2 == NULL) { *error_str = N_("2 selected sequence strips are needed"); diff --git a/source/blender/editors/space_text/space_text.c b/source/blender/editors/space_text/space_text.c index 1cea90d52db..e000095bd19 100644 --- a/source/blender/editors/space_text/space_text.c +++ b/source/blender/editors/space_text/space_text.c @@ -158,7 +158,7 @@ static void text_listener(bScreen *UNUSED(sc), ScrArea *sa, wmNotifier *wmn, con } ED_area_tag_redraw(sa); - /* fall-through */ /* fall down to tag redraw */ + ATTR_FALLTHROUGH; /* fall down to tag redraw */ case NA_ADDED: case NA_REMOVED: ED_area_tag_redraw(sa); diff --git a/source/blender/editors/space_text/text_autocomplete.c b/source/blender/editors/space_text/text_autocomplete.c index c38c57b9528..9b0bd30ff11 100644 --- a/source/blender/editors/space_text/text_autocomplete.c +++ b/source/blender/editors/space_text/text_autocomplete.c @@ -455,7 +455,7 @@ static int text_autocomplete_modal(bContext *C, wmOperator *op, const wmEvent *e break; case PAGEDOWNKEY: scroll = SUGG_LIST_SIZE - 1; - /* fall-through */ + ATTR_FALLTHROUGH; case WHEELDOWNMOUSE: case DOWNARROWKEY: if (event->val == KM_PRESS) { @@ -489,7 +489,7 @@ static int text_autocomplete_modal(bContext *C, wmOperator *op, const wmEvent *e break; case PAGEUPKEY: scroll = SUGG_LIST_SIZE - 1; - /* fall-through */ + ATTR_FALLTHROUGH; case WHEELUPMOUSE: case UPARROWKEY: if (event->val == KM_PRESS) { diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 2bae620a4ed..7bb95ba6d15 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -6013,7 +6013,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv copy_m4_m4(imat, rv3d->viewinv); normalize_v3(imat[0]); normalize_v3(imat[1]); - /* fall-through */ + ATTR_FALLTHROUGH; case PART_DRAW_CROSS: case PART_DRAW_AXIS: /* lets calculate the scale: */ diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 02ad292e5c1..be5b475b89b 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -1616,7 +1616,7 @@ static void drawArrow(ArrowDirection d, short offset, short length, short size) offset = -offset; length = -length; size = -size; - /* fall-through */ + ATTR_FALLTHROUGH; case RIGHT: immVertex2f(POS_INDEX, offset, 0); immVertex2f(POS_INDEX, offset + length, 0); @@ -1630,7 +1630,7 @@ static void drawArrow(ArrowDirection d, short offset, short length, short size) offset = -offset; length = -length; size = -size; - /* fall-through */ + ATTR_FALLTHROUGH; case UP: immVertex2f(POS_INDEX, 0, offset); immVertex2f(POS_INDEX, 0, offset + length); @@ -1651,7 +1651,7 @@ static void drawArrowHead(ArrowDirection d, short size) switch (d) { case LEFT: size = -size; - /* fall-through */ + ATTR_FALLTHROUGH; case RIGHT: immVertex2f(POS_INDEX, 0, 0); immVertex2f(POS_INDEX, -size, -size); @@ -1661,7 +1661,7 @@ static void drawArrowHead(ArrowDirection d, short size) case DOWN: size = -size; - /* fall-through */ + ATTR_FALLTHROUGH; case UP: immVertex2f(POS_INDEX, 0, 0); immVertex2f(POS_INDEX, -size, -size); diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c index 024d465e29c..009cb2bac63 100644 --- a/source/blender/editors/transform/transform_manipulator.c +++ b/source/blender/editors/transform/transform_manipulator.c @@ -949,7 +949,7 @@ static int calc_manipulator_stats(const bContext *C) break; } /* if not gimbal, fall through to normal */ - /* fall-through */ + ATTR_FALLTHROUGH; } case V3D_MANIP_NORMAL: { @@ -960,7 +960,7 @@ static int calc_manipulator_stats(const bContext *C) break; } /* no break we define 'normal' as 'local' in Object mode */ - /* fall-through */ + ATTR_FALLTHROUGH; } case V3D_MANIP_LOCAL: { diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c index e1a45cb2309..c9e40865164 100644 --- a/source/blender/editors/transform/transform_orientations.c +++ b/source/blender/editors/transform/transform_orientations.c @@ -455,14 +455,14 @@ void initTransformOrientation(bContext *C, TransInfo *t) BLI_strncpy(t->spacename, IFACE_("gimbal"), sizeof(t->spacename)); break; } - /* fall-through */ /* no gimbal fallthrough to normal */ + ATTR_FALLTHROUGH; /* no gimbal fallthrough to normal */ case V3D_MANIP_NORMAL: if (obedit || (ob && ob->mode & OB_MODE_POSE)) { BLI_strncpy(t->spacename, IFACE_("normal"), sizeof(t->spacename)); ED_getTransformOrientationMatrix(C, t->spacemtx, t->around); break; } - /* fall-through */ /* we define 'normal' as 'local' in Object mode */ + ATTR_FALLTHROUGH; /* we define 'normal' as 'local' in Object mode */ case V3D_MANIP_LOCAL: BLI_strncpy(t->spacename, IFACE_("local"), sizeof(t->spacename)); diff --git a/source/blender/editors/util/numinput.c b/source/blender/editors/util/numinput.c index 3727be1842c..61142fdc887 100644 --- a/source/blender/editors/util/numinput.c +++ b/source/blender/editors/util/numinput.c @@ -296,7 +296,7 @@ bool handleNumInput(bContext *C, NumInput *n, const wmEvent *event) } /* Else, common behavior with DELKEY, only difference is remove char(s) before/after the cursor. */ dir = STRCUR_DIR_PREV; - /* fall-through */ + ATTR_FALLTHROUGH; case DELKEY: if ((n->val_flag[idx] & NUM_EDITED) && n->str[0]) { int t_cur = cur = n->str_cur; @@ -322,7 +322,7 @@ bool handleNumInput(bContext *C, NumInput *n, const wmEvent *event) break; case LEFTARROWKEY: dir = STRCUR_DIR_PREV; - /* fall-through */ + ATTR_FALLTHROUGH; case RIGHTARROWKEY: cur = n->str_cur; if (event->ctrl) { diff --git a/source/blender/editors/uvedit/uvedit_smart_stitch.c b/source/blender/editors/uvedit/uvedit_smart_stitch.c index bcdaca450c6..d6e77e3081e 100644 --- a/source/blender/editors/uvedit/uvedit_smart_stitch.c +++ b/source/blender/editors/uvedit/uvedit_smart_stitch.c @@ -2173,6 +2173,7 @@ static int stitch_modal(bContext *C, wmOperator *op, const wmEvent *event) } break; } + ATTR_FALLTHROUGH; case PADENTER: case RETKEY: if (event->val == KM_PRESS) { diff --git a/source/blender/gpu/intern/gpu_debug.c b/source/blender/gpu/intern/gpu_debug.c index 9adc6b89067..8aea87ef659 100644 --- a/source/blender/gpu/intern/gpu_debug.c +++ b/source/blender/gpu/intern/gpu_debug.c @@ -29,6 +29,7 @@ * \ingroup gpu */ +#include "BLI_compiler_attrs.h" #include "BLI_utildefines.h" #include "BLI_sys_types.h" #include "BLI_system.h" @@ -94,7 +95,7 @@ static void APIENTRY gpu_debug_proc( switch (severity) { case GL_DEBUG_SEVERITY_HIGH: backtrace = true; - /* fall through */ + ATTR_FALLTHROUGH; case GL_DEBUG_SEVERITY_MEDIUM: case GL_DEBUG_SEVERITY_LOW: case GL_DEBUG_SEVERITY_NOTIFICATION: /* KHR has this, ARB does not */ @@ -134,7 +135,7 @@ static void APIENTRY gpu_debug_proc_amd( switch (severity) { case GL_DEBUG_SEVERITY_HIGH: backtrace = true; - /* fall through */ + ATTR_FALLTHROUGH; case GL_DEBUG_SEVERITY_MEDIUM: case GL_DEBUG_SEVERITY_LOW: fprintf(stderr, "GL %s: %s\n", category_name_amd(category), message); diff --git a/source/blender/imbuf/intern/png.c b/source/blender/imbuf/intern/png.c index 5192e3f2d26..503e63a3fb1 100644 --- a/source/blender/imbuf/intern/png.c +++ b/source/blender/imbuf/intern/png.c @@ -613,11 +613,12 @@ ImBuf *imb_loadpng(const unsigned char *mem, size_t size, int flags, char colors int unit_type; png_uint_32 xres, yres; - if (png_get_pHYs(png_ptr, info_ptr, &xres, &yres, &unit_type)) + if (png_get_pHYs(png_ptr, info_ptr, &xres, &yres, &unit_type)) { if (unit_type == PNG_RESOLUTION_METER) { ibuf->ppm[0] = xres; ibuf->ppm[1] = yres; } + } } } else { diff --git a/source/blender/imbuf/intern/radiance_hdr.c b/source/blender/imbuf/intern/radiance_hdr.c index 71e74928e20..a21468e474c 100644 --- a/source/blender/imbuf/intern/radiance_hdr.c +++ b/source/blender/imbuf/intern/radiance_hdr.c @@ -340,13 +340,14 @@ static int fwritecolrs(FILE *file, int width, int channels, unsigned char *ibufs } if (((beg - j) > 1) && ((beg - j) < MINRUN)) { c2 = j + 1; - while (rgbe_scan[c2++][i] == rgbe_scan[j][i]) + while (rgbe_scan[c2++][i] == rgbe_scan[j][i]) { if (c2 == beg) { /* short run */ putc((unsigned char)(128 + beg - j), file); putc((unsigned char)(rgbe_scan[j][i]), file); j = beg; break; } + } } while (j < beg) { /* write out non-run */ if ((c2 = beg - j) > 128) c2 = 128; diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 7b9019e202e..6613bb8a5f7 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -806,7 +806,7 @@ static PyObject *pyrna_struct_richcmp(PyObject *a, PyObject *b, int op) switch (op) { case Py_NE: ok = !ok; - /* fall-through */ + ATTR_FALLTHROUGH; case Py_EQ: res = ok ? Py_False : Py_True; break; @@ -836,7 +836,7 @@ static PyObject *pyrna_prop_richcmp(PyObject *a, PyObject *b, int op) switch (op) { case Py_NE: ok = !ok; - /* fall-through */ + ATTR_FALLTHROUGH; case Py_EQ: res = ok ? Py_False : Py_True; break; @@ -5168,7 +5168,7 @@ static PyObject *pyrna_param_to_py(PointerRNA *ptr, PropertyRNA *prop, void *dat ret = Matrix_CreatePyObject(data, 3, 3, NULL); break; } - /* fall-through */ + ATTR_FALLTHROUGH; #endif default: ret = PyTuple_New(len); diff --git a/source/blender/python/mathutils/mathutils_Color.c b/source/blender/python/mathutils/mathutils_Color.c index add8c2451ff..9997cd9c1f5 100644 --- a/source/blender/python/mathutils/mathutils_Color.c +++ b/source/blender/python/mathutils/mathutils_Color.c @@ -173,7 +173,7 @@ static PyObject *Color_richcmpr(PyObject *a, PyObject *b, int op) switch (op) { case Py_NE: ok = !ok; - /* fall-through */ + ATTR_FALLTHROUGH; case Py_EQ: res = ok ? Py_False : Py_True; break; diff --git a/source/blender/python/mathutils/mathutils_Euler.c b/source/blender/python/mathutils/mathutils_Euler.c index 54adc826af7..9492b6d67f3 100644 --- a/source/blender/python/mathutils/mathutils_Euler.c +++ b/source/blender/python/mathutils/mathutils_Euler.c @@ -65,7 +65,7 @@ static PyObject *Euler_new(PyTypeObject *type, PyObject *args, PyObject *kwds) case 2: if ((order = euler_order_from_string(order_str, "mathutils.Euler()")) == -1) return NULL; - /* fall-through */ + ATTR_FALLTHROUGH; case 1: if (mathutils_array_parse(eul, EULER_SIZE, EULER_SIZE, seq, "mathutils.Euler()") == -1) return NULL; @@ -370,7 +370,7 @@ static PyObject *Euler_richcmpr(PyObject *a, PyObject *b, int op) switch (op) { case Py_NE: ok = !ok; - /* fall-through */ + ATTR_FALLTHROUGH; case Py_EQ: res = ok ? Py_False : Py_True; break; diff --git a/source/blender/python/mathutils/mathutils_Matrix.c b/source/blender/python/mathutils/mathutils_Matrix.c index 10f428ba355..bfd23af257b 100644 --- a/source/blender/python/mathutils/mathutils_Matrix.c +++ b/source/blender/python/mathutils/mathutils_Matrix.c @@ -2034,7 +2034,7 @@ static PyObject *Matrix_richcmpr(PyObject *a, PyObject *b, int op) switch (op) { case Py_NE: ok = !ok; - /* fall-through */ + ATTR_FALLTHROUGH; case Py_EQ: res = ok ? Py_False : Py_True; break; diff --git a/source/blender/python/mathutils/mathutils_Quaternion.c b/source/blender/python/mathutils/mathutils_Quaternion.c index 71b3cf8ddac..d283c717a46 100644 --- a/source/blender/python/mathutils/mathutils_Quaternion.c +++ b/source/blender/python/mathutils/mathutils_Quaternion.c @@ -552,7 +552,7 @@ static PyObject *Quaternion_richcmpr(PyObject *a, PyObject *b, int op) switch (op) { case Py_NE: ok = !ok; - /* fall-through */ + ATTR_FALLTHROUGH; case Py_EQ: res = ok ? Py_False : Py_True; break; diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index 9d30c3460cc..535b7b52be8 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -4702,6 +4702,12 @@ static void add_render_object(Render *re, Object *ob, Object *par, DupliObject * if (ob->particlesystem.first) { psysindex= 1; for (psys=ob->particlesystem.first; psys; psys=psys->next, psysindex++) { + /* It seems that we may generate psys->renderdata recursively in some nasty intricated cases of + * several levels of bupliobject (see T51524). + * For now, basic rule is, do not restore psys if it was already in 'render state'. + * Another, more robust solution could be to add some reference counting to that renderdata... */ + const bool psys_has_renderdata = (psys->renderdata != NULL); + if (!psys_check_enabled(ob, psys, G.is_rendering)) continue; @@ -4713,8 +4719,9 @@ static void add_render_object(Render *re, Object *ob, Object *par, DupliObject * if (dob) psys->flag |= PSYS_USE_IMAT; init_render_object_data(re, obr, timeoffset); - if (!(re->r.scemode & R_VIEWPORT_PREVIEW)) + if (!(re->r.scemode & R_VIEWPORT_PREVIEW) && !psys_has_renderdata) { psys_render_restore(ob, psys); + } psys->flag &= ~PSYS_USE_IMAT; /* only add instance for objects that have not been used for dupli */ diff --git a/source/blender/render/intern/source/render_texture.c b/source/blender/render/intern/source/render_texture.c index 42e4d4f27f6..22dc2b28900 100644 --- a/source/blender/render/intern/source/render_texture.c +++ b/source/blender/render/intern/source/render_texture.c @@ -1495,6 +1495,7 @@ void texture_rgb_blend(float in[3], const float tex[3], const float out[3], floa case MTEX_SUB: fact= -fact; + ATTR_FALLTHROUGH; case MTEX_ADD: fact*= facg; in[0]= (fact*tex[0] + out[0]); @@ -1609,6 +1610,7 @@ float texture_value_blend(float tex, float out, float fact, float facg, int blen case MTEX_SUB: fact= -fact; + ATTR_FALLTHROUGH; case MTEX_ADD: in= fact*tex + out; break; diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c index 0b1004c562e..59c7ea85c1d 100644 --- a/source/blender/render/intern/source/rendercore.c +++ b/source/blender/render/intern/source/rendercore.c @@ -180,11 +180,12 @@ static void halo_pixelstruct(HaloRen *har, RenderLayer **rlpp, int totsample, in flarec= 0; if (fullsample) { - for (sample=0; sample<totsample; sample++) + for (sample=0; sample<totsample; sample++) { if (ps->mask & (1 << sample)) { float *pass = RE_RenderLayerGetPass(rlpp[sample], RE_PASSNAME_COMBINED, R.viewname); addalphaAddfacFloat(pass + od*4, col, har->add); } + } } else { fac= ((float)amountm)/(float)R.osa; @@ -215,11 +216,12 @@ static void halo_pixelstruct(HaloRen *har, RenderLayer **rlpp, int totsample, in } if (fullsample) { - for (sample=0; sample<totsample; sample++) + for (sample=0; sample<totsample; sample++) { if (!(mask & (1 << sample))) { float *pass = RE_RenderLayerGetPass(rlpp[sample], RE_PASSNAME_COMBINED, R.viewname); addalphaAddfacFloat(pass + od*4, col, har->add); } + } } else { col[0]= accol[0]; diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index 610e86caa13..7fe52328781 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -275,10 +275,12 @@ static float metadensity(Object *ob, const float co[3]) break; case MB_CUBE: tp[2] = (tp[2] > ml->expz) ? (tp[2] - ml->expz) : ((tp[2] < -ml->expz) ? (tp[2] + ml->expz) : 0.f); - /* no break, xy as plane */ + /* no break, xy as plane */ + ATTR_FALLTHROUGH; case MB_PLANE: tp[1] = (tp[1] > ml->expy) ? (tp[1] - ml->expy) : ((tp[1] < -ml->expy) ? (tp[1] + ml->expy) : 0.f); - /* no break, x as tube */ + /* no break, x as tube */ + ATTR_FALLTHROUGH; case MB_TUBE: tp[0] = (tp[0] > ml->expx) ? (tp[0] - ml->expx) : ((tp[0] < -ml->expx) ? (tp[0] + ml->expx) : 0.f); } diff --git a/source/blender/render/intern/source/zbuf.c b/source/blender/render/intern/source/zbuf.c index 94e03929c4e..e497ec1a870 100644 --- a/source/blender/render/intern/source/zbuf.c +++ b/source/blender/render/intern/source/zbuf.c @@ -3623,7 +3623,7 @@ static void merge_transp_passes(RenderLayer *rl, ShadeResult *shr) fp[3] = speed[3]; } } - } + } } if (col) { |