pidgin/pidgin

Parents 876661dc1375
Children 3200c5f09dbc
libpurple/xfer.c: Silence warnings in purple_xfer_set_thumbnail()

This patch fixes a mixed declarations and code warning and a discards
'const' qualifier from pointer target type warning:

xfer.c:1927:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
gpointer *old_thumbnail_data = priv->thumbnail_data;

xfer.c:1942:9: warning: passing argument 1 of ‘g_free’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
g_free(old_mimetype);

It also changes the old_thumbnail_data variable to match the type of
thumbnail_data in the priv structure.
--- a/libpurple/xfer.c Wed Jun 14 23:13:00 2017 -0500
+++ b/libpurple/xfer.c Thu Jun 15 10:46:29 2017 -0500
@@ -1920,12 +1920,14 @@
gsize size, const gchar *mimetype)
{
PurpleXferPrivate *priv = PURPLE_XFER_GET_PRIVATE(xfer);
+ gpointer old_thumbnail_data;
+ gchar *old_mimetype;
g_return_if_fail(priv != NULL);
/* Hold onto these in case they are equal to passed-in pointers */
- gpointer *old_thumbnail_data = priv->thumbnail_data;
- const gchar *old_mimetype = priv->thumbnail_mimetype;
+ old_thumbnail_data = priv->thumbnail_data;
+ old_mimetype = priv->thumbnail_mimetype;
if (thumbnail && size > 0) {
priv->thumbnail_data = g_memdup(thumbnail, size);