AP_GPS: use FALLTHROUGH define
When falling through on a case switch, allow to add an empty statement with the correct attribute to tell the compiler this behavior is intended.
This commit is contained in:
parent
7c6f9a004e
commit
8389158d76
@ -79,7 +79,7 @@ AP_GPS_ERB::read(void)
|
||||
}
|
||||
_step = 0;
|
||||
Debug("reset %u", __LINE__);
|
||||
/* no break */
|
||||
FALLTHROUGH;
|
||||
case 0:
|
||||
if(PREAMBLE1 == data)
|
||||
_step++;
|
||||
@ -238,7 +238,7 @@ reset:
|
||||
break;
|
||||
}
|
||||
state.step = 0;
|
||||
/* no break */
|
||||
FALLTHROUGH;
|
||||
case 0:
|
||||
if (PREAMBLE1 == data)
|
||||
state.step++;
|
||||
|
@ -176,6 +176,7 @@ AP_GPS_MTK::_detect(struct MTK_detect_state &state, uint8_t data)
|
||||
break;
|
||||
}
|
||||
state.step = 0;
|
||||
FALLTHROUGH;
|
||||
case 0:
|
||||
state.ck_b = state.ck_a = state.payload_counter = 0;
|
||||
if(PREAMBLE1 == data)
|
||||
|
@ -140,7 +140,7 @@ bool AP_GPS_NMEA::_decode(char c)
|
||||
switch (c) {
|
||||
case ',': // term terminators
|
||||
_parity ^= c;
|
||||
/* no break */
|
||||
FALLTHROUGH;
|
||||
case '\r':
|
||||
case '\n':
|
||||
case '*':
|
||||
|
@ -83,7 +83,7 @@ AP_GPS_SIRF::read(void)
|
||||
break;
|
||||
}
|
||||
_step = 0;
|
||||
// FALLTHROUGH
|
||||
FALLTHROUGH;
|
||||
case 0:
|
||||
if(PREAMBLE1 == data)
|
||||
_step++;
|
||||
|
@ -398,7 +398,7 @@ AP_GPS_UBLOX::read(void)
|
||||
}
|
||||
_step = 0;
|
||||
Debug("reset %u", __LINE__);
|
||||
/* no break */
|
||||
FALLTHROUGH;
|
||||
case 0:
|
||||
if(PREAMBLE1 == data)
|
||||
_step++;
|
||||
@ -1215,7 +1215,7 @@ reset:
|
||||
break;
|
||||
}
|
||||
state.step = 0;
|
||||
/* no break */
|
||||
FALLTHROUGH;
|
||||
case 0:
|
||||
if (PREAMBLE1 == data)
|
||||
state.step++;
|
||||
|
Loading…
Reference in New Issue
Block a user