[libxslt] Use actual types for templates in struct _xsltStylesheet



commit 669407a87ba31a68a5c24d60403e24508f61fbeb
Author: Nick Wellnhofer <wellnhofer aevum de>
Date:   Tue Jul 6 16:27:12 2021 +0200

    Use actual types for templates in struct _xsltStylesheet
    
    Improves type safety.

 libxslt/pattern.c       |  5 ++---
 libxslt/xsltInternals.h | 23 ++++++++++++-----------
 2 files changed, 14 insertions(+), 14 deletions(-)
---
diff --git a/libxslt/pattern.c b/libxslt/pattern.c
index c6496732..9ed750c4 100644
--- a/libxslt/pattern.c
+++ b/libxslt/pattern.c
@@ -2127,7 +2127,7 @@ xsltAddTemplate(xsltStylesheetPtr style, xsltTemplatePtr cur,
      * 'top' will point to style->xxxMatch ptr - declaring as 'void'
      *  avoids gcc 'type-punned pointer' warning.
      */
-    void **top = NULL;
+    xsltCompMatchPtr *top = NULL;
     const xmlChar *name = NULL;
     float priority;              /* the priority */
 
@@ -2618,8 +2618,7 @@ xsltCleanupTemplates(xsltStylesheetPtr style ATTRIBUTE_UNUSED) {
 void
 xsltFreeTemplateHashes(xsltStylesheetPtr style) {
     if (style->templatesHash != NULL)
-       xmlHashFree((xmlHashTablePtr) style->templatesHash,
-                   xsltFreeCompMatchListEntry);
+       xmlHashFree(style->templatesHash, xsltFreeCompMatchListEntry);
     if (style->rootMatch != NULL)
         xsltFreeCompMatchList(style->rootMatch);
     if (style->keyMatch != NULL)
diff --git a/libxslt/xsltInternals.h b/libxslt/xsltInternals.h
index 14a971aa..946e43c5 100644
--- a/libxslt/xsltInternals.h
+++ b/libxslt/xsltInternals.h
@@ -1500,17 +1500,18 @@ struct _xsltStylesheet {
     /*
      * Template descriptions.
      */
-    xsltTemplatePtr templates; /* the ordered list of templates */
-    void *templatesHash;       /* hash table or wherever compiled templates
-                                  information is stored */
-    void *rootMatch;           /* template based on / */
-    void *keyMatch;            /* template based on key() */
-    void *elemMatch;           /* template based on * */
-    void *attrMatch;           /* template based on @* */
-    void *parentMatch;         /* template based on .. */
-    void *textMatch;           /* template based on text() */
-    void *piMatch;             /* template based on processing-instruction() */
-    void *commentMatch;                /* template based on comment() */
+    xsltTemplatePtr templates;           /* the ordered list of templates */
+    xmlHashTablePtr templatesHash;       /* hash table or wherever compiled
+                                            templates information is stored */
+    struct _xsltCompMatch *rootMatch;    /* template based on / */
+    struct _xsltCompMatch *keyMatch;     /* template based on key() */
+    struct _xsltCompMatch *elemMatch;    /* template based on * */
+    struct _xsltCompMatch *attrMatch;    /* template based on @* */
+    struct _xsltCompMatch *parentMatch;  /* template based on .. */
+    struct _xsltCompMatch *textMatch;    /* template based on text() */
+    struct _xsltCompMatch *piMatch;      /* template based on
+                                            processing-instruction() */
+    struct _xsltCompMatch *commentMatch; /* template based on comment() */
 
     /*
      * Namespace aliases.


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