[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH v3 05/78] qobject/json: add fallthrough pseudo-keyword
From: |
Emmanouil Pitsidianakis |
Subject: |
[RFC PATCH v3 05/78] qobject/json: add fallthrough pseudo-keyword |
Date: |
Fri, 13 Oct 2023 11:45:33 +0300 |
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
qobject/json-lexer.c | 4 ++--
qobject/json-parser.c | 5 +++--
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/qobject/json-lexer.c b/qobject/json-lexer.c
index 51341d96e4..ab74470ac6 100644
--- a/qobject/json-lexer.c
+++ b/qobject/json-lexer.c
@@ -312,7 +312,7 @@ static void json_lexer_feed_char(JSONLexer *lexer, char ch,
bool flush)
case JSON_STRING:
json_message_process_token(lexer, lexer->token, new_state,
lexer->x, lexer->y);
- /* fall through */
+ fallthrough;
case IN_START:
g_string_truncate(lexer->token, 0);
new_state = lexer->start_state;
@@ -321,7 +321,7 @@ static void json_lexer_feed_char(JSONLexer *lexer, char ch,
bool flush)
json_message_process_token(lexer, lexer->token, JSON_ERROR,
lexer->x, lexer->y);
new_state = IN_RECOVERY;
- /* fall through */
+ fallthrough;
case IN_RECOVERY:
g_string_truncate(lexer->token, 0);
break;
diff --git a/qobject/json-parser.c b/qobject/json-parser.c
index d498db6e70..4dc622dcc9 100644
--- a/qobject/json-parser.c
+++ b/qobject/json-parser.c
@@ -214,7 +214,7 @@ static QString *parse_string(JSONParserContext *ctxt,
JSONToken *token)
}
ptr++;
}
- /* fall through */
+ fallthrough;
default:
cp = mod_utf8_codepoint(ptr, 6, &end);
if (cp < 0) {
@@ -518,8 +518,9 @@ static QObject *parse_literal(JSONParserContext *ctxt)
}
assert(ret == -ERANGE);
}
+ /* fall through to JSON_FLOAT */
+ fallthrough;
}
- /* fall through to JSON_FLOAT */
case JSON_FLOAT:
/* FIXME dependent on locale; a pervasive issue in QEMU */
/* FIXME our lexer matches RFC 8259 in forbidding Inf or NaN,
--
2.39.2
- [RFC PATCH v3 03/78] fpu/softfloat: add fallthrough pseudo-keyword, (continued)
- [RFC PATCH v3 03/78] fpu/softfloat: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH v3 04/78] qapi/opts-visitor: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH v3 01/78] include/qemu/compiler.h: replace QEMU_FALLTHROUGH with fallthrough, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH v3 07/78] hw/virtio/virtio-balloon.c: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH v3 08/78] hw/block: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH v3 02/78] block: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH v3 05/78] qobject/json: add fallthrough pseudo-keyword,
Emmanouil Pitsidianakis <=
- [RFC PATCH v3 06/78] tcg: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH v3 10/78] hw/ide/atapi.c: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH v3 11/78] hw/timer: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH v3 12/78] hw/usb: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH v3 13/78] hw/adc: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH v3 09/78] hw/acpi/aml-build.c: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH v3 16/78] audio: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH v3 17/78] ui/sdl2.c: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH v3 20/78] target/mips: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13