Mercurial > pidgin.yaz
changeset 30849:6ee64d62c43c
merge of '4216577c2d7814344e8e1face579d153098986ad'
and 'be2c943ad5ecf372a5ba977319b2be4479e34dcc'
author | Elliott Sales de Andrade <qulogic@pidgin.im> |
---|---|
date | Sat, 14 Aug 2010 06:24:04 +0000 |
parents | 7c9a4235342c (current diff) 77ac5f4584bd (diff) |
children | 9d028dbd76f4 |
files | libpurple/protocols/jabber/jabber.c libpurple/protocols/msn/contact.c libpurple/protocols/oscar/family_advert.c libpurple/protocols/oscar/family_invite.c libpurple/protocols/oscar/family_odir.c libpurple/protocols/oscar/family_translate.c pidgin/gtkutils.c |
diffstat | 24 files changed, 58 insertions(+), 66 deletions(-) [+] |
line wrap: on
line diff
--- a/finch/libgnt/gntentry.c Sat Aug 14 04:39:07 2010 +0000 +++ b/finch/libgnt/gntentry.c Sat Aug 14 06:24:04 2010 +0000 @@ -480,7 +480,7 @@ { GntEntry *entry = GNT_ENTRY(bind); GList *iter; - const char *current , *pos; + const char *current; int len; if (entry->history->prev && entry->search->needle) @@ -497,7 +497,7 @@ const char *str = iter->data; /* A more utf8-friendly version of strstr would have been better, but * for now, this will have to do. */ - if ((pos = strstr(str, current))) + if (strstr(str, current) != NULL) break; }
--- a/finch/libgnt/gnttextview.c Sat Aug 14 04:39:07 2010 +0000 +++ b/finch/libgnt/gnttextview.c Sat Aug 14 06:24:04 2010 +0000 @@ -711,7 +711,7 @@ int gnt_text_view_get_lines_above(GntTextView *view) { int above = 0; - GList *list = view->list; + GList *list; list = g_list_nth(view->list, GNT_WIDGET(view)->priv.height); if (!list) return 0;
--- a/libpurple/log.c Sat Aug 14 04:39:07 2010 +0000 +++ b/libpurple/log.c Sat Aug 14 06:24:04 2010 +0000 @@ -1681,7 +1681,6 @@ struct tm tm; char month[4]; struct old_logger_data *data = NULL; - char *newlog; int logfound = 0; int lastoff = 0; int newlen; @@ -1783,7 +1782,7 @@ } while (fgets(buf, BUF_LONG, file)) { - if ((newlog = strstr(buf, "---- New C"))) { + if (strstr(buf, "---- New C") != NULL) { int length; int offset; char convostart[32];
--- a/libpurple/media/backend-fs2.c Sat Aug 14 04:39:07 2010 +0000 +++ b/libpurple/media/backend-fs2.c Sat Aug 14 06:24:04 2010 +0000 @@ -1791,7 +1791,7 @@ const gchar *sess_id) { PurpleMediaBackendFs2Private *priv; - gboolean ret; + gboolean ret = FALSE; g_return_val_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(self), FALSE);
--- a/libpurple/plugins/tcl/tcl_cmd.c Sat Aug 14 04:39:07 2010 +0000 +++ b/libpurple/plugins/tcl/tcl_cmd.c Sat Aug 14 06:24:04 2010 +0000 @@ -125,7 +125,7 @@ gchar **args, gchar **errors, struct tcl_cmd_handler *handler) { - int retval, error, i; + int retval, i; Tcl_Obj *command, *arg, *tclargs, *result; command = Tcl_NewListObj(0, NULL); @@ -153,8 +153,7 @@ } Tcl_ListObjAppendElement(handler->interp, command, tclargs); - if ((error = Tcl_EvalObjEx(handler->interp, command, - TCL_EVAL_GLOBAL)) != TCL_OK) { + if (Tcl_EvalObjEx(handler->interp, command, TCL_EVAL_GLOBAL) != TCL_OK) { gchar *errorstr; errorstr = g_strdup_printf("error evaluating callback: %s\n", @@ -164,8 +163,8 @@ retval = PURPLE_CMD_RET_FAILED; } else { result = Tcl_GetObjResult(handler->interp); - if ((error = Tcl_GetIntFromObj(handler->interp, result, - &retval)) != TCL_OK) { + if (Tcl_GetIntFromObj(handler->interp, result, + &retval) != TCL_OK) { gchar *errorstr; errorstr = g_strdup_printf("Error retreiving procedure result: %s\n",
--- a/libpurple/plugins/tcl/tcl_signals.c Sat Aug 14 04:39:07 2010 +0000 +++ b/libpurple/plugins/tcl/tcl_signals.c Sat Aug 14 06:24:04 2010 +0000 @@ -160,7 +160,7 @@ { GString *name, *val; PurpleBlistNode *node; - int error, i; + int i; void *retval = NULL; Tcl_Obj *cmd, *arg, *result; void **vals; /* Used for inout parameters */ @@ -335,7 +335,7 @@ } /* Call the friggin' procedure already */ - if ((error = Tcl_EvalObjEx(handler->interp, cmd, TCL_EVAL_GLOBAL)) != TCL_OK) { + if (Tcl_EvalObjEx(handler->interp, cmd, TCL_EVAL_GLOBAL) != TCL_OK) { purple_debug(PURPLE_DEBUG_ERROR, "tcl", "error evaluating callback: %s\n", Tcl_GetString(Tcl_GetObjResult(handler->interp))); } else { @@ -345,7 +345,7 @@ if (purple_value_get_type(handler->returntype) == PURPLE_TYPE_STRING) { retval = (void *)g_strdup(Tcl_GetString(result)); } else { - if ((error = Tcl_GetIntFromObj(handler->interp, result, (int *)&retval)) != TCL_OK) { + if (Tcl_GetIntFromObj(handler->interp, result, (int *)&retval) != TCL_OK) { purple_debug(PURPLE_DEBUG_ERROR, "tcl", "Error retrieving procedure result: %s\n", Tcl_GetString(Tcl_GetObjResult(handler->interp))); retval = NULL;
--- a/libpurple/protocols/bonjour/jabber.c Sat Aug 14 04:39:07 2010 +0000 +++ b/libpurple/protocols/bonjour/jabber.c Sat Aug 14 06:24:04 2010 +0000 @@ -1273,7 +1273,6 @@ static void xep_iq_parse(xmlnode *packet, PurpleBuddy *pb) { - xmlnode *child; PurpleAccount *account; PurpleConnection *gc; @@ -1283,7 +1282,7 @@ account = purple_buddy_get_account(pb); gc = purple_account_get_connection(account); - if ((child = xmlnode_get_child(packet, "si")) || (child = xmlnode_get_child(packet, "error"))) + if (xmlnode_get_child(packet, "si") != NULL || xmlnode_get_child(packet, "error") != NULL) xep_si_parse(gc, packet, pb); else xep_bytestreams_parse(gc, packet, pb);
--- a/libpurple/protocols/bonjour/mdns_avahi.c Sat Aug 14 04:39:07 2010 +0000 +++ b/libpurple/protocols/bonjour/mdns_avahi.c Sat Aug 14 06:24:04 2010 +0000 @@ -115,7 +115,6 @@ AvahiStringList *l; size_t size; char *key, *value; - int ret; char ip[AVAHI_ADDRESS_STR_MAX]; AvahiBuddyImplData *b_impl; AvahiSvcResolverData *rd; @@ -202,7 +201,7 @@ /* Obtain the parameters from the text_record */ clear_bonjour_buddy_values(bb); for(l = txt; l != NULL; l = l->next) { - if ((ret = avahi_string_list_get_pair(l, &key, &value, &size)) < 0) + if (avahi_string_list_get_pair(l, &key, &value, &size) < 0) continue; set_bonjour_buddy_value(bb, key, value, size); /* TODO: Since we're using the glib allocator, I think we
--- a/libpurple/protocols/jabber/bosh.c Sat Aug 14 04:39:07 2010 +0000 +++ b/libpurple/protocols/jabber/bosh.c Sat Aug 14 06:24:04 2010 +0000 @@ -711,11 +711,10 @@ /* Make sure Content-Length is in headers, not body */ if (content_length && (!end_of_headers || content_length < end_of_headers)) { const char *sep; - const char *eol; int len; if ((sep = strstr(content_length, ": ")) == NULL || - (eol = strstr(sep, "\r\n")) == NULL) + strstr(sep, "\r\n") == NULL) /* * The packet ends in the middle of the Content-Length line. * We'll try again later when we have more.
--- a/libpurple/protocols/jabber/disco.c Sat Aug 14 04:39:07 2010 +0000 +++ b/libpurple/protocols/jabber/disco.c Sat Aug 14 06:24:04 2010 +0000 @@ -604,7 +604,7 @@ /* we don't actually care about the specific nodes, * so we won't query them */ - if((node = xmlnode_get_attrib(child, "node"))) + if(xmlnode_get_attrib(child, "node") != NULL) continue; iq = jabber_iq_new_query(js, JABBER_IQ_GET, NS_DISCO_INFO);
--- a/libpurple/protocols/jabber/jabber.c Sat Aug 14 04:39:07 2010 +0000 +++ b/libpurple/protocols/jabber/jabber.c Sat Aug 14 06:24:04 2010 +0000 @@ -3493,7 +3493,7 @@ if (js->pep) { /* if no argument was given, unset mood */ - if (!args | !args[0]) { + if (!args || !args[0]) { jabber_mood_set(js, NULL, NULL); } else if (!args[1]) { jabber_mood_set(js, args[0], NULL);
--- a/libpurple/protocols/jabber/message.c Sat Aug 14 04:39:07 2010 +0000 +++ b/libpurple/protocols/jabber/message.c Sat Aug 14 06:24:04 2010 +0000 @@ -296,7 +296,6 @@ } static void handle_buzz(JabberMessage *jm) { - PurpleBuddy *buddy; PurpleAccount *account; /* Delayed buzz MUST NOT be accepted */ @@ -309,7 +308,7 @@ account = purple_connection_get_account(jm->js->gc); - if ((buddy = purple_find_buddy(account, jm->from)) == NULL) + if (purple_find_buddy(account, jm->from) == NULL) return; /* Do not accept buzzes from unknown people */ /* xmpp only has 1 attention type, so index is 0 */
--- a/libpurple/protocols/jabber/si.c Sat Aug 14 04:39:07 2010 +0000 +++ b/libpurple/protocols/jabber/si.c Sat Aug 14 06:24:04 2010 +0000 @@ -1734,7 +1734,7 @@ /* if they've already sent us this file transfer with the same damn id * then we're gonna ignore it, until I think of something better to do * with it */ - if((xfer = jabber_si_xfer_find(js, stream_id, from))) + if(jabber_si_xfer_find(js, stream_id, from) != NULL) return; jsx = g_new0(JabberSIXfer, 1);
--- a/libpurple/protocols/msn/contact.c Sat Aug 14 04:39:07 2010 +0000 +++ b/libpurple/protocols/msn/contact.c Sat Aug 14 06:24:04 2010 +0000 @@ -684,20 +684,20 @@ xmlnode *annotation; MsnUser *user; + g_free(passport); + g_free(Name); + g_free(uid); + g_free(type); + g_free(mobile_number); + g_free(alias); + passport = Name = uid = type = mobile_number = alias = NULL; + mobile = FALSE; + if (!(contactId = xmlnode_get_child(contactNode,"contactId")) || !(contactInfo = xmlnode_get_child(contactNode, "contactInfo")) || !(contactType = xmlnode_get_child(contactInfo, "contactType"))) continue; - g_free(passport); - g_free(Name); - g_free(alias); - g_free(uid); - g_free(type); - g_free(mobile_number); - passport = Name = uid = type = mobile_number = alias = NULL; - mobile = FALSE; - uid = xmlnode_get_data(contactId); type = xmlnode_get_data(contactType); @@ -836,6 +836,7 @@ g_free(uid); g_free(type); g_free(mobile_number); + g_free(alias); } static gboolean
--- a/libpurple/protocols/qq/char_conv.c Sat Aug 14 04:39:07 2010 +0000 +++ b/libpurple/protocols/qq/char_conv.c Sat Aug 14 06:24:04 2010 +0000 @@ -37,7 +37,7 @@ /* convert a string from from_charset to to_charset, using g_convert */ /* Warning: do not return NULL */ -static gchar *do_convert(const gchar *str, gssize len, const gchar *to_charset, const gchar *from_charset) +static gchar *do_convert(const gchar *str, gssize len, guint8 *out_len, const gchar *to_charset, const gchar *from_charset) { GError *error = NULL; gchar *ret; @@ -48,6 +48,8 @@ ret = g_convert(str, len, to_charset, from_charset, &byte_read, &byte_write, &error); if (error == NULL) { + if (out_len) + *out_len = byte_write; return ret; /* convert is OK */ } @@ -67,7 +69,8 @@ */ gint qq_get_vstr(gchar **ret, const gchar *from_charset, guint8 *data) { - guint8 len; + gssize len; + guint8 out_len; g_return_val_if_fail(data != NULL && from_charset != NULL, -1); @@ -76,9 +79,9 @@ *ret = g_strdup(""); return 1; } - *ret = do_convert((gchar *) (data + 1), (gssize) len, UTF8, from_charset); + *ret = do_convert((gchar *) (data + 1), len, &out_len, UTF8, from_charset); - return len + 1; + return out_len + 1; } gint qq_put_vstr(guint8 *buf, const gchar *str_utf8, const gchar *to_charset) @@ -86,12 +89,11 @@ gchar *str; guint8 len; - if (str_utf8 == NULL || (len = strlen(str_utf8)) == 0) { + if (str_utf8 == NULL || str_utf8[0] == '\0') { buf[0] = 0; return 1; } - str = do_convert(str_utf8, -1, to_charset, UTF8); - len = strlen(str_utf8); + str = do_convert(str_utf8, -1, &len, to_charset, UTF8); buf[0] = len; if (len > 0) { memcpy(buf + 1, str, len); @@ -102,12 +104,12 @@ /* Warning: do not return NULL */ gchar *utf8_to_qq(const gchar *str, const gchar *to_charset) { - return do_convert(str, -1, to_charset, UTF8); + return do_convert(str, -1, NULL, to_charset, UTF8); } /* Warning: do not return NULL */ gchar *qq_to_utf8(const gchar *str, const gchar *from_charset) { - return do_convert(str, -1, UTF8, from_charset); + return do_convert(str, -1, NULL, UTF8, from_charset); }
--- a/libpurple/protocols/qq/qq.c Sat Aug 14 04:39:07 2010 +0000 +++ b/libpurple/protocols/qq/qq.c Sat Aug 14 06:24:04 2010 +0000 @@ -382,12 +382,10 @@ { PurpleAccount *account; PurpleConnection *gc; - qq_data *qd; qq_buddy_data *buddy; if (!b || !(account = purple_buddy_get_account(b)) || - !(gc = purple_account_get_connection(account)) || - !(qd = purple_connection_get_protocol_data(gc))) + !(gc = purple_account_get_connection(account))) return NULL; buddy = purple_buddy_get_protocol_data(b);
--- a/libpurple/protocols/qq/qq_trans.c Sat Aug 14 04:39:07 2010 +0000 +++ b/libpurple/protocols/qq/qq_trans.c Sat Aug 14 06:24:04 2010 +0000 @@ -138,10 +138,11 @@ /* Remove a packet with seq from send trans */ static void trans_remove(PurpleConnection *gc, qq_transaction *trans) { - qq_data *qd = (qq_data *)gc->proto_data; + qq_data *qd; - g_return_if_fail(gc != NULL && gc->proto_data != NULL); + g_return_if_fail(gc != NULL); qd = (qq_data *) gc->proto_data; + g_return_if_fail(qd != NULL); g_return_if_fail(trans != NULL); #if 0
--- a/libpurple/protocols/yahoo/libymsg.c Sat Aug 14 04:39:07 2010 +0000 +++ b/libpurple/protocols/yahoo/libymsg.c Sat Aug 14 06:24:04 2010 +0000 @@ -502,8 +502,6 @@ char *temp = NULL; YahooFriend *f = NULL; /* It's your friends. They're going to want you to share your StarBursts. */ /* But what if you had no friends? */ - PurpleBuddy *b; - PurpleGroup *g; YahooFederation fed = YAHOO_FEDERATION_NONE; int stealth = 0; @@ -549,7 +547,9 @@ if (yd->current_list15_grp) { /* This buddy is in a group */ f = yahoo_friend_find_or_new(gc, norm_bud); - if (!(b = purple_find_buddy(account, norm_bud))) { + if (!purple_find_buddy(account, norm_bud)) { + PurpleBuddy *b; + PurpleGroup *g; if (!(g = purple_find_group(yd->current_list15_grp))) { g = purple_group_new(yd->current_list15_grp); purple_blist_add_group(g, NULL); @@ -636,8 +636,6 @@ GSList *l = pkt->hash; gboolean export = FALSE; gboolean got_serv_list = FALSE; - PurpleBuddy *b; - PurpleGroup *g; YahooFriend *f = NULL; PurpleAccount *account = purple_connection_get_account(gc); YahooData *yd = gc->proto_data; @@ -705,7 +703,9 @@ norm_bud = g_strdup(purple_normalize(account, *bud)); f = yahoo_friend_find_or_new(gc, norm_bud); - if (!(b = purple_find_buddy(account, norm_bud))) { + if (!purple_find_buddy(account, norm_bud)) { + PurpleBuddy *b; + PurpleGroup *g; if (!(g = purple_find_group(grp))) { g = purple_group_new(grp); purple_blist_add_group(g, NULL); @@ -3806,13 +3806,12 @@ { PurpleAccount *account; PurpleConnection *gc; - YahooData *yd; YahooFriend *f; PurplePresence *presence; if (!b || !(account = purple_buddy_get_account(b)) || !(gc = purple_account_get_connection(account)) || - !(yd = gc->proto_data)) + !gc->proto_data) return NULL; f = yahoo_friend_find(gc, purple_buddy_get_name(b));
--- a/libpurple/protocols/yahoo/yahoochat.c Sat Aug 14 04:39:07 2010 +0000 +++ b/libpurple/protocols/yahoo/yahoochat.c Sat Aug 14 06:24:04 2010 +0000 @@ -121,7 +121,6 @@ char *msg = NULL; GString *members = NULL; GHashTable *components; - PurpleConversation *c = NULL; if ( (pkt->status == 2) || (pkt->status == 11) ) return; /* Status is 11 when we are being notified about invitation being sent to someone else */ @@ -133,7 +132,7 @@ if (pair->key == 57) { room = yahoo_string_decode(gc, pair->value, FALSE); - if((c = yahoo_find_conference(gc, room))) + if (yahoo_find_conference(gc, room) != NULL) { /* Looks like we got invited to an already open conference. */ /* Laters: Should we accept this conference rather than ignoring the invitation ? */ @@ -880,7 +879,6 @@ { YahooData *yd = gc->proto_data; struct yahoo_packet *pkt; - PurpleConversation *c; char *eroom; gboolean utf8 = 1; @@ -905,7 +903,7 @@ yd->chat_name = NULL; } - if ((c = purple_find_chat(gc, YAHOO_CHAT_ID))) + if (purple_find_chat(gc, YAHOO_CHAT_ID) != NULL) serv_got_chat_left(gc, YAHOO_CHAT_ID); if (!logout)
--- a/libpurple/proxy.c Sat Aug 14 04:39:07 2010 +0000 +++ b/libpurple/proxy.c Sat Aug 14 06:24:04 2010 +0000 @@ -1023,7 +1023,7 @@ g_free(response); - } else if((header = g_strrstr((const char *)connect_data->read_buffer, "Proxy-Authenticate: Basic"))) { + } else if (g_strrstr((const char *)connect_data->read_buffer, "Proxy-Authenticate: Basic") != NULL) { gchar *t1, *t2; const char *username, *password;
--- a/pidgin/gtkblist.c Sat Aug 14 04:39:07 2010 +0000 +++ b/pidgin/gtkblist.c Sat Aug 14 06:24:04 2010 +0000 @@ -3168,7 +3168,6 @@ } else if (PURPLE_BLIST_NODE_IS_CONTACT(node)) { PurpleBlistNode *child; PurpleBuddy *b = purple_contact_get_priority_buddy((PurpleContact *)node); - width = height = 0; for(child = node->child; child; child = child->next) {
--- a/pidgin/gtksourceundomanager.c Sat Aug 14 04:39:07 2010 +0000 +++ b/pidgin/gtksourceundomanager.c Sat Aug 14 06:24:04 2010 +0000 @@ -963,7 +963,7 @@ * the stack with a new undo action. So when we undo for example * typing, we can undo the whole word and not each letter by itself. * - * Return Value: %TRUE is merge was successful, %FALSE otherwise.² + * Return Value: %TRUE is merge was successful, %FALSE otherwise. **/ static gboolean gtk_source_undo_manager_merge_action (GtkSourceUndoManager *um,
--- a/pidgin/gtkutils.c Sat Aug 14 04:39:07 2010 +0000 +++ b/pidgin/gtkutils.c Sat Aug 14 06:24:04 2010 +0000 @@ -1036,7 +1036,7 @@ char *username = NULL; char *alias = NULL; char *str; - char *c, *s; + char *s; gboolean valid; g_return_val_if_fail(msg != NULL, FALSE); @@ -1078,7 +1078,7 @@ if (*s == '\r') *s++ = '\0'; if (*s == '\n') *s++ = '\0'; - if ((c = strchr(key, ':')) != NULL) + if (strchr(key, ':') != NULL) { if (!g_ascii_strcasecmp(key, "X-IM-Username:")) username = g_strdup(value);
--- a/pidgin/plugins/xmppconsole.c Sat Aug 14 04:39:07 2010 +0000 +++ b/pidgin/plugins/xmppconsole.c Sat Aug 14 06:24:04 2010 +0000 @@ -183,7 +183,7 @@ { GtkTextIter start, end; PurplePluginProtocolInfo *prpl_info = NULL; - PurpleConnection *gc = console->gc; + PurpleConnection *gc; GtkTextBuffer *buffer; char *text;