mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-25 23:46:04 +08:00
[build] fix some of the implicit-fallthrough warnings from GCC7
Some warnings related to the use of the Label() macro are still there. It seems that the only way would be generate the labels instead of calling the macros. See issue #2207
This commit is contained in:
@@ -233,6 +233,7 @@ void guidance_h_mode_changed(uint8_t new_mode)
|
||||
|
||||
case GUIDANCE_H_MODE_CARE_FREE:
|
||||
stabilization_attitude_reset_care_free_heading();
|
||||
/* Falls through. */
|
||||
case GUIDANCE_H_MODE_FORWARD:
|
||||
case GUIDANCE_H_MODE_ATTITUDE:
|
||||
#if NO_ATTITUDE_RESET_ON_MODE_CHANGE
|
||||
@@ -366,6 +367,7 @@ void guidance_h_run(bool in_flight)
|
||||
if (transition_percentage < (100 << INT32_PERCENTAGE_FRAC)) {
|
||||
transition_run(true);
|
||||
}
|
||||
/* Falls through. */
|
||||
case GUIDANCE_H_MODE_CARE_FREE:
|
||||
case GUIDANCE_H_MODE_ATTITUDE:
|
||||
if ((!(guidance_h.mode == GUIDANCE_H_MODE_FORWARD)) && transition_percentage > 0) {
|
||||
@@ -379,6 +381,7 @@ void guidance_h_run(bool in_flight)
|
||||
guidance_h.sp.heading = guidance_h.rc_sp.psi;
|
||||
/* fall trough to GUIDED to update ref, run traj and set final attitude setpoint */
|
||||
|
||||
/* Falls through. */
|
||||
case GUIDANCE_H_MODE_GUIDED:
|
||||
guidance_h_guided_run(in_flight);
|
||||
break;
|
||||
|
||||
@@ -240,6 +240,7 @@ void guidance_v_mode_changed(uint8_t new_mode)
|
||||
case GUIDANCE_V_MODE_RC_CLIMB:
|
||||
case GUIDANCE_V_MODE_CLIMB:
|
||||
guidance_v_zd_sp = 0;
|
||||
/* Falls through. */
|
||||
case GUIDANCE_V_MODE_NAV:
|
||||
guidance_v_z_sum_err = 0;
|
||||
GuidanceVSetRef(stateGetPositionNed_i()->z, stateGetSpeedNed_i()->z, 0);
|
||||
@@ -326,6 +327,7 @@ void guidance_v_run(bool in_flight)
|
||||
|
||||
case GUIDANCE_V_MODE_HOVER:
|
||||
guidance_v_guided_mode = GUIDANCE_V_GUIDED_MODE_ZHOLD;
|
||||
/* Falls through. */
|
||||
case GUIDANCE_V_MODE_GUIDED:
|
||||
guidance_v_guided_run(in_flight);
|
||||
break;
|
||||
|
||||
@@ -43,16 +43,16 @@ void nav_goto_block(uint8_t block_id);
|
||||
|
||||
#define InitStage() nav_init_stage();
|
||||
|
||||
#define Block(x) case x: nav_block=x;
|
||||
#define Block(x) /* Falls through. */ case x: nav_block=x;
|
||||
#define NextBlock() nav_goto_block(nav_block + 1)
|
||||
#define GotoBlock(b) nav_goto_block(b)
|
||||
|
||||
#define Stage(s) case s: nav_stage=s;
|
||||
#define Stage(s) /* Falls through. */ case s: nav_stage=s;
|
||||
#define NextStage() { nav_stage++; InitStage(); }
|
||||
#define NextStageAndBreak() { nav_stage++; InitStage(); break; }
|
||||
#define NextStageAndBreakFrom(wp) { last_wp = wp; NextStageAndBreak(); }
|
||||
|
||||
#define Label(x) label_ ## x:
|
||||
#define Label(x) /* Falls through. */ label_ ## x:
|
||||
#define Goto(x) { goto label_ ## x; }
|
||||
#define Return(x) { nav_block=last_block; if (x==1) {nav_stage=0;} else {nav_stage=last_stage;} block_time=0;}
|
||||
|
||||
|
||||
@@ -355,6 +355,7 @@ let rec print_stage = fun index_of_waypoints x ->
|
||||
lprintf "GotoBlock(%d);\n" (get_index_block (ExtXml.attrib x "block"));
|
||||
lprintf "break;\n"
|
||||
| "exit_block" ->
|
||||
lprintf "/* Falls through. */\n";
|
||||
lprintf "default:\n";
|
||||
stage ();
|
||||
lprintf "NextBlock();\n";
|
||||
|
||||
Reference in New Issue
Block a user