]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
build: silence coverity false positives
authorEric Blake <eblake@redhat.com>
Mon, 6 Jun 2011 19:23:24 +0000 (13:23 -0600)
committerEric Blake <eblake@redhat.com>
Wed, 8 Jun 2011 11:30:56 +0000 (05:30 -0600)
Coverity complained about these intentional fallthrough cases, but
not about other cases that were explicitly marked with nice comments.

For some reason, Coverity doesn't seem smart enough to parse the
up-front English comment in virsh about intentional fallthrough :)

* tools/virsh.c (cmdVolSize): Mark fallthrough in a more typical
fashion.
* src/conf/nwfilter_conf.c (virNWFilterRuleDefDetailsFormat)
(virNWFilterRuleDetailsParse): Mark explicit fallthrough.

src/conf/nwfilter_conf.c
tools/virsh.c

index 40516c7619ab42d9e912af3e3e60444047342bbe..127d4be54fa3eafbb66ea00e812a8629bb53e35a 100644 (file)
@@ -1490,6 +1490,7 @@ virNWFilterRuleDetailsParse(xmlNodePtr node,
                     switch (datatype) {
                         case DATATYPE_UINT8_HEX:
                             base = 16;
+                            /* fallthrough */
                         case DATATYPE_UINT8:
                             if (virStrToLong_ui(prop, NULL, base, &uint_val) >= 0) {
                                 if (uint_val <= 0xff) {
@@ -1504,6 +1505,7 @@ virNWFilterRuleDetailsParse(xmlNodePtr node,
 
                         case DATATYPE_UINT16_HEX:
                             base = 16;
+                            /* fallthrough */
                         case DATATYPE_UINT16:
                             if (virStrToLong_ui(prop, NULL, base, &uint_val) >= 0) {
                                 if (uint_val <= 0xffff) {
@@ -2728,6 +2730,7 @@ virNWFilterRuleDefDetailsFormat(virBufferPtr buf,
 
                case DATATYPE_UINT8_HEX:
                    asHex = true;
+                   /* fallthrough */
                case DATATYPE_IPMASK:
                case DATATYPE_IPV6MASK:
                    /* display all masks in CIDR format */
@@ -2738,6 +2741,7 @@ virNWFilterRuleDefDetailsFormat(virBufferPtr buf,
 
                case DATATYPE_UINT16_HEX:
                    asHex = true;
+                   /* fallthrough */
                case DATATYPE_UINT16:
                    virBufferAsprintf(buf, asHex ? "0x%x" : "%d",
                                      item->u.u16);
index ab83ba9813d9873698c620ef2ed185129405f814..123781f275812e4ced8bb1bb7dd7387af3f8957f 100644 (file)
@@ -7071,10 +7071,13 @@ static int cmdVolSize(const char *data, unsigned long long *val)
         switch (*end) {
         case 'T':
             *val *= 1024;
+            /* fallthrough */
         case 'G':
             *val *= 1024;
+            /* fallthrough */
         case 'M':
             *val *= 1024;
+            /* fallthrough */
         case 'k':
             *val *= 1024;
             break;