pidgin/android/libpurple

Remove various array comparisons to NULL because they're silly
release-2.x.y
2013-02-24, Daniel Atallah
eb88fd4cbced
Parents 909e73523124
Children 83e5594ced88
Remove various array comparisons to NULL because they're silly
--- a/libpurple/protocols/mxit/login.c Sun Feb 24 21:23:29 2013 -0500
+++ b/libpurple/protocols/mxit/login.c Sun Feb 24 22:21:31 2013 -0500
@@ -743,7 +743,7 @@
* if we don't have any info saved from a previous login, we need to get it from the MXit WAP site.
* we do cache it, so this step is only done on the very first login for each account.
*/
- if ( ( session->distcode == NULL ) || ( strlen( session->distcode ) == 0 ) ) {
+ if ( strlen( session->distcode ) == 0 ) {
/* this must be the very first login, so we need to retrieve the user information */
get_clientinfo( session );
}
--- a/libpurple/protocols/silc/buddy.c Sun Feb 24 21:23:29 2013 -0500
+++ b/libpurple/protocols/silc/buddy.c Sun Feb 24 22:21:31 2013 -0500
@@ -1546,13 +1546,10 @@
if (!client_entry)
return;
- if (client_entry->nickname)
- purple_notify_user_info_add_pair(user_info, _("Nickname"),
+ purple_notify_user_info_add_pair(user_info, _("Nickname"),
client_entry->nickname);
- if (client_entry->username && client_entry->hostname) {
- g_snprintf(tmp, sizeof(tmp), "%s@%s", client_entry->username, client_entry->hostname);
- purple_notify_user_info_add_pair(user_info, _("Username"), tmp);
- }
+ g_snprintf(tmp, sizeof(tmp), "%s@%s", client_entry->username, client_entry->hostname);
+ purple_notify_user_info_add_pair(user_info, _("Username"), tmp);
if (client_entry->mode) {
memset(tmp, 0, sizeof(tmp));
silcpurple_get_umode_string(client_entry->mode,
--- a/libpurple/protocols/silc/ops.c Sun Feb 24 21:23:29 2013 -0500
+++ b/libpurple/protocols/silc/ops.c Sun Feb 24 22:21:31 2013 -0500
@@ -214,13 +214,10 @@
if (channel)
serv_got_chat_in(gc, purple_conv_chat_get_id(PURPLE_CONV_CHAT(convo)),
- sender->nickname ?
- sender->nickname :
- "<unknown>", cflags,
+ sender->nickname, cflags,
tmp, time(NULL));
else
- serv_got_im(gc, sender->nickname ?
- sender->nickname : "<unknown>",
+ serv_got_im(gc, sender->nickname,
tmp, cflags, time(NULL));
purple_imgstore_unref_by_id(imgid);
@@ -362,15 +359,14 @@
{
PurpleConnection *gc = client->application;
SilcPurple sg = gc->proto_data;
- PurpleConversation *convo = NULL;
+ PurpleConversation *convo;
char *msg, *tmp;
if (!message)
return;
- if (sender->nickname)
- /* XXX - Should this be PURPLE_CONV_TYPE_IM? */
- convo = purple_find_conversation_with_account(PURPLE_CONV_TYPE_ANY,
+ /* XXX - Should this be PURPLE_CONV_TYPE_IM? */
+ convo = purple_find_conversation_with_account(PURPLE_CONV_TYPE_ANY,
sender->nickname, sg->account);
if (flags & SILC_MESSAGE_FLAG_SIGNED &&
--- a/libpurple/protocols/zephyr/zephyr.c Sun Feb 24 21:23:29 2013 -0500
+++ b/libpurple/protocols/zephyr/zephyr.c Sun Feb 24 22:21:31 2013 -0500
@@ -927,12 +927,10 @@
}
else {
int i;
- if (tree->children) {
- for(i=0;i<tree->num_children;i++){
- if (tree->children[i]) {
- free_parse_tree(tree->children[i]);
- g_free(tree->children[i]);
- }
+ for(i=0;i<tree->num_children;i++){
+ if (tree->children[i]) {
+ free_parse_tree(tree->children[i]);
+ g_free(tree->children[i]);
}
}
if ((tree != &null_parse_tree) && (tree->contents != NULL))