summaryrefslogtreecommitdiff
path: root/pattern.c
diff options
context:
space:
mode:
authorNick Wellnhofer <wellnhofer@aevum.de>2022-09-01 01:18:30 +0200
committerNick Wellnhofer <wellnhofer@aevum.de>2022-09-01 02:33:57 +0200
commitad338ca737c4df5a4d1c28f8ee18b878572f2964 (patch)
tree99eb6d5585da39fc9d55cd0837209f8721c47452 /pattern.c
parentaeb69fd3575a33eb2ffded18a444d8945bcbd741 (diff)
downloadlibxml2-ad338ca737c4df5a4d1c28f8ee18b878572f2964.tar.gz
Remove explicit integer casts
Remove explicit integer casts as final operation - in assignments - when passing arguments - when returning values Remove casts - to the same type - from certain range-bound values The main motivation is that these explicit casts don't change the result of operations and only render UBSan's implicit-conversion checks useless. Removing these casts allows UBSan to detect cases where truncation or sign-changes occur unexpectedly. Document some explicit casts as truncating and add a few missing ones.
Diffstat (limited to 'pattern.c')
-rw-r--r--pattern.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pattern.c b/pattern.c
index cff4469c..4d0423ee 100644
--- a/pattern.c
+++ b/pattern.c
@@ -2207,7 +2207,7 @@ stream_next:
int
xmlStreamPush(xmlStreamCtxtPtr stream,
const xmlChar *name, const xmlChar *ns) {
- return (xmlStreamPushInternal(stream, name, ns, (int) XML_ELEMENT_NODE));
+ return (xmlStreamPushInternal(stream, name, ns, XML_ELEMENT_NODE));
}
/**
@@ -2257,7 +2257,7 @@ xmlStreamPushNode(xmlStreamCtxtPtr stream,
int
xmlStreamPushAttr(xmlStreamCtxtPtr stream,
const xmlChar *name, const xmlChar *ns) {
- return (xmlStreamPushInternal(stream, name, ns, (int) XML_ATTRIBUTE_NODE));
+ return (xmlStreamPushInternal(stream, name, ns, XML_ATTRIBUTE_NODE));
}
/**