pidgin/pidgin

Fix incompatible type conversion errors
release-2.x.y
4 months ago, Elliott Sales de Andrade
488055ab5531
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.
- In relatively new GLib (many years now), `g_object_ref` casts its output to
match its input. This means we should not be casting to `G_OBJECT`, as that
is not the type it expects, and would translate to the output being `GObject`
instead of the original type.

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

This patch is partially from the Fedora maintainer @yarda, with some corrections by me (to the `g_object_ref` portions.)

Testing Done:
Compiled in a Rawhide environment with this patch applied.

Bugs closed: PIDGIN-17850

Reviewed at https://reviews.imfreedom.org/r/2944/
/** @page imgstore-signals Image Store Signals
@signals
@signal image-deleting
@endsignals
@see imgstore.h
<hr>
@signaldef image-deleting
@signalproto
char *(*image_deleting)(const PurpleStoredImage *img);
@endsignalproto
@signaldesc
Emitted when a #PurpleStoredImage is about to be destroyed. This allows
for what amounts to weak references. Code can hold onto a pointer to
the PurpleStoredImage without actually "holding" a reference. They can
then use a signal handler to let them know when their img is about to
be destroyed.
@param img The image about to be destroyed.
@note It's not possible to purple_imgstore_ref() img to save it.
@endsignaldef
*/
// vim: syntax=c.doxygen tw=75 et