Commit 28b24ba1 authored by Christian Persch's avatar Christian Persch

all: Fix implicit-fallthrough warnings

Use [[fallthrough]] attribute to make it clear where
fallthrough is expected.
parent 12e01453
......@@ -183,6 +183,7 @@ m4_define([compiler_flags_common],[ dnl
m4_define([compiler_flags_only_c],[ dnl
-Waggregate-return dnl
-Wimplicit dnl
-Wimplicit-fallthrough=3 dnl
-Wnested-externs dnl
-Wold-style-definition dnl
-Wstrict-prototypes dnl
......@@ -190,6 +191,7 @@ m4_define([compiler_flags_only_c],[ dnl
m4_define([compiler_flags_only_cxx],[ dnl
-Wstrict-null-sentinel dnl
-Wimplicit-fallthrough=5 dnl
-fno-rtti dnl
-fno-exceptions dnl
-fvisibility=hidden dnl
......
......@@ -353,11 +353,11 @@ process_file_utf8(int fd,
* next round this byte *will* be consumed.
*/
--sptr;
/* [[fallthrough]]; */
[[fallthrough]];
case vte::base::UTF8Decoder::REJECT:
decoder.reset();
/* Fall through to insert the U+FFFD replacement character. */
/* [[fallthrough]]; */
[[fallthrough]];
case vte::base::UTF8Decoder::ACCEPT: {
auto ret = vte_parser_feed(&parser, decoder.codepoint());
if (G_UNLIKELY(ret < 0)) {
......
......@@ -936,7 +936,8 @@ static int parser_feed_to_state(struct vte_parser *parser, uint32_t raw)
/* Do the deferred clear and fallthrough to STATE_ESC */
parser_transition(parser, 0x1b /* ESC */, STATE_ESC,
ACTION_CLEAR_INT);
/* fallthrough */
[[fallthrough]];
case STATE_ESC:
switch (raw) {
case 0x00 ... 0x1a: /* C0 \ { ESC } */
......
......@@ -64,12 +64,12 @@ decode(uint8_t const* in,
* next round this byte *will* be consumed.
*/
--iptr;
// [[fallthrough]]; */
[[fallthrough]];
case vte::base::UTF8Decoder::REJECT:
decoder.reset();
state = UTF8Decoder::ACCEPT;
/* Fall through to insert the U+FFFD replacement character. */
/* [[fallthrough]]; */
[[fallthrough]];
case vte::base::UTF8Decoder::ACCEPT:
out.push_back(decoder.codepoint());
break;
......
......@@ -3595,11 +3595,11 @@ Terminal::process_incoming()
* next round this byte *will* be consumed.
*/
--ip;
/* [[fallthrough]]; */
[[fallthrough]];
case vte::base::UTF8Decoder::REJECT:
m_utf8_decoder.reset();
/* Fall through to insert the U+FFFD replacement character. */
/* [[fallthrough]]; */
[[fallthrough]];
case vte::base::UTF8Decoder::ACCEPT: {
auto rv = m_parser.feed(m_utf8_decoder.codepoint());
if (G_UNLIKELY(rv < 0)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment