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 committed 2017-08-22 23:59:13 -07:00
1 parent 7c6f9a004e
commit 8389158d76
5 files changed
+7 -6

No files matched your search

+2 -2
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++;
+1
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)
+1 -1
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 '*':
+1 -1
View File
@@ -83,7 +83,7 @@ AP_GPS_SIRF::read(void)
break;
}
_step = 0;
// FALLTHROUGH
FALLTHROUGH;
case 0:
if(PREAMBLE1 == data)
_step++;
+2 -2
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++;