diff options
author | Nick Wellnhofer <wellnhofer@aevum.de> | 2022-09-01 01:18:30 +0200 |
---|---|---|
committer | Nick Wellnhofer <wellnhofer@aevum.de> | 2022-09-01 02:33:57 +0200 |
commit | ad338ca737c4df5a4d1c28f8ee18b878572f2964 (patch) | |
tree | 99eb6d5585da39fc9d55cd0837209f8721c47452 /pattern.c | |
parent | aeb69fd3575a33eb2ffded18a444d8945bcbd741 (diff) | |
download | libxml2-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.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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)); } /** |