Add 'fall through' comments to case statements without break
authorStefan Weil <sw@weilnetz.de>
Mon, 9 Jan 2012 17:29:51 +0000 (18:29 +0100)
committerStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Fri, 13 Jan 2012 10:36:59 +0000 (10:36 +0000)
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>
hw/pcnet.c
json-lexer.c
qemu-option.c

index cba253ba7b80e21057ceaaab42ac5a71779794d1..306dc6ed7ebc61e5f42bffea70262629c5363e08 100644 (file)
@@ -1505,6 +1505,7 @@ static void pcnet_bcr_writew(PCNetState *s, uint32_t rap, uint32_t val)
 #ifdef PCNET_DEBUG
        printf("BCR_SWS=0x%04x\n", val);
 #endif
+        /* fall through */
     case BCR_LNKST:
     case BCR_LED1:
     case BCR_LED2:
index c21338f66db75814e504ca86bf29c7b7487c3903..3cd3285825d1f8433da982eba6059169bd6776c3 100644 (file)
@@ -301,6 +301,7 @@ static int json_lexer_feed_char(JSONLexer *lexer, char ch, bool flush)
         case JSON_KEYWORD:
         case JSON_STRING:
             lexer->emit(lexer, lexer->token, new_state, lexer->x, lexer->y);
+            /* fall through */
         case JSON_SKIP:
             QDECREF(lexer->token);
             lexer->token = qstring_new();
index 6b23c3123526ecec1acc8724819f3e59af3fd188..a303f87e1cc8ef481dd8a9f01b92a8e15d0e51af 100644 (file)
@@ -214,13 +214,17 @@ static int parse_option_size(const char *name, const char *value, uint64_t *ret)
         switch (*postfix) {
         case 'T':
             sizef *= 1024;
+            /* fall through */
         case 'G':
             sizef *= 1024;
+            /* fall through */
         case 'M':
             sizef *= 1024;
+            /* fall through */
         case 'K':
         case 'k':
             sizef *= 1024;
+            /* fall through */
         case 'b':
         case '\0':
             *ret = (uint64_t) sizef;