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:
Lucas De Marchi 2017-08-22 10:28:10 -07:00
parent 7c6f9a004e
commit 8389158d76
5 changed files with 7 additions and 6 deletions

View File

@ -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++;

View File

@ -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)

View File

@ -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 '*':

View File

@ -83,7 +83,7 @@ AP_GPS_SIRF::read(void)
break;
}
_step = 0;
// FALLTHROUGH
FALLTHROUGH;
case 0:
if(PREAMBLE1 == data)
_step++;

View File

@ -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++;