]> granicus.if.org Git - libexpat/commitdiff
Fix -Wimplicit-fallthrough related warnings
authorAnton Maklakov <antmak.pub@gmail.com>
Wed, 4 Jul 2018 19:42:09 +0000 (02:42 +0700)
committerAnton Maklakov <antmak.pub@gmail.com>
Fri, 6 Jul 2018 03:12:05 +0000 (10:12 +0700)
expat/lib/siphash.h
expat/lib/xmlparse.c
expat/lib/xmltok_impl.c

index 00ead6e0f1c4f3283b610f329eb6eb8ece177510..e9d33763562ef8bfb4c1cf5ec3fd1d54a3e11d53 100644 (file)
@@ -238,12 +238,19 @@ static uint64_t sip24_final(struct siphash *H) {
 
        switch (left) {
        case 7: b |= (uint64_t)H->buf[6] << 48;
+        /* fall through */
        case 6: b |= (uint64_t)H->buf[5] << 40;
+        /* fall through */
        case 5: b |= (uint64_t)H->buf[4] << 32;
+        /* fall through */
        case 4: b |= (uint64_t)H->buf[3] << 24;
+        /* fall through */
        case 3: b |= (uint64_t)H->buf[2] << 16;
+        /* fall through */
        case 2: b |= (uint64_t)H->buf[1] << 8;
+        /* fall through */
        case 1: b |= (uint64_t)H->buf[0] << 0;
+        /* fall through */
        case 0: break;
        }
 
index 0efd2bdde235e5d9cdf49da85bdf68fe3af4eb08..435ee02254fef3e51729db200023e943f8f5a353 100644 (file)
@@ -1820,6 +1820,7 @@ XML_Parse(XML_Parser parser, const char *s, int len, int isFinal)
       parser->m_errorCode = XML_ERROR_NO_MEMORY;
       return XML_STATUS_ERROR;
     }
+    /* fall through */
   default:
     parser->m_parsingStatus.parsing = XML_PARSING;
   }
@@ -1969,6 +1970,7 @@ XML_ParseBuffer(XML_Parser parser, int len, int isFinal)
       parser->m_errorCode = XML_ERROR_NO_MEMORY;
       return XML_STATUS_ERROR;
     }
+    /* fall through */
   default:
     parser->m_parsingStatus.parsing = XML_PARSING;
   }
@@ -4746,8 +4748,8 @@ doProlog(XML_Parser parser,
           return XML_ERROR_NO_MEMORY;
         parser->m_declEntity->publicId = NULL;
       }
-      /* fall through */
 #endif /* XML_DTD */
+      /* fall through */
     case XML_ROLE_ENTITY_SYSTEM_ID:
       if (dtd->keepProcessing && parser->m_declEntity) {
         parser->m_declEntity->systemId = poolStoreString(&dtd->pool, enc,
index fb49a34d7970ea3d78bf1c281c15acf57c7fb986..4d9ae7dc3896b8393f8b41eeb98becdcb3bcaa46 100644 (file)
@@ -74,6 +74,7 @@
       *nextTokPtr = ptr; \
       return XML_TOK_INVALID; \
     } \
+    /* fall through */ \
   case BT_NMSTRT: \
   case BT_HEX: \
   case BT_DIGIT: \
       *nextTokPtr = ptr; \
       return XML_TOK_INVALID; \
     } \
+    /* fall through */ \
   case BT_NMSTRT: \
   case BT_HEX: \
     ptr += MINBPC(enc); \
@@ -602,7 +604,7 @@ PREFIX(scanAtts)(const ENCODING *enc, const char *ptr, const char *end,
           return XML_TOK_INVALID;
         }
       }
-    /* fall through */
+      /* fall through */
     case BT_EQUALS:
       {
         int open;
@@ -1442,6 +1444,7 @@ PREFIX(isPublicId)(const ENCODING *enc, const char *ptr, const char *end,
     case BT_NMSTRT:
       if (!(BYTE_TO_ASCII(enc, ptr) & ~0x7f))
         break;
+      /* fall through */
     default:
       switch (BYTE_TO_ASCII(enc, ptr)) {
       case 0x24: /* $ */