[libxml2] Portability to non C99 compliant compilers
- From: Daniel Veillard <veillard src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libxml2] Portability to non C99 compliant compilers
- Date: Tue, 3 May 2016 13:39:35 +0000 (UTC)
commit 90da33cebeba87ae3b49a270c8182142dd7cb48e
Author: Patrick Monnerat <pm datasphere ch>
Date: Tue May 3 21:37:52 2016 +0800
Portability to non C99 compliant compilers
OS400 C compiler is not C99 compliant.
It only supports local variable declarations at the beginning of a block.
We loose the const as a result but portability is more important.
xmlschemastypes.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/xmlschemastypes.c b/xmlschemastypes.c
index 60f5414..5f38599 100644
--- a/xmlschemastypes.c
+++ b/xmlschemastypes.c
@@ -5307,6 +5307,7 @@ xmlSchemaValidateFacetInternal(xmlSchemaFacetPtr facet,
xmlSchemaWhitespaceValueType ws)
{
int ret;
+ int stringType;
if (facet == NULL)
return(-1);
@@ -5324,8 +5325,8 @@ xmlSchemaValidateFacetInternal(xmlSchemaFacetPtr facet,
* the datatype.
* See https://www.w3.org/TR/xmlschema-2/#rf-pattern
*/
- const int stringType = val && ((val->type >= XML_SCHEMAS_STRING && val->type <=
XML_SCHEMAS_NORMSTRING)
- || (val->type >= XML_SCHEMAS_TOKEN && val->type <=
XML_SCHEMAS_NCNAME));
+ stringType = val && ((val->type >= XML_SCHEMAS_STRING && val->type <= XML_SCHEMAS_NORMSTRING)
+ || (val->type >= XML_SCHEMAS_TOKEN && val->type <= XML_SCHEMAS_NCNAME));
ret = xmlRegexpExec(facet->regexp,
(stringType && val->value.str) ? val->value.str : value);
if (ret == 1)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]