summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJ. Peter Mugaas <jpmugaas@suddenlink.net>2017-10-21 13:49:31 +0200
committerNick Wellnhofer <wellnhofer@aevum.de>2017-10-21 13:49:31 +0200
commitd2c329a9a4b630de1f32d359fcc983a6cc285649 (patch)
treeb170634cd9f59f7395cec6a3beec1ad7fe20402e
parentbec3c17fae1610c6e39f982a35b391d9f1c84943 (diff)
downloadlibxml2-d2c329a9a4b630de1f32d359fcc983a6cc285649.tar.gz
Fix -Wimplicit-fallthrough warnings
Add "falls through" comments to quench implicit-fallthrough warnings which are enabled by -Wextra under GCC 7.
-rw-r--r--catalog.c1
-rw-r--r--dict.c29
-rw-r--r--nanoftp.c4
-rw-r--r--relaxng.c4
-rw-r--r--tree.c6
-rw-r--r--valid.c1
-rw-r--r--xmlregexp.c5
-rw-r--r--xmlschemas.c1
-rw-r--r--xmlschemastypes.c2
-rw-r--r--xmlwriter.c1
-rw-r--r--xpath.c2
11 files changed, 49 insertions, 7 deletions
diff --git a/catalog.c b/catalog.c
index 6dfdfbb8..f6186a1c 100644
--- a/catalog.c
+++ b/catalog.c
@@ -2396,6 +2396,7 @@ xmlParseSGMLCatalog(xmlCatalogPtr catal, const xmlChar *value,
case SGML_CATA_ENTITY:
if (*cur == '%')
type = SGML_CATA_PENTITY;
+ /* Falls through. */
case SGML_CATA_PENTITY:
case SGML_CATA_DOCTYPE:
case SGML_CATA_LINKTYPE:
diff --git a/dict.c b/dict.c
index 55902174..0ef3718d 100644
--- a/dict.c
+++ b/dict.c
@@ -453,14 +453,23 @@ xmlDictComputeFastKey(const xmlChar *name, int namelen, int seed) {
}
switch (namelen) {
case 10: value += name[9];
+ /* Falls through. */
case 9: value += name[8];
+ /* Falls through. */
case 8: value += name[7];
+ /* Falls through. */
case 7: value += name[6];
+ /* Falls through. */
case 6: value += name[5];
+ /* Falls through. */
case 5: value += name[4];
+ /* Falls through. */
case 4: value += name[3];
+ /* Falls through. */
case 3: value += name[2];
+ /* Falls through. */
case 2: value += name[1];
+ /* Falls through. */
default: break;
}
return(value);
@@ -496,15 +505,25 @@ xmlDictComputeFastQKey(const xmlChar *prefix, int plen,
}
switch (plen) {
case 10: value += prefix[9];
+ /* Falls through. */
case 9: value += prefix[8];
+ /* Falls through. */
case 8: value += prefix[7];
+ /* Falls through. */
case 7: value += prefix[6];
+ /* Falls through. */
case 6: value += prefix[5];
+ /* Falls through. */
case 5: value += prefix[4];
+ /* Falls through. */
case 4: value += prefix[3];
+ /* Falls through. */
case 3: value += prefix[2];
+ /* Falls through. */
case 2: value += prefix[1];
+ /* Falls through. */
case 1: value += prefix[0];
+ /* Falls through. */
default: break;
}
len -= plen;
@@ -514,15 +533,25 @@ xmlDictComputeFastQKey(const xmlChar *prefix, int plen,
}
switch (len) {
case 10: value += name[9];
+ /* Falls through. */
case 9: value += name[8];
+ /* Falls through. */
case 8: value += name[7];
+ /* Falls through. */
case 7: value += name[6];
+ /* Falls through. */
case 6: value += name[5];
+ /* Falls through. */
case 5: value += name[4];
+ /* Falls through. */
case 4: value += name[3];
+ /* Falls through. */
case 3: value += name[2];
+ /* Falls through. */
case 2: value += name[1];
+ /* Falls through. */
case 1: value += name[0];
+ /* Falls through. */
default: break;
}
return(value);
diff --git a/nanoftp.c b/nanoftp.c
index 16248813..44584971 100644
--- a/nanoftp.c
+++ b/nanoftp.c
@@ -1036,6 +1036,7 @@ xmlNanoFTPConnect(void *ctx) {
case 2:
if (proxyPasswd == NULL)
break;
+ /* Falls through. */
case 3:
if (proxyPasswd != NULL)
snprintf(buf, sizeof(buf), "PASS %s\r\n", proxyPasswd);
@@ -1105,6 +1106,7 @@ xmlNanoFTPConnect(void *ctx) {
ctxt->controlFd = INVALID_SOCKET;
return(-1);
}
+ /* Falls through. */
case 2:
/* USER user@host command */
if (ctxt->user == NULL)
@@ -1158,6 +1160,7 @@ xmlNanoFTPConnect(void *ctx) {
ctxt->controlFd = INVALID_SOCKET;
return(-1);
}
+ /* Falls through. */
case 3:
/*
* If you need support for other Proxy authentication scheme
@@ -1206,6 +1209,7 @@ xmlNanoFTPConnect(void *ctx) {
case 3:
__xmlIOErr(XML_FROM_FTP, XML_FTP_ACCNT,
"FTP server asking for ACCNT on anonymous\n");
+ /* Falls through. */
case 1:
case 4:
case 5:
diff --git a/relaxng.c b/relaxng.c
index be731949..b12e1ae3 100644
--- a/relaxng.c
+++ b/relaxng.c
@@ -8891,7 +8891,7 @@ xmlRelaxNGValidateValue(xmlRelaxNGValidCtxtPtr ctxt,
if (ret != 0) {
break;
}
- /* no break on purpose */
+ /* Falls through. */
case XML_RELAXNG_ZEROORMORE:{
xmlChar *cur, *temp;
@@ -10168,7 +10168,7 @@ xmlRelaxNGValidateState(xmlRelaxNGValidCtxtPtr ctxt,
}
if (ctxt->errNr > errNr)
xmlRelaxNGPopErrors(ctxt, errNr);
- /* no break on purpose */
+ /* Falls through. */
case XML_RELAXNG_ZEROORMORE:{
int progress;
xmlRelaxNGStatesPtr states = NULL, res = NULL;
diff --git a/tree.c b/tree.c
index 911aa103..86a8da79 100644
--- a/tree.c
+++ b/tree.c
@@ -8259,7 +8259,7 @@ xmlDOMWrapRemoveNode(xmlDOMWrapCtxtPtr ctxt, xmlDocPtr doc,
ns = ns->next;
} while (ns != NULL);
}
- /* No break on purpose. */
+ /* Falls through. */
case XML_ATTRIBUTE_NODE:
if (node->ns != NULL) {
/*
@@ -8850,7 +8850,7 @@ next_ns_decl:
}
if (! adoptns)
goto ns_end;
- /* No break on purpose. */
+ /* Falls through. */
case XML_ATTRIBUTE_NODE:
/* No ns, no fun. */
if (cur->ns == NULL)
@@ -9131,7 +9131,7 @@ xmlDOMWrapAdoptBranch(xmlDOMWrapCtxtPtr ctxt,
goto internal_error;
}
}
- /* No break on purpose. */
+ /* Falls through. */
case XML_ATTRIBUTE_NODE:
/* No namespace, no fun. */
if (cur->ns == NULL)
diff --git a/valid.c b/valid.c
index 59a17c66..a64b96be 100644
--- a/valid.c
+++ b/valid.c
@@ -5190,6 +5190,7 @@ xmlSnprintfElements(char *buf, int size, xmlNodePtr node, int glob) {
case XML_TEXT_NODE:
if (xmlIsBlankNode(cur))
break;
+ /* Falls through. */
case XML_CDATA_SECTION_NODE:
case XML_ENTITY_REF_NODE:
strcat(buf, "CDATA");
diff --git a/xmlregexp.c b/xmlregexp.c
index b640264b..d255fbf0 100644
--- a/xmlregexp.c
+++ b/xmlregexp.c
@@ -2810,18 +2810,21 @@ xmlRegCheckCharacterRange(xmlRegAtomType type, int codepoint, int neg,
break;
case XML_REGEXP_NOTSPACE:
neg = !neg;
+ /* Falls through. */
case XML_REGEXP_ANYSPACE:
ret = ((codepoint == '\n') || (codepoint == '\r') ||
(codepoint == '\t') || (codepoint == ' '));
break;
case XML_REGEXP_NOTINITNAME:
neg = !neg;
+ /* Falls through. */
case XML_REGEXP_INITNAME:
ret = (IS_LETTER(codepoint) ||
(codepoint == '_') || (codepoint == ':'));
break;
case XML_REGEXP_NOTNAMECHAR:
neg = !neg;
+ /* Falls through. */
case XML_REGEXP_NAMECHAR:
ret = (IS_LETTER(codepoint) || IS_DIGIT(codepoint) ||
(codepoint == '.') || (codepoint == '-') ||
@@ -2830,11 +2833,13 @@ xmlRegCheckCharacterRange(xmlRegAtomType type, int codepoint, int neg,
break;
case XML_REGEXP_NOTDECIMAL:
neg = !neg;
+ /* Falls through. */
case XML_REGEXP_DECIMAL:
ret = xmlUCSIsCatNd(codepoint);
break;
case XML_REGEXP_REALCHAR:
neg = !neg;
+ /* Falls through. */
case XML_REGEXP_NOTREALCHAR:
ret = xmlUCSIsCatP(codepoint);
if (ret == 0)
diff --git a/xmlschemas.c b/xmlschemas.c
index 1938d7ea..05a12e0b 100644
--- a/xmlschemas.c
+++ b/xmlschemas.c
@@ -1742,6 +1742,7 @@ xmlSchemaFormatItemForReport(xmlChar **buf,
*buf = xmlStrcat(*buf, BAD_CAST "'");
FREE_AND_NULL(str);
}
+ /* Falls through. */
default:
named = 0;
}
diff --git a/xmlschemastypes.c b/xmlschemastypes.c
index c9674ba9..c6c93659 100644
--- a/xmlschemastypes.c
+++ b/xmlschemastypes.c
@@ -5403,7 +5403,7 @@ xmlSchemaValidateFacetInternal(xmlSchemaFacetPtr facet,
if ((valType == XML_SCHEMAS_QNAME) ||
(valType == XML_SCHEMAS_NOTATION))
return (0);
- /* No break on purpose. */
+ /* Falls through. */
case XML_SCHEMA_FACET_MAXLENGTH:
case XML_SCHEMA_FACET_MINLENGTH: {
unsigned int len = 0;
diff --git a/xmlwriter.c b/xmlwriter.c
index 69541b89..eb94e6e4 100644
--- a/xmlwriter.c
+++ b/xmlwriter.c
@@ -3754,6 +3754,7 @@ xmlTextWriterEndDTDEntity(xmlTextWriterPtr writer)
if (count < 0)
return -1;
sum += count;
+ /* Falls through. */
case XML_TEXTWRITER_DTD_ENTY:
case XML_TEXTWRITER_DTD_PENT:
count = xmlOutputBufferWriteString(writer->out, ">");
diff --git a/xpath.c b/xpath.c
index 6fdb7df7..35274731 100644
--- a/xpath.c
+++ b/xpath.c
@@ -7042,7 +7042,7 @@ xmlXPathEqualValuesCommon(xmlXPathParserContextPtr ctxt,
valuePush(ctxt, arg2);
xmlXPathNumberFunction(ctxt, 1);
arg2 = valuePop(ctxt);
- /* no break on purpose */
+ /* Falls through. */
case XPATH_NUMBER:
/* Hand check NaN and Infinity equalities */
if (xmlXPathIsNaN(arg1->floatval) ||