Mercurial > pidgin
changeset 4201:511c2b63caa4
[gaim-migrate @ 4432]
Some code cleanups to remove warnings and fix up indenting a little.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Sat, 04 Jan 2003 21:01:32 +0000 |
parents | c8fb43808a4b |
children | 59751fe608c5 |
files | plugins/timestamp.c src/buddy_chat.c src/conversation.c src/dialogs.c src/ft.c src/gaimrc.c src/gtkimhtml.c src/idle.c src/prefs.c src/protocols/gg/gg.c src/protocols/irc/irc.c src/protocols/msn/msn.c src/protocols/oscar/oscar.c src/protocols/toc/toc.c src/protocols/yahoo/yahoo.c src/server.c |
diffstat | 16 files changed, 140 insertions(+), 162 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/timestamp.c Sat Jan 04 19:41:07 2003 +0000 +++ b/plugins/timestamp.c Sat Jan 04 21:01:32 2003 +0000 @@ -11,8 +11,9 @@ GModule *handle; GSList *timestamp_timeouts; -gboolean do_timestamp (struct conversation *c) +gboolean do_timestamp (gpointer data) { + struct conversation *c = data; char *buf; char mdate[6]; time_t tim = time(NULL);
--- a/src/buddy_chat.c Sat Jan 04 19:41:07 2003 +0000 +++ b/src/buddy_chat.c Sat Jan 04 21:01:32 2003 +0000 @@ -42,12 +42,6 @@ #include "pixmaps/join.xpm" /*#include "pixmaps/close.xpm"*/ #include "pixmaps/cancel.xpm" -#include "pixmaps/tmp_send.xpm" -#include "pixmaps/gnome_add.xpm" -#include "pixmaps/gnome_remove.xpm" -#include "pixmaps/block.xpm" -#include "pixmaps/warn.xpm" -#include "pixmaps/tb_search.xpm" GtkWidget *joinchat; static struct gaim_connection *joinchatgc; @@ -1507,7 +1501,6 @@ static GtkWidget *change_text(GtkWidget *win, char *text, GtkWidget *button, char *stock, int chat) { int dispstyle = set_dispstyle(chat); - GtkWidget *parent = button->parent; gtk_widget_destroy(button); /* XXX button = picture_button2(win, text, xpm, dispstyle); */ button = gaim_pixbuf_button_from_stock((dispstyle == 0 ? NULL : text), @@ -1570,7 +1563,6 @@ struct conversation *c; GtkWidget *parent; int opt = 0; - int dispstyle = set_dispstyle(0); while (bcs) { c = (struct conversation *)bcs->data;
--- a/src/conversation.c Sat Jan 04 19:41:07 2003 +0000 +++ b/src/conversation.c Sat Jan 04 21:01:32 2003 +0000 @@ -1203,7 +1203,7 @@ char imgtag[1024]; if (stat(tmplist->data, &st) != 0) { - debug_printf("Could not stat %s\n", tmplist->data); + debug_printf("Could not stat %s\n", (char *)tmplist->data); tmplist = tmplist->next; continue; } @@ -1219,7 +1219,7 @@ filename, id, (int)st.st_size); if (strstr(buffy, imgtag) == 0) { - debug_printf("Not sending image: %s\n", tmplist->data); + debug_printf("Not sending image: %s\n", (char *)tmplist->data); tmplist = tmplist->next; continue; } @@ -1238,7 +1238,7 @@ length = length + strlen(imgtag) + st.st_size + strlen("</DATA>");; bigbuf = g_realloc(bigbuf, length + 1); if (!(imgfile = fopen(tmplist->data, "r"))) { - debug_printf("Could not open %s\n", tmplist->data); + debug_printf("Could not open %s\n", (char *)tmplist->data); tmplist = tmplist->next; continue; }
--- a/src/dialogs.c Sat Jan 04 19:41:07 2003 +0000 +++ b/src/dialogs.c Sat Jan 04 21:01:32 2003 +0000 @@ -59,8 +59,6 @@ #include "pixmaps/ok.xpm" #include "pixmaps/add.xpm" #include "pixmaps/close.xpm" -#include "pixmaps/gnome_add.xpm" -#include "pixmaps/gnome_remove.xpm" #include "pixmaps/protocols/oscar/aol_icon.xpm" #include "pixmaps/protocols/oscar/free_icon.xpm" @@ -1054,12 +1052,7 @@ void show_add_buddy(struct gaim_connection *gc, char *buddy, char *group, char *alias) { - GtkWidget *mainbox; - GtkWidget *frame; GtkWidget *table; - GtkWidget *bbox; - GtkWidget *cancel; - GtkWidget *add; GtkWidget *label; GtkWidget *hbox; GtkWidget *vbox; @@ -1370,7 +1363,6 @@ static void pref_deny_rem(GtkWidget *button, gboolean permit) { - GList *i; gchar *who; GtkTreeIter iter; GtkTreeModel *mod; @@ -1455,7 +1447,6 @@ GtkWidget *box; GtkWidget *hbox; GtkWidget *label; - GtkWidget *vbox; GtkWidget *sw; GtkWidget *bbox; GtkWidget *button; @@ -1463,8 +1454,6 @@ GtkWidget *close_button; GtkSizeGroup *sg1 = gtk_size_group_new(GTK_SIZE_GROUP_BOTH); GtkSizeGroup *sg2 = gtk_size_group_new(GTK_SIZE_GROUP_BOTH); - GtkListStore *ls; - GtkWidget *list; GtkCellRenderer *rend; GtkTreeViewColumn *col; GtkWidget *table; @@ -2507,8 +2496,6 @@ const char *who; char *name; - GtkTreeIter iter; - GtkListStore *ls; who = gtk_entry_get_text(GTK_ENTRY(p->entry)); @@ -4335,7 +4322,7 @@ GtkWidget *label; char *filename = g_build_filename(DATADIR, "pixmaps", "gaim", "dialogs", "gaim_question.png", NULL); GtkWidget *img = gtk_image_new_from_file(filename); - GtkWidget *name_entry; + GtkWidget *name_entry = NULL; g_free(filename); @@ -4382,7 +4369,8 @@ } gtk_widget_show_all(rename_dialog); - gtk_widget_grab_focus(GTK_WIDGET(name_entry)); + if(name_entry) + gtk_widget_grab_focus(GTK_WIDGET(name_entry)); }
--- a/src/ft.c Sat Jan 04 19:41:07 2003 +0000 +++ b/src/ft.c Sat Jan 04 21:01:32 2003 +0000 @@ -570,7 +570,7 @@ GaimInputCondition condition) { struct file_transfer *xfer = (struct file_transfer *)data; - int rt, i; + int rt; char *buf = NULL; if (condition & GAIM_INPUT_READ) {
--- a/src/gaimrc.c Sat Jan 04 19:41:07 2003 +0000 +++ b/src/gaimrc.c Sat Jan 04 21:01:32 2003 +0000 @@ -32,6 +32,7 @@ #include <sys/types.h> #include <sys/stat.h> +#include <ctype.h> #include <stdio.h> #include <stdlib.h> #include "gaim.h"
--- a/src/gtkimhtml.c Sat Jan 04 19:41:07 2003 +0000 +++ b/src/gtkimhtml.c Sat Jan 04 21:01:32 2003 +0000 @@ -641,10 +641,7 @@ GString *str = NULL; GtkTextIter iter, siter; GtkTextMark *mark, *mark2; - GtkTextChildAnchor *anchor; GtkTextTag *texttag; - GtkWidget *sep; - GtkRequisition req; gchar *ws; gchar *tag; gchar *url = NULL;
--- a/src/idle.c Sat Jan 04 19:41:07 2003 +0000 +++ b/src/idle.c Sat Jan 04 21:01:32 2003 +0000 @@ -51,7 +51,7 @@ static XScreenSaverInfo *mit_info = NULL; #endif #endif - time_t idle_time; + int idle_time; /* Not idle, really... :) */ update_idle_times();
--- a/src/prefs.c Sat Jan 04 19:41:07 2003 +0000 +++ b/src/prefs.c Sat Jan 04 21:01:32 2003 +0000 @@ -1553,7 +1553,6 @@ static void build_debug() { GtkWidget *sw; - GtkWidget *box; GtkTextBuffer *buffer; GtkTextIter end;
--- a/src/protocols/gg/gg.c Sat Jan 04 19:41:07 2003 +0000 +++ b/src/protocols/gg/gg.c Sat Jan 04 21:01:32 2003 +0000 @@ -1,6 +1,6 @@ /* * gaim - Gadu-Gadu Protocol Plugin - * $Id: gg.c 4326 2002-12-21 19:33:54Z chipx86 $ + * $Id: gg.c 4432 2003-01-04 21:01:32Z chipx86 $ * * Copyright (C) 2001 Arkadiusz Mi¶kiewicz <misiek@pld.ORG.PL> * @@ -399,7 +399,7 @@ } break; case GG_EVENT_ACK: - debug_printf("main_callback: message %d to %u sent with status %d\n", + debug_printf("main_callback: message %d to %lu sent with status %d\n", e->event.ack.seq, e->event.ack.recipient, e->event.ack.status); break; default:
--- a/src/protocols/irc/irc.c Sat Jan 04 19:41:07 2003 +0000 +++ b/src/protocols/irc/irc.c Sat Jan 04 21:01:32 2003 +0000 @@ -1445,143 +1445,146 @@ /* CTCP by jonas@birme.se */ static void irc_parse_notice(struct gaim_connection *gc, char *nick, char *ex, - char *word[], char *word_eol[]) + char *word[], char *word_eol[]) { - char buf[IRC_BUF_LEN]; + char buf[IRC_BUF_LEN]; + + if (!g_strcasecmp(word[4], ":\001CLIENTINFO")) { + char *p = g_strrstr(word_eol[5], "\001"); + *p = 0; + g_snprintf(buf, sizeof(buf), "CTCP Answer: %s", word_eol[5]); + do_error_dialog(buf, _("CTCP ClientInfo"), GAIM_INFO); + + } else if (!g_strcasecmp(word[4], ":\001USERINFO")) { + char *p = g_strrstr(word_eol[5], "\001"); + *p = 0; + g_snprintf(buf, sizeof(buf), "CTCP Answer: %s", word_eol[5]); + do_error_dialog(buf, _("CTCP UserInfo"), GAIM_INFO); + + } else if (!g_strcasecmp(word[4], ":\001VERSION")) { + char *p = g_strrstr(word_eol[5], "\001"); + *p = 0; + g_snprintf(buf, sizeof(buf), "CTCP Answer: %s", word_eol[5]); + do_error_dialog(buf, _("CTCP Version"), GAIM_INFO); + + } else if (!g_strcasecmp(word[4], ":\001PING")) { + char *p = g_strrstr(word_eol[5], "\001"); + struct timeval ping_time; + struct timeval now; + gchar **vector; - if (!g_strcasecmp(word[4], ":\001CLIENTINFO")) { - char *p = g_strrstr(word_eol[5], "\001"); - *p = 0; - g_snprintf(buf, sizeof(buf), "CTCP Answer: %s", - word_eol[5]); - do_error_dialog(buf, _("CTCP ClientInfo"), GAIM_INFO); - } else if (!g_strcasecmp(word[4], ":\001USERINFO")) { - char *p = g_strrstr(word_eol[5], "\001"); - *p = 0; - g_snprintf(buf, sizeof(buf), "CTCP Answer: %s", - word_eol[5]); - do_error_dialog(buf, _("CTCP UserInfo"), GAIM_INFO); - } else if (!g_strcasecmp(word[4], ":\001VERSION")) { - char *p = g_strrstr(word_eol[5], "\001"); - *p = 0; - g_snprintf(buf, sizeof(buf), "CTCP Answer: %s", - word_eol[5]); - do_error_dialog(buf, _("CTCP Version"), GAIM_INFO); - } else if (!g_strcasecmp(word[4], ":\001PING")) { - char *p = g_strrstr(word_eol[5], "\001"); - struct timeval ping_time; - struct timeval now; - gchar **vector; - if (p) - *p = 0; - vector = g_strsplit(word_eol[5], " ", 2); - if (gettimeofday(&now, NULL) == 0 && vector != NULL) { - if (now.tv_usec - atol(vector[1]) < 0) { - ping_time.tv_sec = now.tv_sec - atol(vector[0]) - 1; - ping_time.tv_usec = now.tv_usec - atol(vector[1]) + 1000000; - } else { - ping_time.tv_sec = now.tv_sec - atol(vector[0]); - ping_time.tv_usec = now.tv_usec - atol(vector[1]); - } - g_snprintf(buf, sizeof(buf), - "CTCP Ping reply from %s: %lu.%.03lu seconds", - nick, ping_time.tv_sec, (ping_time.tv_usec/1000)); - do_error_dialog(buf, _("CTCP Ping"), GAIM_INFO); - g_strfreev(vector); - } - } else { - if (*word_eol[4] == ':') word_eol[4]++; - if (ex) - irc_got_im(gc, nick, word_eol[4], 0, - time(NULL)); - } + if (p) + *p = 0; + + vector = g_strsplit(word_eol[5], " ", 2); + + if (gettimeofday(&now, NULL) == 0 && vector != NULL) { + if (now.tv_usec - atol(vector[1]) < 0) { + ping_time.tv_sec = now.tv_sec - atol(vector[0]) - 1; + ping_time.tv_usec = now.tv_usec - atol(vector[1]) + 1000000; + } else { + ping_time.tv_sec = now.tv_sec - atol(vector[0]); + ping_time.tv_usec = now.tv_usec - atol(vector[1]); + } + + g_snprintf(buf, sizeof(buf), + "CTCP Ping reply from %s: %lu.%.03lu seconds", + nick, ping_time.tv_sec, (ping_time.tv_usec/1000)); + + do_error_dialog(buf, _("CTCP Ping"), GAIM_INFO); + g_strfreev(vector); + } + } else { + if (*word_eol[4] == ':') word_eol[4]++; + if (ex) + irc_got_im(gc, nick, word_eol[4], 0, time(NULL)); + } } static void -irc_parse_join(struct gaim_connection *gc, char *nick, - char *word[], char *word_eol[]) +irc_parse_join(struct gaim_connection *gc, char *nick, + char *word[], char *word_eol[]) { - char *chan = *word[3] == ':' ? word[3] + 1 : word[3]; - static int id = 1; - struct conversation *c; - char *hostmask, *p; - - if (!g_strcasecmp(gc->displayname, nick)) { - serv_got_joined_chat(gc, id++, chan); - } else { - c = irc_find_chat(gc, chan); - if (c) { - hostmask = g_strdup(word[1]); - p = strchr(hostmask, '!'); - if (p) { - char *pend = strchr(p, ' '); - if (pend) { - *pend = 0; - } - add_chat_buddy(c, nick, p+1); - g_free(hostmask); - } - } - } + char *chan = *word[3] == ':' ? word[3] + 1 : word[3]; + static int id = 1; + struct conversation *c; + char *hostmask, *p; + + if (!g_strcasecmp(gc->displayname, nick)) { + serv_got_joined_chat(gc, id++, chan); + } else { + c = irc_find_chat(gc, chan); + if (c) { + hostmask = g_strdup(word[1]); + p = strchr(hostmask, '!'); + if (p) { + char *pend = strchr(p, ' '); + if (pend) { + *pend = 0; + } + add_chat_buddy(c, nick, p+1); + g_free(hostmask); + } + } + } } - + static void irc_parse_topic(struct gaim_connection *gc, char *nick, - char *word[], char *word_eol[]) + char *word[], char *word_eol[]) { - struct conversation *c = irc_find_chat(gc, word[3]); - char *topic = *word_eol[4] == ':' ? word_eol[4] + 1 : word_eol[4]; - char buf[IRC_BUF_LEN]; + struct conversation *c = irc_find_chat(gc, word[3]); + char *topic = *word_eol[4] == ':' ? word_eol[4] + 1 : word_eol[4]; + char buf[IRC_BUF_LEN]; - if (c) { - chat_set_topic(c, nick, topic); - g_snprintf(buf, sizeof(buf), _("<B>%s has changed the topic to: %s</B>"), - nick, topic); - write_to_conv(c, buf, WFLAG_SYSTEM, NULL, time(NULL), -1); - } + if (c) { + chat_set_topic(c, nick, topic); + g_snprintf(buf, sizeof(buf), + _("<B>%s has changed the topic to: %s</B>"), nick, topic); + write_to_conv(c, buf, WFLAG_SYSTEM, NULL, time(NULL), -1); + } } static gboolean irc_parse_part(struct gaim_connection *gc, char *nick, char *cmd, - char *word[], char *word_eol[]) + char *word[], char *word_eol[]) { - char *chan = cmd + 5; - struct conversation *c; - char *reason = word_eol[4]; - GList *r; + char *chan = cmd + 5; + struct conversation *c; + char *reason = word_eol[4]; + GList *r; - if (*chan == ':') - chan++; - if (*reason == ':') - reason++; - if (!(c = irc_find_chat(gc, chan))) - return FALSE; - if (!strcmp(nick, gc->displayname)) { - serv_got_chat_left(gc, c->id); - return FALSE; - } - r = c->in_room; - while (r) { - char *who = r->data; - if (*who == '@') - who++; - if (*who == '+') - who++; - if (!g_strcasecmp(who, nick)) { - char *tmp = g_strdup(r->data); - remove_chat_buddy(c, tmp, reason); - g_free(tmp); - break; - } - r = r->next; - } + if (*chan == ':') + chan++; + if (*reason == ':') + reason++; + if (!(c = irc_find_chat(gc, chan))) + return FALSE; + if (!strcmp(nick, gc->displayname)) { + serv_got_chat_left(gc, c->id); + return FALSE; + } + r = c->in_room; + while (r) { + char *who = r->data; + if (*who == '@') + who++; + if (*who == '+') + who++; + if (!g_strcasecmp(who, nick)) { + char *tmp = g_strdup(r->data); + remove_chat_buddy(c, tmp, reason); + g_free(tmp); + break; + } + r = r->next; + } return TRUE; } static void -irc_callback(gpointer data, gint source, -GaimInputCondition condition) +irc_callback(gpointer data, gint source, GaimInputCondition condition) { struct gaim_connection *gc = data; struct irc_data *idata = gc->proto_data;
--- a/src/protocols/msn/msn.c Sat Jan 04 19:41:07 2003 +0000 +++ b/src/protocols/msn/msn.c Sat Jan 04 21:01:32 2003 +0000 @@ -163,7 +163,7 @@ static int msn_write(int fd, void *data, int len) { - debug_printf("MSN C: %s", data); + debug_printf("MSN C: %s", (char *)data); return write(fd, data, len); } @@ -2113,7 +2113,6 @@ static void msn_file_transfer_in(struct gaim_connection *gc, struct file_transfer *xfer, int offset) { - struct msn_data *md = gc->proto_data; struct msn_file_transfer *mft = find_mft_by_xfer(gc, xfer); struct msn_switchboard *ms = msn_find_switch(gc, mft->sn); char header[MSN_BUF_LEN]; @@ -2194,7 +2193,6 @@ { struct msn_data *md = (struct msn_data *)gc->proto_data; struct msn_file_transfer *mft = find_mft_by_xfer(gc, xfer); - struct msn_switchboard *ms = msn_find_switch(gc, mft->sn); char buf[MSN_BUF_LEN]; g_snprintf(buf, sizeof(buf), "BYE 16777989\r\n");
--- a/src/protocols/oscar/oscar.c Sat Jan 04 19:41:07 2003 +0000 +++ b/src/protocols/oscar/oscar.c Sat Jan 04 21:01:32 2003 +0000 @@ -3974,7 +3974,7 @@ tmp = 0; for (cur=buddies; cur; cur=cur->next) if (aim_ssi_itemlist_finditem(odata->sess->ssi.items, NULL, cur->data, 0x0000)) { - debug_printf("ssi: deleting buddy %s from group %s\n", cur->data, group); + debug_printf("ssi: deleting buddy %s from group %s\n", (char *)cur->data, group); sns[tmp] = cur->data; tmp++; } @@ -4142,7 +4142,7 @@ tmp = 0; for (cur=gc->permit; cur; cur=cur->next) if (!aim_ssi_itemlist_finditem(sess->ssi.items, NULL, cur->data, 0x0002)) { - debug_printf("ssi: adding permit %s from local list to server list\n", cur->data); + debug_printf("ssi: adding permit %s from local list to server list\n", (char *)cur->data); sns[tmp] = cur->data; tmp++; } @@ -4162,7 +4162,7 @@ tmp = 0; for (cur=gc->deny; cur; cur=cur->next) if (!aim_ssi_itemlist_finditem(sess->ssi.items, NULL, cur->data, 0x0003)) { - debug_printf("ssi: adding deny %s from local list to server list\n", cur->data); + debug_printf("ssi: adding deny %s from local list to server list\n", (char *)cur->data); sns[tmp] = cur->data; tmp++; }
--- a/src/protocols/toc/toc.c Sat Jan 04 19:41:07 2003 +0000 +++ b/src/protocols/toc/toc.c Sat Jan 04 21:01:32 2003 +0000 @@ -903,7 +903,7 @@ debug_printf("English translation of RVOUS_PROPOSE: %s requests Send File (i.e." " send a file to you); %s:%d (verified_ip:port), %d files at" - " total size of %ld bytes.\n", user, vip, port, files, totalsize); + " total size of %d bytes.\n", user, vip, port, files, totalsize); accept_file_dialog(ft); } else if (!strcmp(uuid, FILE_GET_UID)) { /* they want us to send a file */ @@ -1529,8 +1529,8 @@ debug_printf("TOC FT HEADER:\n" "\t%s %d 0x%04x\n" "\t%s %d %d\n" - "\t%d %d %d %d %ld %ld\n" - "\t%ld %ld %ld %ld %ld %ld %ld %ld\n" + "\t%d %d %d %d %d %d\n" + "\t%d %d %d %d %d %d %d %d\n" "\t%s\n" "\t0x%02x, 0x%02x, 0x%02x\n" "\t%s %s\n"
--- a/src/protocols/yahoo/yahoo.c Sat Jan 04 19:41:07 2003 +0000 +++ b/src/protocols/yahoo/yahoo.c Sat Jan 04 21:01:32 2003 +0000 @@ -522,8 +522,8 @@ } else if (!g_strncasecmp(msg, "GAME", strlen("GAME"))) { struct buddy *bud = find_buddy(gc, from); void *free1=NULL, *free2=NULL; - if (!bud) - debug_printf("%s is playing a game, and doesn't want you to know.\n"); + if (!bud) + debug_printf("%s is playing a game, and doesn't want you to know.\n", from); if (*stat == '1') { if (g_hash_table_lookup_extended (yd->games, from, free1, free2)) { g_free(free1);
--- a/src/server.c Sat Jan 04 19:41:07 2003 +0000 +++ b/src/server.c Sat Jan 04 21:01:32 2003 +0000 @@ -628,7 +628,6 @@ * something to store the message, and add it to our queue. Then we update * the away dialog to indicate that we've queued something. */ struct queued_message *qm; - struct buddy *b; qm = g_new0(struct queued_message, 1); g_snprintf(qm->name, sizeof(qm->name), "%s", name);