Add 'fall through' comments to case statements without break

These comments are used by static code analysis tools and in code reviews
to avoid false warnings because of missing break statements.

The case statements handled here were reported by coverity.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
This commit is contained in:
Stefan Weil 2012-01-09 18:29:51 +01:00 committed by Stefan Hajnoczi
parent 3c8359d11a
commit 0b0404bf84
3 changed files with 6 additions and 0 deletions

View File

@ -1505,6 +1505,7 @@ static void pcnet_bcr_writew(PCNetState *s, uint32_t rap, uint32_t val)
#ifdef PCNET_DEBUG #ifdef PCNET_DEBUG
printf("BCR_SWS=0x%04x\n", val); printf("BCR_SWS=0x%04x\n", val);
#endif #endif
/* fall through */
case BCR_LNKST: case BCR_LNKST:
case BCR_LED1: case BCR_LED1:
case BCR_LED2: case BCR_LED2:

View File

@ -301,6 +301,7 @@ static int json_lexer_feed_char(JSONLexer *lexer, char ch, bool flush)
case JSON_KEYWORD: case JSON_KEYWORD:
case JSON_STRING: case JSON_STRING:
lexer->emit(lexer, lexer->token, new_state, lexer->x, lexer->y); lexer->emit(lexer, lexer->token, new_state, lexer->x, lexer->y);
/* fall through */
case JSON_SKIP: case JSON_SKIP:
QDECREF(lexer->token); QDECREF(lexer->token);
lexer->token = qstring_new(); lexer->token = qstring_new();

View File

@ -214,13 +214,17 @@ static int parse_option_size(const char *name, const char *value, uint64_t *ret)
switch (*postfix) { switch (*postfix) {
case 'T': case 'T':
sizef *= 1024; sizef *= 1024;
/* fall through */
case 'G': case 'G':
sizef *= 1024; sizef *= 1024;
/* fall through */
case 'M': case 'M':
sizef *= 1024; sizef *= 1024;
/* fall through */
case 'K': case 'K':
case 'k': case 'k':
sizef *= 1024; sizef *= 1024;
/* fall through */
case 'b': case 'b':
case '\0': case '\0':
*ret = (uint64_t) sizef; *ret = (uint64_t) sizef;