pidgin/pidgin

Explicitly cast libxml error handler function

2 months ago, Elliott Sales de Andrade
6628810f3fe8
Parents 4895793f3298
Children 3d8ff8c57dd3
Explicitly cast libxml error handler function

Depending on compiler options, the `const` → non-`const` argument can fail in just the same way as it did in reverse. So add an explicit cast to silence that.

Testing Done:
Compiled with `gcc` and `clang` on a system with older libxml2, which still had the non-`const` type. There, `gcc` raises a warning, but `clang` seems to think this is a fatal error.

Reviewed at https://reviews.imfreedom.org/r/3016/
--- a/libpurple/protocols/bonjour/parser.c Fri Mar 08 02:28:05 2024 -0600
+++ b/libpurple/protocols/bonjour/parser.c Mon Mar 11 04:29:48 2024 -0500
@@ -202,7 +202,7 @@
NULL, /*_private*/
bonjour_parser_element_start_libxml, /*startElementNs*/
bonjour_parser_element_end_libxml, /*endElementNs*/
- bonjour_parser_structured_error_handler /*serror*/
+ (xmlStructuredErrorFunc)bonjour_parser_structured_error_handler /*serror*/
};
void
--- a/libpurple/protocols/jabber/parser.c Fri Mar 08 02:28:05 2024 -0600
+++ b/libpurple/protocols/jabber/parser.c Mon Mar 11 04:29:48 2024 -0500
@@ -240,7 +240,7 @@
NULL, /*_private*/
jabber_parser_element_start_libxml, /*startElementNs*/
jabber_parser_element_end_libxml, /*endElementNs*/
- jabber_parser_structured_error_handler /*serror*/
+ (xmlStructuredErrorFunc)jabber_parser_structured_error_handler /*serror*/
};
void