[libxslt] Clean up attributes in source doc



commit 452fb4ca9b9803448826008b9573987c615912a1
Author: Nick Wellnhofer <wellnhofer aevum de>
Date:   Wed Aug 31 21:37:44 2022 +0200

    Clean up attributes in source doc
    
    Also make bit flag constants unsigned to avoid implicit-conversion
    warnings.

 libxslt/transform.c | 10 ++++++++++
 libxslt/xsltutils.h |  6 +++---
 2 files changed, 13 insertions(+), 3 deletions(-)
---
diff --git a/libxslt/transform.c b/libxslt/transform.c
index 7489504f..38a70c62 100644
--- a/libxslt/transform.c
+++ b/libxslt/transform.c
@@ -5763,6 +5763,16 @@ xsltCleanupSourceDoc(xmlDocPtr doc) {
         if (psviPtr)
             *psviPtr = NULL;
 
+        if (cur->type == XML_ELEMENT_NODE) {
+            xmlAttrPtr prop = cur->properties;
+
+            while (prop) {
+                prop->atype &= ~(XSLT_SOURCE_NODE_MASK << 27);
+                prop->psvi = NULL;
+                prop = prop->next;
+            }
+        }
+
         if (cur->children != NULL && cur->type != XML_ENTITY_REF_NODE) {
             cur = cur->children;
         } else {
diff --git a/libxslt/xsltutils.h b/libxslt/xsltutils.h
index d858b04e..484032e7 100644
--- a/libxslt/xsltutils.h
+++ b/libxslt/xsltutils.h
@@ -245,9 +245,9 @@ XSLTPUBFUN xmlXPathCompExprPtr XSLTCALL
                                                 int flags);
 
 #ifdef IN_LIBXSLT
-#define XSLT_SOURCE_NODE_MASK       15
-#define XSLT_SOURCE_NODE_HAS_KEY    1
-#define XSLT_SOURCE_NODE_HAS_ID     2
+#define XSLT_SOURCE_NODE_MASK       15u
+#define XSLT_SOURCE_NODE_HAS_KEY    1u
+#define XSLT_SOURCE_NODE_HAS_ID     2u
 int
 xsltGetSourceNodeFlags(xmlNodePtr node);
 int


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