diff options
author | Nick Wellnhofer <wellnhofer@aevum.de> | 2021-07-06 16:27:12 +0200 |
---|---|---|
committer | Nick Wellnhofer <wellnhofer@aevum.de> | 2021-07-06 16:27:12 +0200 |
commit | 669407a87ba31a68a5c24d60403e24508f61fbeb (patch) | |
tree | f1fe1b72e612dc51754bb837b49caa5f43c7d3c0 | |
parent | b9044eaf3a94d33e9087b79f12efb6fe518e8216 (diff) | |
download | libxslt-669407a87ba31a68a5c24d60403e24508f61fbeb.tar.gz |
Use actual types for templates in struct _xsltStylesheet
Improves type safety.
-rw-r--r-- | libxslt/pattern.c | 5 | ||||
-rw-r--r-- | 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. |