]> granicus.if.org Git - libexpat/commitdiff
Fix for bug #1065040. Improved const correctness.
authorKarl Waclawek <kwaclaw@users.sourceforge.net>
Fri, 26 Nov 2004 15:16:17 +0000 (15:16 +0000)
committerKarl Waclawek <kwaclaw@users.sourceforge.net>
Fri, 26 Nov 2004 15:16:17 +0000 (15:16 +0000)
Minor improvement of XML_GetFeatureList().

expat/lib/xmlparse.c

index 3372bc962ee13f2d4d43635ceb07401c132d5d3e..dd0e0570198e60e5ce5030d28a18a584fb87d216 100644 (file)
@@ -1836,7 +1836,7 @@ XML_DefaultCurrent(XML_Parser parser)
 const XML_LChar * XMLCALL
 XML_ErrorString(enum XML_Error code)
 {
-  static const XML_LChar *message[] = {
+  static const XML_LChar* const message[] = {
     0,
     XML_L("out of memory"),
     XML_L("syntax error"),
@@ -1916,9 +1916,11 @@ XML_ExpatVersionInfo(void)
 const XML_Feature * XMLCALL
 XML_GetFeatureList(void)
 {
-  static XML_Feature features[] = {
-    {XML_FEATURE_SIZEOF_XML_CHAR,  XML_L("sizeof(XML_Char)"), 0},
-    {XML_FEATURE_SIZEOF_XML_LCHAR, XML_L("sizeof(XML_LChar)"), 0},
+  static const XML_Feature features[] = {
+    {XML_FEATURE_SIZEOF_XML_CHAR,  XML_L("sizeof(XML_Char)"),
+     sizeof(XML_Char)},
+    {XML_FEATURE_SIZEOF_XML_LCHAR, XML_L("sizeof(XML_LChar)"),
+     sizeof(XML_LChar)},
 #ifdef XML_UNICODE
     {XML_FEATURE_UNICODE,          XML_L("XML_UNICODE"), 0},
 #endif
@@ -1938,8 +1940,6 @@ XML_GetFeatureList(void)
     {XML_FEATURE_END,              NULL, 0}
   };
 
-  features[0].value = sizeof(XML_Char);
-  features[1].value = sizeof(XML_LChar);
   return features;
 }