[libxml2] Remove internal macros from parserInternals.h



commit 48f84ea8ed3bcd9c096accfdc1e8c2d588a557a4
Author: Nick Wellnhofer <wellnhofer aevum de>
Date:   Thu Aug 25 21:31:08 2022 +0200

    Remove internal macros from parserInternals.h
    
    Replace MOVETO_ENDTAG with code that updates line and column numbers.

 include/libxml/parserInternals.h | 28 ----------------------------
 parser.c                         | 18 ++++++++++++++----
 2 files changed, 14 insertions(+), 32 deletions(-)
---
diff --git a/include/libxml/parserInternals.h b/include/libxml/parserInternals.h
index d09a94f9..191ec784 100644
--- a/include/libxml/parserInternals.h
+++ b/include/libxml/parserInternals.h
@@ -278,34 +278,6 @@ XMLPUBVAR unsigned int xmlParserMaxDepth;
  */
 #define IS_PUBIDCHAR_CH(c) xmlIsPubidChar_ch(c)
 
-/**
- * SKIP_EOL:
- * @p:  and UTF8 string pointer
- *
- * Skips the end of line chars.
- */
-#define SKIP_EOL(p)                                                    \
-    if (*(p) == 0x13) { p++ ; if (*(p) == 0x10) p++; }                 \
-    if (*(p) == 0x10) { p++ ; if (*(p) == 0x13) p++; }
-
-/**
- * MOVETO_ENDTAG:
- * @p:  and UTF8 string pointer
- *
- * Skips to the next '>' char.
- */
-#define MOVETO_ENDTAG(p)                                               \
-    while ((*p) && (*(p) != '>')) (p)++
-
-/**
- * MOVETO_STARTTAG:
- * @p:  and UTF8 string pointer
- *
- * Skips to the next '<' char.
- */
-#define MOVETO_STARTTAG(p)                                             \
-    while ((*p) && (*(p) != '<')) (p)++
-
 /**
  * Global variables used for predefined strings.
  */
diff --git a/parser.c b/parser.c
index 457136b9..626d759e 100644
--- a/parser.c
+++ b/parser.c
@@ -7018,9 +7018,14 @@ xmlParseTextDecl(xmlParserCtxtPtr ctxt) {
        xmlFatalErr(ctxt, XML_ERR_XMLDECL_NOT_FINISHED, NULL);
        NEXT;
     } else {
+        int c;
+
        xmlFatalErr(ctxt, XML_ERR_XMLDECL_NOT_FINISHED, NULL);
-       MOVETO_ENDTAG(CUR_PTR);
-       NEXT;
+        while ((c = CUR) != 0) {
+            NEXT;
+            if (c == '>')
+                break;
+        }
     }
 
     ctxt->instate = oldstate;
@@ -10723,9 +10728,14 @@ xmlParseXMLDecl(xmlParserCtxtPtr ctxt) {
        xmlFatalErr(ctxt, XML_ERR_XMLDECL_NOT_FINISHED, NULL);
        NEXT;
     } else {
+        int c;
+
        xmlFatalErr(ctxt, XML_ERR_XMLDECL_NOT_FINISHED, NULL);
-       MOVETO_ENDTAG(CUR_PTR);
-       NEXT;
+        while ((c = CUR) != 0) {
+            NEXT;
+            if (c == '>')
+                break;
+        }
     }
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]