pidgin/pidgin

Merged in default (pull request #625)

2019-11-04, Gary Kramlich
e7b673f290bb
Merged in default (pull request #625)

Remove some redundant code

Approved-by: Gary Kramlich
--- a/finch/gntblist.c Mon Nov 04 11:01:03 2019 +0000
+++ b/finch/gntblist.c Mon Nov 04 11:09:31 2019 +0000
@@ -2066,8 +2066,6 @@
PURPLE_SIGNAL_PRIORITY_HIGHEST);
finch_blist_install_manager(&default_manager);
-
- return;
}
static gboolean
--- a/finch/plugins/gntclipboard.c Mon Nov 04 11:01:03 2019 +0000
+++ b/finch/plugins/gntclipboard.c Mon Nov 04 11:09:31 2019 +0000
@@ -90,7 +90,6 @@
return;
}
}
- return;
}
static void
--- a/libpurple/buddylist.c Mon Nov 04 11:01:03 2019 +0000
+++ b/libpurple/buddylist.c Mon Nov 04 11:09:31 2019 +0000
@@ -727,9 +727,7 @@
buddies_cache = g_hash_table_new_full(g_direct_hash, g_direct_equal,
NULL, (GDestroyNotify)g_hash_table_destroy);
- groups_cache = g_hash_table_new_full((GHashFunc)g_str_hash,
- (GEqualFunc)g_str_equal,
- (GDestroyNotify)g_free, NULL);
+ groups_cache = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL);
for (account = purple_accounts_get_all(); account != NULL; account = account->next)
{
--- a/libpurple/plugins/keyrings/internalkeyring.c Mon Nov 04 11:01:03 2019 +0000
+++ b/libpurple/plugins/keyrings/internalkeyring.c Mon Nov 04 11:09:31 2019 +0000
@@ -849,7 +849,7 @@
*mode = "ciphertext";
*data = ciphertext;
- *destroy = (GDestroyNotify)g_free;
+ *destroy = g_free;
return TRUE;
}
--- a/libpurple/presence.c Mon Nov 04 11:01:03 2019 +0000
+++ b/libpurple/presence.c Mon Nov 04 11:09:31 2019 +0000
@@ -462,7 +462,7 @@
purple_presence_get_instance_private(PURPLE_PRESENCE(object));
if (priv->statuses) {
- g_list_free_full(priv->statuses, (GDestroyNotify)g_object_unref);
+ g_list_free_full(priv->statuses, g_object_unref);
priv->statuses = NULL;
}
--- a/libpurple/protocols.c Mon Nov 04 11:01:03 2019 +0000
+++ b/libpurple/protocols.c Mon Nov 04 11:09:31 2019 +0000
@@ -690,7 +690,7 @@
void *handle = purple_protocols_get_handle();
protocols = g_hash_table_new_full(g_str_hash, g_str_equal, g_free,
- (GDestroyNotify)g_object_unref);
+ g_object_unref);
purple_signal_register(handle, "protocol-added",
purple_marshal_VOID__POINTER,
--- a/libpurple/protocols/bonjour/bonjour_ft.c Mon Nov 04 11:01:03 2019 +0000
+++ b/libpurple/protocols/bonjour/bonjour_ft.c Mon Nov 04 11:09:31 2019 +0000
@@ -33,7 +33,7 @@
bonjour_xfer_init(PurpleXfer *xfer);
static void
bonjour_xfer_receive(PurpleConnection *pc, const char *id, const char *sid, const char *from,
- const goffset filesize, const char *filename, int option);
+ goffset filesize, const char *filename, int option);
/* Look for specific xfer handle */
static unsigned int next_id = 0;
@@ -727,7 +727,7 @@
static void
bonjour_xfer_receive(PurpleConnection *pc, const char *id, const char *sid, const char *from,
- const goffset filesize, const char *filename, int option)
+ goffset filesize, const char *filename, int option)
{
PurpleXfer *xfer;
XepXfer *xf;
@@ -877,7 +877,6 @@
default:
break;
}
- return;
}
static void
@@ -943,8 +942,6 @@
bonjour_bytestreams_listen, xfer);
if (xf->listen_data == NULL)
purple_xfer_cancel_local(xfer);
-
- return;
}
static void
--- a/libpurple/protocols/facebook/api.c Mon Nov 04 11:01:03 2019 +0000
+++ b/libpurple/protocols/facebook/api.c Mon Nov 04 11:09:31 2019 +0000
@@ -2339,7 +2339,7 @@
g_signal_emit_by_name(api, "contacts-delta", added, removed);
g_slist_free_full(added, (GDestroyNotify) fb_api_user_free);
- g_slist_free_full(removed, (GDestroyNotify) g_free);
+ g_slist_free_full(removed, g_free);
g_list_free(elms);
json_array_unref(arr);
--- a/libpurple/protocols/gg/blist.c Mon Nov 04 11:01:03 2019 +0000
+++ b/libpurple/protocols/gg/blist.c Mon Nov 04 11:09:31 2019 +0000
@@ -187,7 +187,7 @@
}
/* }}} */
-const char * ggp_buddylist_get_buddy_name(PurpleConnection *gc, const uin_t uin)
+const char * ggp_buddylist_get_buddy_name(PurpleConnection *gc, uin_t uin)
{
const char *uin_s = ggp_uin_to_str(uin);
PurpleBuddy *buddy = purple_blist_find_buddy(
--- a/libpurple/protocols/gg/blist.h Mon Nov 04 11:01:03 2019 +0000
+++ b/libpurple/protocols/gg/blist.h Mon Nov 04 11:09:31 2019 +0000
@@ -57,7 +57,7 @@
* @return Name of the buddy, or UIN converted to string, if there is no such
* user on the list.
*/
-const char * ggp_buddylist_get_buddy_name(PurpleConnection *gc, const uin_t uin);
+const char * ggp_buddylist_get_buddy_name(PurpleConnection *gc, uin_t uin);
#endif /* PURPLE_GG_BLIST_H */
--- a/libpurple/protocols/irc/cmds.c Mon Nov 04 11:01:03 2019 +0000
+++ b/libpurple/protocols/irc/cmds.c Mon Nov 04 11:09:31 2019 +0000
@@ -694,6 +694,4 @@
irc_send(irc, buf);
g_free(buf);
}
-
- return;
}
--- a/libpurple/protocols/irc/msgs.c Mon Nov 04 11:01:03 2019 +0000
+++ b/libpurple/protocols/irc/msgs.c Mon Nov 04 11:09:31 2019 +0000
@@ -333,8 +333,6 @@
purple_conversation_write_system_message(PURPLE_CONVERSATION(chat), buf, 0);
g_free(escaped);
g_free(buf);
-
- return;
}
void irc_msg_whois(struct irc_conn *irc, const char *name, const char *from, char **args)
@@ -495,8 +493,8 @@
}
realname = g_strdup(cur);
- g_object_set_data_full(G_OBJECT(cb), "userhost", userhost, (GDestroyNotify)g_free);
- g_object_set_data_full(G_OBJECT(cb), "realname", realname, (GDestroyNotify)g_free);
+ g_object_set_data_full(G_OBJECT(cb), "userhost", userhost, g_free);
+ g_object_set_data_full(G_OBJECT(cb), "realname", realname, g_free);
flags = purple_chat_user_get_flags(cb);
@@ -971,7 +969,7 @@
cb = purple_chat_conversation_find_user(chat, nick);
if (cb) {
- g_object_set_data_full(G_OBJECT(cb), "userhost", userhost, (GDestroyNotify)g_free);
+ g_object_set_data_full(G_OBJECT(cb), "userhost", userhost, g_free);
}
if ((ib = g_hash_table_lookup(irc->buddies, nick)) != NULL) {
@@ -1010,7 +1008,6 @@
}
g_free(nick);
- return;
}
void irc_msg_mode(struct irc_conn *irc, const char *name, const char *from, char **args)
@@ -1362,8 +1359,6 @@
irc_buddy_status(data[0], ib, irc);
}
g_free(data[0]);
-
- return;
}
void irc_msg_unavailable(struct irc_conn *irc, const char *name, const char *from, char **args)
--- a/libpurple/protocols/jabber/google/gmail.c Mon Nov 04 11:01:03 2019 +0000
+++ b/libpurple/protocols/jabber/google/gmail.c Mon Nov 04 11:09:31 2019 +0000
@@ -176,7 +176,6 @@
purple_xmlnode_set_attrib(query, "newer-than-tid", js->gmail_last_tid);
jabber_iq_send(iq);
- return;
}
void jabber_gmail_init(JabberStream *js) {
--- a/libpurple/protocols/simple/simple.c Mon Nov 04 11:01:03 2019 +0000
+++ b/libpurple/protocols/simple/simple.c Mon Nov 04 11:09:31 2019 +0000
@@ -117,7 +117,6 @@
purple_debug_error("simple", "failed sending keep alive\n");
}
}
- return;
}
static gboolean process_register_response(struct simple_account_data *sip, struct sipmsg *msg, struct transaction *tc);
--- a/libpurple/protocols/zephyr/Zinternal.c Mon Nov 04 11:01:03 2019 +0000
+++ b/libpurple/protocols/zephyr/Zinternal.c Mon Nov 04 11:09:31 2019 +0000
@@ -850,7 +850,6 @@
qptr->prev->next = qptr->next;
qptr->next->prev = qptr->prev;
free ((char *)qptr);
- return;
}
Code_t Z_SendFragmentedNotice(notice, len, cert_func, send_func)
--- a/libpurple/protocols/zephyr/zephyr.c Mon Nov 04 11:01:03 2019 +0000
+++ b/libpurple/protocols/zephyr/zephyr.c Mon Nov 04 11:09:31 2019 +0000
@@ -55,10 +55,7 @@
static GSList *cmds = NULL;
extern Code_t ZGetLocations(ZLocations_t *, int *);
-extern Code_t ZSetLocation(char *);
-extern Code_t ZUnsetLocation(void);
extern Code_t ZGetSubscriptions(ZSubscription_t *, int*);
-extern char __Zephyr_realm[];
typedef struct _zframe zframe;
typedef struct _zephyr_triple zephyr_triple;
typedef struct _zephyr_account zephyr_account;
@@ -1333,25 +1330,9 @@
/* XXX add real error reporting */
/* doesn't matter if this fails or not; we'll just move on to the next one */
if (use_zeph02(zephyr)) {
-#ifdef WIN32
- int numlocs;
- int one=1;
- ZLocateUser(chk,&numlocs,ZAUTH);
- if (numlocs) {
- int i;
- for(i=0;i<numlocs;i++) {
- ZGetLocations(&locations,&one);
- if (nlocs>0)
- purple_protocol_got_user_status(account,name,"available",NULL);
- else
- purple_protocol_got_user_status(account,name,"offline",NULL);
- }
- }
-#else
ZRequestLocations(chk, &ald, UNACKED, ZAUTH);
g_free(ald.user);
g_free(ald.version);
-#endif /* WIN32 */
} else
if (use_tzc(zephyr)) {
gchar *zlocstr = g_strdup_printf("((tzcfodder . zlocate) \"%s\")\n",chk);
@@ -1419,8 +1400,6 @@
}
g_strlcpy(zephyr->ourhostcanon, hent->h_name, sizeof(zephyr->ourhostcanon));
-
- return;
}
static void process_zsubs(zephyr_account *zephyr)
@@ -2601,7 +2580,6 @@
topic_utf8 = zephyr_recv_convert(gc,(gchar *)topic);
purple_chat_conversation_set_topic(gcc,sender,topic_utf8);
g_free(topic_utf8);
- return;
}
/* commands */
--- a/pidgin/gtkconv.c Mon Nov 04 11:01:03 2019 +0000
+++ b/pidgin/gtkconv.c Mon Nov 04 11:09:31 2019 +0000
@@ -2258,7 +2258,7 @@
win = pidgin_buddy_icon_chooser_new(GTK_WINDOW(toplevel),
custom_icon_sel_cb, contact);
g_object_set_data_full(G_OBJECT(contact), "buddy-icon-chooser", win,
- (GDestroyNotify)g_object_unref);
+ g_object_unref);
}
gtk_native_dialog_show(GTK_NATIVE_DIALOG(win));
}
@@ -2744,7 +2744,7 @@
buddy = purple_buddy_new(account, purple_conversation_get_name(conv), NULL);
purple_blist_node_set_transient((PurpleBlistNode *)buddy, TRUE);
g_object_set_data_full(G_OBJECT(gtkconv->history), "transient_buddy",
- buddy, (GDestroyNotify)g_object_unref);
+ buddy, g_object_unref);
}
}
}
--- a/pidgin/gtknotify.c Mon Nov 04 11:01:03 2019 +0000
+++ b/pidgin/gtknotify.c Mon Nov 04 11:09:31 2019 +0000
@@ -360,7 +360,7 @@
}
static void
-reset_mail_dialog(GtkDialog *unused)
+reset_mail_dialog(gpointer unused)
{
g_return_if_fail(mail_dialog != NULL);
@@ -841,7 +841,7 @@
pidgin_blist_set_headline(label_text, "mail-unread",
G_CALLBACK(pidgin_notify_emails_present),
mail_dialog->dialog,
- (GDestroyNotify)reset_mail_dialog);
+ reset_mail_dialog);
mail_dialog->in_use = FALSE;
g_free(label_text);
} else if (!gtk_widget_has_focus(mail_dialog->dialog))
@@ -1555,8 +1555,6 @@
g_object_unref(icon);
gtk_widget_show_all(pounce_dialog->dialog);
-
- return;
}
static PidginNotifyDialog *
--- a/pidgin/gtkutils.c Mon Nov 04 11:01:03 2019 +0000
+++ b/pidgin/gtkutils.c Mon Nov 04 11:09:31 2019 +0000
@@ -699,7 +699,7 @@
if (*s != '\0') *s++ = '\0';
/* Clear past any whitespace */
- while (*s != '\0' && *s == ' ')
+ while (*s == ' ')
s++;
/* Now let's grab until the end of the line. */
--- a/pidgin/libpidgin.c Mon Nov 04 11:01:03 2019 +0000
+++ b/pidgin/libpidgin.c Mon Nov 04 11:09:31 2019 +0000
@@ -152,7 +152,7 @@
}
written = write(signal_sockets[0], &sig, sizeof(int));
- if (written < 0 || written != sizeof(int)) {
+ if (written != sizeof(int)) {
/* This should never happen */
purple_debug_error("sighandler", "Received signal %d but only "
"wrote %" G_GSSIZE_FORMAT " bytes out of %"
--- a/pidgin/plugins/spellchk.c Mon Nov 04 11:01:03 2019 +0000
+++ b/pidgin/plugins/spellchk.c Mon Nov 04 11:09:31 2019 +0000
@@ -677,7 +677,6 @@
g_signal_connect(G_OBJECT(gtkconv->entry), "message_send",
G_CALLBACK(message_send_cb), spell);
- return;
}
static int buf_get_line(char *ibuf, char **buf, gsize *position, gsize len)