CMake: Use GCC7's -Wimplicit-fallthrough=5
Use to avoid accidental missing break statements, use ATTR_FALLTHROUGH to suppress.
This commit is contained in:
@@ -1380,9 +1380,16 @@ if(CMAKE_COMPILER_IS_GNUCC)
|
||||
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_MISSING_DECLARATIONS -Wmissing-declarations)
|
||||
endif()
|
||||
|
||||
# Use 'ATTR_FALLTHROUGH' macro to suppress.
|
||||
if(CMAKE_COMPILER_IS_GNUCC AND (NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "7.0"))
|
||||
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_IMPLICIT_FALLTHROUGH -Wimplicit-fallthrough=5)
|
||||
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_IMPLICIT_FALLTHROUGH -Wimplicit-fallthrough=5)
|
||||
endif()
|
||||
|
||||
# flags to undo strict flags
|
||||
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_DEPRECATED_DECLARATIONS -Wno-deprecated-declarations)
|
||||
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_PARAMETER -Wno-unused-parameter)
|
||||
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_IMPLICIT_FALLTHROUGH -Wno-implicit-fallthrough)
|
||||
|
||||
if(NOT APPLE)
|
||||
ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_ERROR_UNUSED_BUT_SET_VARIABLE -Wno-error=unused-but-set-variable)
|
||||
|
||||
@@ -38,6 +38,14 @@
|
||||
|
||||
#include "STR_String.h"
|
||||
|
||||
/* copied from 'BLI_compiler_attrs.h' */
|
||||
/* 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
|
||||
|
||||
|
||||
// Hash Mix utility function, by Bob Jenkins - Mix 3 32-bit values reversibly
|
||||
//
|
||||
@@ -102,16 +110,16 @@ static dword STR_gHash(const void *in, int len, dword init_val)
|
||||
// Handle the last 11 bytes
|
||||
c += len;
|
||||
switch (length) {
|
||||
case 11: c += ((dword)p_in[10] << 24);
|
||||
case 10: c += ((dword)p_in[9] << 16);
|
||||
case 9: c += ((dword)p_in[8] << 8); /* the first byte of c is reserved for the length */
|
||||
case 8: b += ((dword)p_in[7] << 24);
|
||||
case 7: b += ((dword)p_in[6] << 16);
|
||||
case 6: b += ((dword)p_in[5] << 8);
|
||||
case 5: b += p_in[4];
|
||||
case 4: a += ((dword)p_in[3] << 24);
|
||||
case 3: a += ((dword)p_in[2] << 16);
|
||||
case 2: a += ((dword)p_in[1] << 8);
|
||||
case 11: c += ((dword)p_in[10] << 24); ATTR_FALLTHROUGH;
|
||||
case 10: c += ((dword)p_in[9] << 16); ATTR_FALLTHROUGH;
|
||||
case 9: c += ((dword)p_in[8] << 8); ATTR_FALLTHROUGH; /* the first byte of c is reserved for the length */
|
||||
case 8: b += ((dword)p_in[7] << 24); ATTR_FALLTHROUGH;
|
||||
case 7: b += ((dword)p_in[6] << 16); ATTR_FALLTHROUGH;
|
||||
case 6: b += ((dword)p_in[5] << 8); ATTR_FALLTHROUGH;
|
||||
case 5: b += p_in[4]; ATTR_FALLTHROUGH;
|
||||
case 4: a += ((dword)p_in[3] << 24); ATTR_FALLTHROUGH;
|
||||
case 3: a += ((dword)p_in[2] << 16); ATTR_FALLTHROUGH;
|
||||
case 2: a += ((dword)p_in[1] << 8); ATTR_FALLTHROUGH;
|
||||
case 1: a += p_in[0];
|
||||
}
|
||||
STR_gHashMix(a, b, c);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -316,12 +316,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;
|
||||
@@ -1194,10 +1194,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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -3467,6 +3467,7 @@ static void get_cpa_texture(DerivedMesh *dm, ParticleSystem *psys, ParticleSetti
|
||||
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 */
|
||||
ATTR_FALLTHROUGH;
|
||||
case TEXCO_ORCO:
|
||||
copy_v3_v3(texvec, orco);
|
||||
break;
|
||||
@@ -3539,6 +3540,7 @@ void psys_get_texture(ParticleSimulationData *sim, ParticleData *pa, ParticleTex
|
||||
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 */
|
||||
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);
|
||||
|
||||
|
||||
@@ -822,7 +822,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);
|
||||
|
||||
@@ -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__ */
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 ++; \
|
||||
} \
|
||||
} \
|
||||
|
||||
@@ -8685,7 +8685,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);
|
||||
|
||||
@@ -579,6 +579,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:
|
||||
|
||||
@@ -889,6 +889,7 @@ static int ed_marker_move_modal(bContext *C, wmOperator *op, const wmEvent *even
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
/* else continue; <--- see if release event should be caught for tweak-end */
|
||||
ATTR_FALLTHROUGH;
|
||||
|
||||
case RETKEY:
|
||||
case PADENTER:
|
||||
|
||||
@@ -3378,7 +3378,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);
|
||||
@@ -3396,7 +3396,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);
|
||||
@@ -8408,7 +8408,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);
|
||||
@@ -9202,23 +9202,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;
|
||||
|
||||
@@ -9813,13 +9813,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);
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -1083,7 +1083,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;
|
||||
|
||||
@@ -337,7 +337,7 @@ static void clip_listener(bScreen *UNUSED(sc), ScrArea *sa, wmNotifier *wmn)
|
||||
switch (wmn->data) {
|
||||
case ND_FRAME:
|
||||
clip_scopes_tag_refresh(sa);
|
||||
/* fall-through */
|
||||
ATTR_FALLTHROUGH;
|
||||
|
||||
case ND_FRAME_RANGE:
|
||||
ED_area_tag_redraw(sa);
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -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:
|
||||
{
|
||||
|
||||
@@ -362,7 +362,7 @@ static void nla_draw_strip(SpaceNla *snla, AnimData *adt, NlaTrack *nlt, NlaStri
|
||||
glVertex2f(strip->start, yminc);
|
||||
glEnd();
|
||||
}
|
||||
/* fall-through */
|
||||
ATTR_FALLTHROUGH;
|
||||
|
||||
/* this only draws after the strip */
|
||||
case NLASTRIP_EXTEND_HOLD_FORWARD:
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -158,7 +158,7 @@ static void text_listener(bScreen *UNUSED(sc), ScrArea *sa, wmNotifier *wmn)
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -5120,7 +5120,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: */
|
||||
|
||||
@@ -1605,7 +1605,7 @@ static void drawArrow(ArrowDirection d, short offset, short length, short size)
|
||||
offset = -offset;
|
||||
length = -length;
|
||||
size = -size;
|
||||
/* fall-through */
|
||||
ATTR_FALLTHROUGH;
|
||||
case RIGHT:
|
||||
glBegin(GL_LINES);
|
||||
glVertex2s(offset, 0);
|
||||
@@ -1621,7 +1621,7 @@ static void drawArrow(ArrowDirection d, short offset, short length, short size)
|
||||
offset = -offset;
|
||||
length = -length;
|
||||
size = -size;
|
||||
/* fall-through */
|
||||
ATTR_FALLTHROUGH;
|
||||
case UP:
|
||||
glBegin(GL_LINES);
|
||||
glVertex2s(0, offset);
|
||||
@@ -1640,7 +1640,7 @@ static void drawArrowHead(ArrowDirection d, short size)
|
||||
switch (d) {
|
||||
case LEFT:
|
||||
size = -size;
|
||||
/* fall-through */
|
||||
ATTR_FALLTHROUGH;
|
||||
case RIGHT:
|
||||
glBegin(GL_LINES);
|
||||
glVertex2s(0, 0);
|
||||
@@ -1652,7 +1652,7 @@ static void drawArrowHead(ArrowDirection d, short size)
|
||||
|
||||
case DOWN:
|
||||
size = -size;
|
||||
/* fall-through */
|
||||
ATTR_FALLTHROUGH;
|
||||
case UP:
|
||||
glBegin(GL_LINES);
|
||||
glVertex2s(0, 0);
|
||||
|
||||
@@ -619,7 +619,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:
|
||||
{
|
||||
@@ -630,7 +630,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:
|
||||
{
|
||||
|
||||
@@ -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));
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -2116,6 +2116,7 @@ static int stitch_modal(bContext *C, wmOperator *op, const wmEvent *event)
|
||||
}
|
||||
break;
|
||||
}
|
||||
ATTR_FALLTHROUGH;
|
||||
case PADENTER:
|
||||
case RETKEY:
|
||||
if (event->val == KM_PRESS) {
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
* \ingroup gpu
|
||||
*/
|
||||
|
||||
#include "BLI_compiler_attrs.h"
|
||||
#include "BLI_utildefines.h"
|
||||
#include "BLI_sys_types.h"
|
||||
#include "BLI_system.h"
|
||||
@@ -219,7 +220,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 */
|
||||
@@ -249,7 +250,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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -276,9 +276,11 @@ static float metadensity(Object *ob, const float co[3])
|
||||
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 */
|
||||
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 */
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -335,7 +335,7 @@ PyObject *PyObjectPlus::py_get_attrdef(PyObject *self_py, const PyAttributeDef *
|
||||
Py_DECREF(resultlist);
|
||||
return NULL;
|
||||
}
|
||||
// walkthrough
|
||||
ATTR_FALLTHROUGH;
|
||||
case KX_PYATTRIBUTE_TYPE_INT:
|
||||
{
|
||||
int *val = reinterpret_cast<int*>(ptr);
|
||||
@@ -406,7 +406,7 @@ PyObject *PyObjectPlus::py_get_attrdef(PyObject *self_py, const PyAttributeDef *
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
// walkthrough
|
||||
ATTR_FALLTHROUGH;
|
||||
case KX_PYATTRIBUTE_TYPE_INT:
|
||||
{
|
||||
int *val = reinterpret_cast<int*>(ptr);
|
||||
@@ -638,7 +638,7 @@ int PyObjectPlus::py_set_attrdef(PyObject *self_py, PyObject *value, const PyAtt
|
||||
PyErr_Format(PyExc_AttributeError, "Size check error for attribute, \"%s\", report to blender.org", attrdef->m_name);
|
||||
goto UNDO_AND_ERROR;
|
||||
}
|
||||
// walkthrough
|
||||
ATTR_FALLTHROUGH;
|
||||
case KX_PYATTRIBUTE_TYPE_INT:
|
||||
{
|
||||
int *var = reinterpret_cast<int*>(ptr);
|
||||
@@ -883,7 +883,7 @@ int PyObjectPlus::py_set_attrdef(PyObject *self_py, PyObject *value, const PyAtt
|
||||
PyErr_Format(PyExc_AttributeError, "attribute size check error for attribute \"%s\", report to blender.org", attrdef->m_name);
|
||||
goto FREE_AND_ERROR;
|
||||
}
|
||||
// walkthrough
|
||||
ATTR_FALLTHROUGH;
|
||||
case KX_PYATTRIBUTE_TYPE_INT:
|
||||
{
|
||||
int *var = reinterpret_cast<int*>(ptr);
|
||||
|
||||
@@ -133,7 +133,7 @@ bool SCA_PropertySensor::CheckPropertyCondition()
|
||||
{
|
||||
case KX_PROPSENSOR_NOTEQUAL:
|
||||
reverse = true;
|
||||
/* fall-through */
|
||||
ATTR_FALLTHROUGH;
|
||||
case KX_PROPSENSOR_EQUAL:
|
||||
{
|
||||
CValue* orgprop = GetParent()->FindIdentifier(m_checkpropname);
|
||||
@@ -231,7 +231,7 @@ bool SCA_PropertySensor::CheckPropertyCondition()
|
||||
}
|
||||
case KX_PROPSENSOR_LESSTHAN:
|
||||
reverse = true;
|
||||
/* fall-through */
|
||||
ATTR_FALLTHROUGH;
|
||||
case KX_PROPSENSOR_GREATERTHAN:
|
||||
{
|
||||
CValue* orgprop = GetParent()->FindIdentifier(m_checkpropname);
|
||||
|
||||
@@ -345,6 +345,7 @@ static MT_Point3 nearestPointToObstacle(MT_Point3& pos ,KX_Obstacle* obstacle)
|
||||
MT_Point3 res = obstacle->m_pos + abdir*proj;
|
||||
return res;
|
||||
}
|
||||
ATTR_FALLTHROUGH;
|
||||
}
|
||||
case KX_OBSTACLE_CIRCLE :
|
||||
default:
|
||||
|
||||
@@ -108,7 +108,7 @@ void KX_SoundActuator::play()
|
||||
case KX_SOUNDACT_LOOPBIDIRECTIONAL:
|
||||
case KX_SOUNDACT_LOOPBIDIRECTIONAL_STOP:
|
||||
sound = AUD_Sound_pingpong(sound);
|
||||
// fall through
|
||||
ATTR_FALLTHROUGH;
|
||||
case KX_SOUNDACT_LOOPEND:
|
||||
case KX_SOUNDACT_LOOPSTOP:
|
||||
loop = true;
|
||||
|
||||
Reference in New Issue
Block a user