rolled back to 2.9.2 because 2.9.4 doesn't work with XML validator
[platform/upstream/libxml2.git] / xmlreader.c
index f285790..f19e123 100644 (file)
@@ -142,7 +142,7 @@ struct _xmlTextReader {
     xmlNodePtr                 faketext;/* fake xmlNs chld */
     int                                preserve;/* preserve the resulting document */
     xmlBufPtr                  buffer; /* used to return const xmlChar * */
-    xmlDictPtr                 dict;   /* the context dictionary */
+    xmlDictPtr                 dict;   /* the context dictionnary */
 
     /* entity stack when traversing entities content */
     xmlNodePtr         ent;          /* Current Entity Ref Node */
@@ -210,7 +210,7 @@ static int xmlTextReaderNextTree(xmlTextReaderPtr reader);
  * DICT_FREE:
  * @str:  a string
  *
- * Free a string if it is not owned by the "dict" dictionary in the
+ * Free a string if it is not owned by the "dict" dictionnary in the
  * current scope
  */
 #define DICT_FREE(str)                                         \
@@ -2091,9 +2091,6 @@ xmlNewTextReader(xmlParserInputBufferPtr input, const char *URI) {
                "xmlNewTextReader : malloc failed\n");
        return(NULL);
     }
-    /* no operation on a reader should require a huge buffer */
-    xmlBufSetAllocationScheme(ret->buffer,
-                             XML_BUFFER_ALLOC_BOUNDED);
     ret->sax = (xmlSAXHandler *) xmlMalloc(sizeof(xmlSAXHandler));
     if (ret->sax == NULL) {
        xmlBufFree(ret->buffer);
@@ -2158,7 +2155,7 @@ xmlNewTextReader(xmlParserInputBufferPtr input, const char *URI) {
     ret->ctxt->dictNames = 1;
     ret->allocs = XML_TEXTREADER_CTXT;
     /*
-     * use the parser dictionary to allocate all elements and attributes names
+     * use the parser dictionnary to allocate all elements and attributes names
      */
     ret->ctxt->docdict = 1;
     ret->dict = ret->ctxt->dict;
@@ -3619,7 +3616,6 @@ xmlTextReaderConstValue(xmlTextReaderPtr reader) {
            return(((xmlNsPtr) node)->href);
         case XML_ATTRIBUTE_NODE:{
            xmlAttrPtr attr = (xmlAttrPtr) node;
-           const xmlChar *ret;
 
            if ((attr->children != NULL) &&
                (attr->children->type == XML_TEXT_NODE) &&
@@ -3633,21 +3629,10 @@ xmlTextReaderConstValue(xmlTextReaderPtr reader) {
                                         "xmlTextReaderSetup : malloc failed\n");
                         return (NULL);
                     }
-                   xmlBufSetAllocationScheme(reader->buffer,
-                                             XML_BUFFER_ALLOC_BOUNDED);
                 } else
                     xmlBufEmpty(reader->buffer);
                xmlBufGetNodeContent(reader->buffer, node);
-               ret = xmlBufContent(reader->buffer);
-               if (ret == NULL) {
-                   /* error on the buffer best to reallocate */
-                   xmlBufFree(reader->buffer);
-                   reader->buffer = xmlBufCreateSize(100);
-                   xmlBufSetAllocationScheme(reader->buffer,
-                                             XML_BUFFER_ALLOC_BOUNDED);
-                   ret = BAD_CAST "";
-               }
-               return(ret);
+               return(xmlBufContent(reader->buffer));
            }
            break;
        }
@@ -4050,19 +4035,13 @@ xmlTextReaderCurrentDoc(xmlTextReaderPtr reader) {
 }
 
 #ifdef LIBXML_SCHEMAS_ENABLED
-static char *xmlTextReaderBuildMessage(const char *msg, va_list ap) LIBXML_ATTR_FORMAT(1,0);
-
-static void XMLCDECL
-xmlTextReaderValidityError(void *ctxt, const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
+static char *xmlTextReaderBuildMessage(const char *msg, va_list ap);
 
 static void XMLCDECL
-xmlTextReaderValidityWarning(void *ctxt, const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
+xmlTextReaderValidityError(void *ctxt, const char *msg, ...);
 
 static void XMLCDECL
-xmlTextReaderValidityErrorRelay(void *ctx, const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
-
-static void XMLCDECL
-xmlTextReaderValidityWarningRelay(void *ctx, const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
+xmlTextReaderValidityWarning(void *ctxt, const char *msg, ...);
 
 static void XMLCDECL
 xmlTextReaderValidityErrorRelay(void *ctx, const char *msg, ...)
@@ -4856,7 +4835,7 @@ xmlTextReaderStructuredError(void *ctxt, xmlErrorPtr error)
     }
 }
 
-static void XMLCDECL LIBXML_ATTR_FORMAT(2,3)
+static void XMLCDECL
 xmlTextReaderError(void *ctxt, const char *msg, ...)
 {
     va_list ap;
@@ -4869,7 +4848,7 @@ xmlTextReaderError(void *ctxt, const char *msg, ...)
 
 }
 
-static void XMLCDECL LIBXML_ATTR_FORMAT(2,3)
+static void XMLCDECL
 xmlTextReaderWarning(void *ctxt, const char *msg, ...)
 {
     va_list ap;
@@ -5152,9 +5131,6 @@ xmlTextReaderSetup(xmlTextReaderPtr reader,
                         "xmlTextReaderSetup : malloc failed\n");
         return (-1);
     }
-    /* no operation on a reader should require a huge buffer */
-    xmlBufSetAllocationScheme(reader->buffer,
-                             XML_BUFFER_ALLOC_BOUNDED);
     if (reader->sax == NULL)
        reader->sax = (xmlSAXHandler *) xmlMalloc(sizeof(xmlSAXHandler));
     if (reader->sax == NULL) {
@@ -5255,7 +5231,7 @@ xmlTextReaderSetup(xmlTextReaderPtr reader,
     reader->ctxt->linenumbers = 1;
     reader->ctxt->dictNames = 1;
     /*
-     * use the parser dictionary to allocate all elements and attributes names
+     * use the parser dictionnary to allocate all elements and attributes names
      */
     reader->ctxt->docdict = 1;
     reader->ctxt->parseMode = XML_PARSE_READER;