pidgin/pidgin

Fix incompatible type conversion errors

2 months ago, Elliott Sales de Andrade
452ba49e16d4
Parents 8627951788d1
Children aa3f777462d8
Fix incompatible type conversion errors

A recent libxml2 changed its handler function to take a `const` pointer. It's
safe for us to have it, and them not, but the opposite way causes an implicit
cast warning.

This fixes the build in Fedora 40, which changes several incompatible pointer
conversion warnings into errors.

This is a forward port of /r/2944/

Testing Done:
Compiled on Fedora Rawhide.

Reviewed at https://reviews.imfreedom.org/r/2950/
--- a/COPYRIGHT Thu Feb 01 22:21:42 2024 -0600
+++ b/COPYRIGHT Sat Feb 10 01:32:36 2024 -0600
@@ -540,6 +540,7 @@
Renato Silva
John Silvestri
Mukund Sivaraman
+Jaroslav Škarvada
Craig Slusher
Alex Smith
Brad Smith
--- a/libpurple/protocols/bonjour/parser.c Thu Feb 01 22:21:42 2024 -0600
+++ b/libpurple/protocols/bonjour/parser.c Sat Feb 10 01:32:36 2024 -0600
@@ -159,7 +159,7 @@
}
static void
-bonjour_parser_structured_error_handler(void *user_data, xmlErrorPtr error)
+bonjour_parser_structured_error_handler(void *user_data, const xmlError *error)
{
BonjourXMPPConversation *bconv = user_data;
--- a/libpurple/protocols/jabber/parser.c Thu Feb 01 22:21:42 2024 -0600
+++ b/libpurple/protocols/jabber/parser.c Sat Feb 10 01:32:36 2024 -0600
@@ -181,7 +181,7 @@
}
static void
-jabber_parser_structured_error_handler(void *user_data, xmlErrorPtr error)
+jabber_parser_structured_error_handler(void *user_data, const xmlError *error)
{
JabberStream *js = user_data;
@@ -271,7 +271,7 @@
js->context = xmlCreatePushParserCtxt(&jabber_parser_libxml, js, buf, len, NULL);
xmlParseChunk(js->context, "", 0, 0);
} else if ((ret = xmlParseChunk(js->context, buf, len, 0)) != XML_ERR_OK) {
- xmlError *err = xmlCtxtGetLastError(js->context);
+ const xmlError *err = xmlCtxtGetLastError(js->context);
/*
* libxml2 uses a global setting to determine whether or not to store
* warnings. Other libraries may set this, which causes err to be