pidgin/pidgin

Bump C standard to C99 for Bonjour and fix warnings

17 months ago, Elliott Sales de Andrade
f550a2d2c0f6
Parents 421c761287d8
Children c7bcaf2f41ef
Bump C standard to C99 for Bonjour and fix warnings

I'm not 100% sure about the Windows files though.

Testing Done:
Touched all Bonjour source files, and recompiled; no new warnings.

Reviewed at https://reviews.imfreedom.org/r/2124/
--- a/libpurple/protocols/bonjour/bonjour.c Mon Dec 12 01:07:16 2022 -0600
+++ b/libpurple/protocols/bonjour/bonjour.c Mon Dec 12 04:23:17 2022 -0600
@@ -204,7 +204,7 @@
}
static GList *
-bonjour_protocol_get_account_options(PurpleProtocol *protocol) {
+bonjour_protocol_get_account_options(G_GNUC_UNUSED PurpleProtocol *protocol) {
PurpleAccountOption *option;
GList *opts = NULL;
@@ -234,14 +234,15 @@
}
static PurpleBuddyIconSpec *
-bonjour_protocol_get_buddy_icon_spec(PurpleProtocol *protocol) {
+bonjour_protocol_get_buddy_icon_spec(G_GNUC_UNUSED PurpleProtocol *protocol) {
return purple_buddy_icon_spec_new("png,gif,jpeg",
0, 0, 96, 96, 65535,
PURPLE_ICON_SCALE_DISPLAY);
}
static int
-bonjour_send_im(PurpleProtocolIM *im, PurpleConnection *connection, PurpleMessage *msg)
+bonjour_send_im(G_GNUC_UNUSED PurpleProtocolIM *im,
+ PurpleConnection *connection, PurpleMessage *msg)
{
BonjourData *bd = purple_connection_get_protocol_data(connection);
@@ -254,7 +255,7 @@
}
static void
-bonjour_set_status(PurpleProtocolServer *protocol_server,
+bonjour_set_status(G_GNUC_UNUSED PurpleProtocolServer *protocol_server,
PurpleAccount *account, PurpleStatus *status)
{
PurpleConnection *gc;
@@ -297,9 +298,11 @@
* if there is no add_buddy callback.
*/
static void
-bonjour_fake_add_buddy(PurpleProtocolServer *protocol_server,
- PurpleConnection *pc, PurpleBuddy *buddy,
- PurpleGroup *group, const gchar *message)
+bonjour_fake_add_buddy(G_GNUC_UNUSED PurpleProtocolServer *protocol_server,
+ G_GNUC_UNUSED PurpleConnection *connection,
+ PurpleBuddy *buddy,
+ G_GNUC_UNUSED PurpleGroup *group,
+ G_GNUC_UNUSED const gchar *message)
{
purple_debug_error("bonjour", "Buddy '%s' manually added; removing. "
"Bonjour buddies must be discovered and not manually added.\n",
@@ -313,9 +316,10 @@
static void
-bonjour_remove_buddy(PurpleProtocolServer *protocol_server,
- PurpleConnection *pc, PurpleBuddy *buddy,
- PurpleGroup *group)
+bonjour_remove_buddy(G_GNUC_UNUSED PurpleProtocolServer *protocol_server,
+ G_GNUC_UNUSED PurpleConnection *connection,
+ PurpleBuddy *buddy,
+ G_GNUC_UNUSED PurpleGroup *group)
{
BonjourBuddy *bb = purple_buddy_get_protocol_data(buddy);
if (bb) {
@@ -356,7 +360,7 @@
}
static void
-bonjour_convo_closed(PurpleProtocolClient *client,
+bonjour_convo_closed(G_GNUC_UNUSED PurpleProtocolClient *client,
PurpleConnection *connection, const char *who)
{
PurpleBuddy *buddy = purple_blist_find_buddy(purple_connection_get_account(connection), who);
@@ -376,8 +380,9 @@
}
static void
-bonjour_set_buddy_icon(PurpleProtocolServer *protocol_server,
- PurpleConnection *conn, PurpleImage *img)
+bonjour_set_buddy_icon(G_GNUC_UNUSED PurpleProtocolServer *protocol_server,
+ PurpleConnection *conn,
+ G_GNUC_UNUSED PurpleImage *img)
{
BonjourData *bd = purple_connection_get_protocol_data(conn);
bonjour_dns_sd_update_buddy_icon(bd->dns_sd_data);
@@ -385,7 +390,8 @@
static char *
-bonjour_status_text(PurpleProtocolClient *client, PurpleBuddy *buddy)
+bonjour_status_text(G_GNUC_UNUSED PurpleProtocolClient *client,
+ PurpleBuddy *buddy)
{
PurplePresence *presence;
PurpleStatus *status;
@@ -406,8 +412,9 @@
}
static void
-bonjour_tooltip_text(PurpleProtocolClient *client, PurpleBuddy *buddy,
- PurpleNotifyUserInfo *user_info, gboolean full)
+bonjour_tooltip_text(G_GNUC_UNUSED PurpleProtocolClient *client,
+ PurpleBuddy *buddy, PurpleNotifyUserInfo *user_info,
+ G_GNUC_UNUSED gboolean full)
{
PurplePresence *presence;
PurpleStatus *status;
@@ -487,9 +494,9 @@
}
static void
-bonjour_group_buddy(PurpleProtocolServer *protocol_server,
- PurpleConnection *connection, const gchar *who,
- const gchar *old_group, const gchar *new_group)
+bonjour_group_buddy(G_GNUC_UNUSED PurpleProtocolServer *protocol_server,
+ PurpleConnection *connection, const char *who,
+ G_GNUC_UNUSED const char *old_group, const char *new_group)
{
PurpleBuddy *buddy = purple_blist_find_buddy(purple_connection_get_account(connection), who);
@@ -497,9 +504,9 @@
}
static void
-bonjour_rename_group(PurpleProtocolServer *protocol_server,
- PurpleConnection *connection,
- const gchar *old_name, PurpleGroup *group,
+bonjour_rename_group(G_GNUC_UNUSED PurpleProtocolServer *protocol_server,
+ G_GNUC_UNUSED PurpleConnection *connection,
+ G_GNUC_UNUSED const char *old_name, PurpleGroup *group,
GList *moved_buddies)
{
const gchar *new_group;
@@ -510,7 +517,8 @@
}
static gboolean
-bonjour_can_receive_file(PurpleProtocolXfer *prplxfer, PurpleConnection *connection, const char *who)
+bonjour_can_receive_file(G_GNUC_UNUSED PurpleProtocolXfer *prplxfer,
+ PurpleConnection *connection, const char *who)
{
PurpleBuddy *buddy = purple_blist_find_buddy(purple_connection_get_account(connection), who);
@@ -518,7 +526,8 @@
}
static gssize
-bonjour_get_max_message_size(PurpleProtocolClient *client, PurpleConversation *conv)
+bonjour_get_max_message_size(G_GNUC_UNUSED PurpleProtocolClient *client,
+ G_GNUC_UNUSED PurpleConversation *conv)
{
return -1; /* 5MB successfully tested. */
}
@@ -670,7 +679,7 @@
}
static void
-bonjour_protocol_init(BonjourProtocol *self)
+bonjour_protocol_init(G_GNUC_UNUSED BonjourProtocol *self)
{
}
@@ -755,7 +764,7 @@
}
static GPluginPluginInfo *
-bonjour_query(GError **error)
+bonjour_query(G_GNUC_UNUSED GError **error)
{
return purple_plugin_info_new(
"id", "prpl-bonjour",
@@ -794,7 +803,8 @@
}
static gboolean
-bonjour_unload(GPluginPlugin *plugin, gboolean shutdown, GError **error)
+bonjour_unload(G_GNUC_UNUSED GPluginPlugin *plugin,
+ G_GNUC_UNUSED gboolean shutdown, GError **error)
{
PurpleProtocolManager *manager = purple_protocol_manager_get_default();
--- a/libpurple/protocols/bonjour/bonjour_ft.c Mon Dec 12 01:07:16 2022 -0600
+++ b/libpurple/protocols/bonjour/bonjour_ft.c Mon Dec 12 04:23:17 2022 -0600
@@ -300,7 +300,8 @@
}
PurpleXfer *
-bonjour_new_xfer(PurpleProtocolXfer *prplxfer, PurpleConnection *gc, const char *who)
+bonjour_new_xfer(G_GNUC_UNUSED PurpleProtocolXfer *prplxfer,
+ PurpleConnection *gc, const char *who)
{
PurpleXfer *xfer;
XepXfer *xep_xfer;
@@ -703,8 +704,9 @@
}
static void
-bonjour_xfer_receive(PurpleConnection *pc, const char *id, const char *sid, const char *from,
- goffset filesize, const char *filename, int option)
+bonjour_xfer_receive(PurpleConnection *pc, const char *id, const char *sid,
+ const char *from, goffset filesize, const char *filename,
+ G_GNUC_UNUSED int option)
{
PurpleXfer *xfer;
XepXfer *xf;
@@ -865,7 +867,7 @@
}
static void
-bonjour_sock5_incoming_cb(GSocketService *service,
+bonjour_sock5_incoming_cb(G_GNUC_UNUSED GSocketService *service,
GSocketConnection *connection, GObject *source_object,
G_GNUC_UNUSED gpointer data)
{
@@ -1185,8 +1187,7 @@
}
static void
-xep_xfer_class_finalize(XepXferClass *klass) {
-
+xep_xfer_class_finalize(G_GNUC_UNUSED XepXferClass *klass) {
}
static void
--- a/libpurple/protocols/bonjour/dns_sd_proxy.c Mon Dec 12 01:07:16 2022 -0600
+++ b/libpurple/protocols/bonjour/dns_sd_proxy.c Mon Dec 12 04:23:17 2022 -0600
@@ -56,24 +56,24 @@
if (!initialized) {
initialized = TRUE;
- if ((_DNSServiceAddRecord = (void *) wpurple_find_and_loadproc("dnssd.dll", "DNSServiceAddRecord"))
- && (_DNSServiceBrowse = (void *) wpurple_find_and_loadproc("dnssd.dll", "DNSServiceBrowse"))
- && (_DNSServiceConstructFullName = (void *) wpurple_find_and_loadproc("dnssd.dll", "DNSServiceConstructFullName"))
- && (_DNSServiceGetAddrInfo = (void *) wpurple_find_and_loadproc("dnssd.dll", "DNSServiceGetAddrInfo"))
- && (_DNSServiceProcessResult = (void *) wpurple_find_and_loadproc("dnssd.dll", "DNSServiceProcessResult"))
- && (_DNSServiceQueryRecord = (void *) wpurple_find_and_loadproc("dnssd.dll", "DNSServiceQueryRecord"))
- && (_DNSServiceRefDeallocate = (void *) wpurple_find_and_loadproc("dnssd.dll", "DNSServiceRefDeallocate"))
- && (_DNSServiceRefSockFD = (void *) wpurple_find_and_loadproc("dnssd.dll", "DNSServiceRefSockFD"))
- && (_DNSServiceRegister = (void *) wpurple_find_and_loadproc("dnssd.dll", "DNSServiceRegister"))
- && (_DNSServiceResolve = (void *) wpurple_find_and_loadproc("dnssd.dll", "DNSServiceResolve"))
- && (_DNSServiceRemoveRecord = (void *) wpurple_find_and_loadproc("dnssd.dll", "DNSServiceRemoveRecord"))
- && (_DNSServiceUpdateRecord = (void *) wpurple_find_and_loadproc("dnssd.dll", "DNSServiceUpdateRecord"))
- && (_TXTRecordCreate = (void *) wpurple_find_and_loadproc("dnssd.dll", "TXTRecordCreate"))
- && (_TXTRecordDeallocate = (void *) wpurple_find_and_loadproc("dnssd.dll", "TXTRecordDeallocate"))
- && (_TXTRecordGetBytesPtr = (void *) wpurple_find_and_loadproc("dnssd.dll", "TXTRecordGetBytesPtr"))
- && (_TXTRecordGetLength = (void *) wpurple_find_and_loadproc("dnssd.dll", "TXTRecordGetLength"))
- && (_TXTRecordGetValuePtr = (void *) wpurple_find_and_loadproc("dnssd.dll", "TXTRecordGetValuePtr"))
- && (_TXTRecordSetValue = (void *) wpurple_find_and_loadproc("dnssd.dll", "TXTRecordSetValue"))) {
+ if ((_DNSServiceAddRecord = (gpointer)wpurple_find_and_loadproc("dnssd.dll", "DNSServiceAddRecord"))
+ && (_DNSServiceBrowse = (gpointer)wpurple_find_and_loadproc("dnssd.dll", "DNSServiceBrowse"))
+ && (_DNSServiceConstructFullName = (gpointer)wpurple_find_and_loadproc("dnssd.dll", "DNSServiceConstructFullName"))
+ && (_DNSServiceGetAddrInfo = (gpointer)wpurple_find_and_loadproc("dnssd.dll", "DNSServiceGetAddrInfo"))
+ && (_DNSServiceProcessResult = (gpointer)wpurple_find_and_loadproc("dnssd.dll", "DNSServiceProcessResult"))
+ && (_DNSServiceQueryRecord = (gpointer)wpurple_find_and_loadproc("dnssd.dll", "DNSServiceQueryRecord"))
+ && (_DNSServiceRefDeallocate = (gpointer)wpurple_find_and_loadproc("dnssd.dll", "DNSServiceRefDeallocate"))
+ && (_DNSServiceRefSockFD = (gpointer)wpurple_find_and_loadproc("dnssd.dll", "DNSServiceRefSockFD"))
+ && (_DNSServiceRegister = (gpointer)wpurple_find_and_loadproc("dnssd.dll", "DNSServiceRegister"))
+ && (_DNSServiceResolve = (gpointer)wpurple_find_and_loadproc("dnssd.dll", "DNSServiceResolve"))
+ && (_DNSServiceRemoveRecord = (gpointer)wpurple_find_and_loadproc("dnssd.dll", "DNSServiceRemoveRecord"))
+ && (_DNSServiceUpdateRecord = (gpointer)wpurple_find_and_loadproc("dnssd.dll", "DNSServiceUpdateRecord"))
+ && (_TXTRecordCreate = (gpointer)wpurple_find_and_loadproc("dnssd.dll", "TXTRecordCreate"))
+ && (_TXTRecordDeallocate = (gpointer)wpurple_find_and_loadproc("dnssd.dll", "TXTRecordDeallocate"))
+ && (_TXTRecordGetBytesPtr = (gpointer)wpurple_find_and_loadproc("dnssd.dll", "TXTRecordGetBytesPtr"))
+ && (_TXTRecordGetLength = (gpointer)wpurple_find_and_loadproc("dnssd.dll", "TXTRecordGetLength"))
+ && (_TXTRecordGetValuePtr = (gpointer)wpurple_find_and_loadproc("dnssd.dll", "TXTRecordGetValuePtr"))
+ && (_TXTRecordSetValue = (gpointer)wpurple_find_and_loadproc("dnssd.dll", "TXTRecordSetValue"))) {
loaded = TRUE;
}
}
--- a/libpurple/protocols/bonjour/mdns_avahi.c Mon Dec 12 01:07:16 2022 -0600
+++ b/libpurple/protocols/bonjour/mdns_avahi.c Mon Dec 12 04:23:17 2022 -0600
@@ -102,11 +102,13 @@
static void
-_resolver_callback(AvahiServiceResolver *r, AvahiIfIndex interface, AvahiProtocol protocol,
- AvahiResolverEvent event, const char *name, const char *type, const char *domain,
- const char *host_name, const AvahiAddress *a, uint16_t port, AvahiStringList *txt,
- AvahiLookupResultFlags flags, void *userdata) {
-
+_resolver_callback(AvahiServiceResolver *r, AvahiIfIndex interface,
+ AvahiProtocol protocol, AvahiResolverEvent event,
+ const char *name, const char *type, const char *domain,
+ G_GNUC_UNUSED const char *host_name, const AvahiAddress *a,
+ uint16_t port, AvahiStringList *txt,
+ G_GNUC_UNUSED AvahiLookupResultFlags flags, void *userdata)
+{
PurpleBuddy *pb;
BonjourBuddy *bb;
PurpleAccount *account = userdata;
@@ -235,10 +237,10 @@
static void
_browser_callback(AvahiServiceBrowser *b, AvahiIfIndex interface,
- AvahiProtocol protocol, AvahiBrowserEvent event,
- const char *name, const char *type, const char *domain,
- AvahiLookupResultFlags flags, void *userdata) {
-
+ AvahiProtocol protocol, AvahiBrowserEvent event,
+ const char *name, const char *type, const char *domain,
+ G_GNUC_UNUSED AvahiLookupResultFlags flags, void *userdata)
+{
PurpleAccount *account = userdata;
PurpleBuddy *pb = NULL;
@@ -364,9 +366,16 @@
}
static void
-_buddy_icon_record_cb(AvahiRecordBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol,
- AvahiBrowserEvent event, const char *name, uint16_t clazz, uint16_t type,
- const void *rdata, size_t size, AvahiLookupResultFlags flags, void *userdata) {
+_buddy_icon_record_cb(AvahiRecordBrowser *b,
+ G_GNUC_UNUSED AvahiIfIndex interface,
+ G_GNUC_UNUSED AvahiProtocol protocol,
+ AvahiBrowserEvent event, G_GNUC_UNUSED const char *name,
+ G_GNUC_UNUSED uint16_t clazz,
+ G_GNUC_UNUSED uint16_t type,
+ const void *rdata, size_t size,
+ G_GNUC_UNUSED AvahiLookupResultFlags flags,
+ void *userdata)
+{
BonjourBuddy *buddy = userdata;
AvahiBuddyImplData *idata = buddy->mdns_impl_data;
--- a/libpurple/protocols/bonjour/mdns_dns_sd.c Mon Dec 12 01:07:16 2022 -0600
+++ b/libpurple/protocols/bonjour/mdns_dns_sd.c Mon Dec 12 04:23:17 2022 -0600
@@ -102,7 +102,9 @@
}
static void
-_mdns_handle_event(gpointer data, gint source, PurpleInputCondition condition) {
+_mdns_handle_event(gpointer data, G_GNUC_UNUSED gint source,
+ G_GNUC_UNUSED PurpleInputCondition condition)
+{
DnsSDServiceRefHandlerData *srh = data;
DNSServiceErrorType errorCode = DNSServiceProcessResult(srh->sdRef);
if (errorCode != kDNSServiceErr_NoError) {
@@ -132,12 +134,15 @@
}
static void DNSSD_API
-_mdns_record_query_callback(DNSServiceRef DNSServiceRef, DNSServiceFlags flags,
- uint32_t interfaceIndex, DNSServiceErrorType errorCode, const char *fullname,
- uint16_t rrtype, uint16_t rrclass, uint16_t rdlen, const void *rdata,
- uint32_t ttl, void *context)
+_mdns_record_query_callback(G_GNUC_UNUSED DNSServiceRef DNSServiceRef,
+ DNSServiceFlags flags,
+ G_GNUC_UNUSED uint32_t interfaceIndex,
+ DNSServiceErrorType errorCode,
+ G_GNUC_UNUSED const char *fullname,
+ uint16_t rrtype, G_GNUC_UNUSED uint16_t rrclass,
+ uint16_t rdlen, const void *rdata,
+ G_GNUC_UNUSED uint32_t ttl, void *context)
{
-
if (errorCode != kDNSServiceErr_NoError) {
purple_debug_error("bonjour", "record query - callback error (%d).\n", errorCode);
/* TODO: Probably should remove the buddy when this happens */
@@ -166,10 +171,13 @@
}
static void DNSSD_API
-_mdns_resolve_host_callback(DNSServiceRef sdRef, DNSServiceFlags flags,
- uint32_t interfaceIndex, DNSServiceErrorType errorCode,
- const char *hostname, const struct sockaddr *address,
- uint32_t ttl, void *context)
+_mdns_resolve_host_callback(G_GNUC_UNUSED DNSServiceRef sdRef,
+ G_GNUC_UNUSED DNSServiceFlags flags,
+ G_GNUC_UNUSED uint32_t interfaceIndex,
+ DNSServiceErrorType errorCode,
+ G_GNUC_UNUSED const char *hostname,
+ const struct sockaddr *address,
+ G_GNUC_UNUSED uint32_t ttl, void *context)
{
ResolveCallbackArgs *args = (ResolveCallbackArgs*) context;
Win32BuddyImplData *idata = args->bb->mdns_impl_data;
@@ -262,8 +270,14 @@
}
static void DNSSD_API
-_mdns_service_resolve_callback(DNSServiceRef sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, DNSServiceErrorType errorCode,
- const char *fullname, const char *hosttarget, uint16_t port, uint16_t txtLen, const unsigned char *txtRecord, void *context)
+_mdns_service_resolve_callback(G_GNUC_UNUSED DNSServiceRef sdRef,
+ G_GNUC_UNUSED DNSServiceFlags flags,
+ uint32_t interfaceIndex,
+ DNSServiceErrorType errorCode,
+ const char *fullname, const char *hosttarget,
+ uint16_t port, G_GNUC_UNUSED uint16_t txtLen,
+ G_GNUC_UNUSED const unsigned char *txtRecord,
+ void *context)
{
ResolveCallbackArgs *args = (ResolveCallbackArgs*) context;
Win32BuddyImplData *idata = args->bb->mdns_impl_data;
@@ -321,9 +335,14 @@
}
static void DNSSD_API
-_mdns_service_register_callback(DNSServiceRef sdRef, DNSServiceFlags flags, DNSServiceErrorType errorCode,
- const char *name, const char *regtype, const char *domain, void *context) {
-
+_mdns_service_register_callback(G_GNUC_UNUSED DNSServiceRef sdRef,
+ G_GNUC_UNUSED DNSServiceFlags flags,
+ DNSServiceErrorType errorCode,
+ G_GNUC_UNUSED const char *name,
+ G_GNUC_UNUSED const char *regtype,
+ G_GNUC_UNUSED const char *domain,
+ G_GNUC_UNUSED void *context)
+{
/* TODO: deal with collision */
if (errorCode != kDNSServiceErr_NoError)
purple_debug_error("bonjour", "service advertisement - callback error (%d).\n", errorCode);
@@ -332,8 +351,11 @@
}
static void DNSSD_API
-_mdns_service_browse_callback(DNSServiceRef sdRef, DNSServiceFlags flags, uint32_t interfaceIndex,
- DNSServiceErrorType errorCode, const char *serviceName, const char *regtype, const char *replyDomain, void *context)
+_mdns_service_browse_callback(G_GNUC_UNUSED DNSServiceRef sdRef,
+ DNSServiceFlags flags, uint32_t interfaceIndex,
+ DNSServiceErrorType errorCode,
+ const char *serviceName, const char *regtype,
+ const char *replyDomain, void *context)
{
PurpleAccount *account = (PurpleAccount*)context;
--- a/libpurple/protocols/bonjour/meson.build Mon Dec 12 01:07:16 2022 -0600
+++ b/libpurple/protocols/bonjour/meson.build Mon Dec 12 04:23:17 2022 -0600
@@ -36,7 +36,9 @@
c_args : ['-DG_LOG_USE_STRUCTURED', '-DG_LOG_DOMAIN="Purple-Bonjour"'],
link_args : bonjour_link_args,
dependencies : [libxml, avahi, libpurple_dep, glib, ws2_32],
- install : true, install_dir : PURPLE_PLUGINDIR)
+ install : true,
+ install_dir : PURPLE_PLUGINDIR,
+ override_options : ['c_std=c99', 'warning_level=2'])
devenv.append('PURPLE_PLUGIN_PATH', meson.current_build_dir())
endif
--- a/libpurple/protocols/bonjour/parser.c Mon Dec 12 01:07:16 2022 -0600
+++ b/libpurple/protocols/bonjour/parser.c Mon Dec 12 04:23:17 2022 -0600
@@ -47,9 +47,14 @@
static void
bonjour_parser_element_start_libxml(void *user_data,
- const xmlChar *element_name, const xmlChar *prefix, const xmlChar *namespace,
- int nb_namespaces, const xmlChar **namespaces,
- int nb_attributes, int nb_defaulted, const xmlChar **attributes)
+ const xmlChar *element_name,
+ const xmlChar *prefix,
+ const xmlChar *namespace,
+ G_GNUC_UNUSED int nb_namespaces,
+ G_GNUC_UNUSED const xmlChar **namespaces,
+ int nb_attributes,
+ G_GNUC_UNUSED int nb_defaulted,
+ const xmlChar **attributes)
{
BonjourXMPPConversation *bconv = user_data;
@@ -110,7 +115,8 @@
static void
bonjour_parser_element_end_libxml(void *user_data, const xmlChar *element_name,
- const xmlChar *prefix, const xmlChar *namespace)
+ G_GNUC_UNUSED const xmlChar *prefix,
+ G_GNUC_UNUSED const xmlChar *namespace)
{
BonjourXMPPConversation *bconv = user_data;
--- a/libpurple/protocols/bonjour/xmpp.c Mon Dec 12 01:07:16 2022 -0600
+++ b/libpurple/protocols/bonjour/xmpp.c Mon Dec 12 04:23:17 2022 -0600
@@ -352,7 +352,7 @@
return -1;
}
- if (ret < len) {
+ if ((gsize)ret < len) {
/* Don't interfere with the stream starting */
if (bconv->sent_stream_start == FULLY_SENT &&
bconv->recv_stream_start && bconv->tx_handler == 0) {
@@ -361,7 +361,7 @@
G_POLLABLE_OUTPUT_STREAM(bconv->output),
bconv->cancellable);
g_source_set_callback(source,
- (GSourceFunc)_send_data_write_cb,
+ G_SOURCE_FUNC(_send_data_write_cb),
pb, NULL);
bconv->tx_handler = g_source_attach(source, NULL);
g_source_unref(source);
@@ -513,7 +513,7 @@
}
/* This is EXTREMELY unlikely to happen */
- if (G_UNLIKELY(ret < len)) {
+ if (G_UNLIKELY((gsize)ret < len)) {
char *tmp = g_strdup(ss->msg + ret);
g_free(ss->msg);
ss->msg = tmp;
@@ -597,7 +597,7 @@
}
/* This is unlikely to happen */
- if (ret < len) {
+ if ((gsize)ret < len) {
GSource *source;
struct _stream_start_data *ss = g_new(struct _stream_start_data, 1);
ss->msg = g_strdup(stream_start + ret);
@@ -606,7 +606,7 @@
source = g_pollable_output_stream_create_source(
G_POLLABLE_OUTPUT_STREAM(bconv->output),
bconv->cancellable);
- g_source_set_callback(source, (GSourceFunc)_start_stream, bconv,
+ g_source_set_callback(source, G_SOURCE_FUNC(_start_stream), bconv,
NULL);
bconv->tx_handler = g_source_attach(source, NULL);
g_source_unref(source);
@@ -678,7 +678,7 @@
GSource *source = g_pollable_output_stream_create_source(
G_POLLABLE_OUTPUT_STREAM(bconv->output),
bconv->cancellable);
- g_source_set_callback(source, (GSourceFunc)_send_data_write_cb,
+ g_source_set_callback(source, G_SOURCE_FUNC(_send_data_write_cb),
bconv->pb, NULL);
bconv->tx_handler = g_source_attach(source, NULL);
g_source_unref(source);
@@ -692,8 +692,9 @@
#endif
static void
-_server_socket_handler(GSocketService *service, GSocketConnection *connection,
- GObject *source_object, gpointer data)
+_server_socket_handler(G_GNUC_UNUSED GSocketService *service,
+ GSocketConnection *connection,
+ G_GNUC_UNUSED GObject *source_object, gpointer data)
{
BonjourXMPP *jdata = data;
GSocketAddress *their_addr; /* connector's address information */
@@ -748,7 +749,7 @@
g_io_stream_get_output_stream(G_IO_STREAM(bconv->socket)));
source = g_pollable_input_stream_create_source(
G_POLLABLE_INPUT_STREAM(bconv->input), bconv->cancellable);
- g_source_set_callback(source, (GSourceFunc)_client_socket_handler,
+ g_source_set_callback(source, G_SOURCE_FUNC(_client_socket_handler),
bconv, NULL);
bconv->rx_handler = g_source_attach(source, NULL);
g_source_unref(source);
@@ -913,7 +914,7 @@
rx_source = g_pollable_input_stream_create_source(
G_POLLABLE_INPUT_STREAM(bb->conversation->input),
bb->conversation->cancellable);
- g_source_set_callback(rx_source, (GSourceFunc)_client_socket_handler,
+ g_source_set_callback(rx_source, G_SOURCE_FUNC(_client_socket_handler),
bb->conversation, NULL);
bb->conversation->rx_handler = g_source_attach(rx_source, NULL);
g_source_unref(rx_source);