comparison src/protocols/qq/buddy_opt.c @ 14058:32a71e64ceae

[gaim-migrate @ 16673] Eliminated a number of warnings. Generally, this consisted of fixing incorrectly declared data types and adding a few casts. I also moved some declarations that occurred in the middle of code. Minor formatting changes. committer: Tailor Script <tailor@pidgin.im>
author Mark Huetsch <markhuetsch>
date Tue, 08 Aug 2006 23:20:08 +0000
parents ef8490f9e823
children
comparison
equal deleted inserted replaced
14057:44b42bb2c5f8 14058:32a71e64ceae
62 gchar *uid_str; 62 gchar *uid_str;
63 63
64 g_return_if_fail(gc != NULL && uid > 0); 64 g_return_if_fail(gc != NULL && uid > 0);
65 65
66 uid_str = g_strdup_printf("%d", uid); 66 uid_str = g_strdup_printf("%d", uid);
67 qq_send_cmd(gc, QQ_CMD_DEL_FRIEND, TRUE, 0, TRUE, uid_str, strlen(uid_str)); 67 qq_send_cmd(gc, QQ_CMD_DEL_FRIEND, TRUE, 0,
68 TRUE, (guint8 *) uid_str, strlen(uid_str));
68 69
69 g_free(uid_str); 70 g_free(uid_str);
70 } 71 }
71 72
72 /* try to remove myself from someone's buddy list */ 73 /* try to remove myself from someone's buddy list */
92 93
93 g_return_if_fail(gc != NULL && gc->proto_data != NULL && uid > 0); 94 g_return_if_fail(gc != NULL && gc->proto_data != NULL && uid > 0);
94 95
95 /* we need to send the ascii code of this uid to qq server */ 96 /* we need to send the ascii code of this uid to qq server */
96 uid_str = g_strdup_printf("%d", uid); 97 uid_str = g_strdup_printf("%d", uid);
97 qq_send_cmd(gc, QQ_CMD_ADD_FRIEND_WO_AUTH, TRUE, 0, TRUE, uid_str, strlen(uid_str)); 98 qq_send_cmd(gc, QQ_CMD_ADD_FRIEND_WO_AUTH, TRUE, 0,
99 TRUE, (guint8 *) uid_str, strlen(uid_str));
98 g_free(uid_str); 100 g_free(uid_str);
99 101
100 /* must be set after sending packet to get the correct send_seq */ 102 /* must be set after sending packet to get the correct send_seq */
101 qd = (qq_data *) gc->proto_data; 103 qd = (qq_data *) gc->proto_data;
102 req = g_new0(qq_add_buddy_request, 1); 104 req = g_new0(qq_add_buddy_request, 1);
116 uid_str = g_strdup_printf("%d", uid); 118 uid_str = g_strdup_printf("%d", uid);
117 bar = 0x1f; 119 bar = 0x1f;
118 raw_data = g_newa(guint8, QQ_MSG_IM_MAX); 120 raw_data = g_newa(guint8, QQ_MSG_IM_MAX);
119 cursor = raw_data; 121 cursor = raw_data;
120 122
121 create_packet_data(raw_data, &cursor, uid_str, strlen(uid_str)); 123 create_packet_data(raw_data, &cursor, (guint8 *) uid_str, strlen(uid_str));
122 create_packet_b(raw_data, &cursor, bar); 124 create_packet_b(raw_data, &cursor, bar);
123 create_packet_b(raw_data, &cursor, response); 125 create_packet_b(raw_data, &cursor, response);
124 126
125 if (text != NULL) { 127 if (text != NULL) {
126 text_qq = utf8_to_qq(text, QQ_CHARSET_DEFAULT); 128 text_qq = utf8_to_qq(text, QQ_CHARSET_DEFAULT);
127 create_packet_b(raw_data, &cursor, bar); 129 create_packet_b(raw_data, &cursor, bar);
128 create_packet_data(raw_data, &cursor, text_qq, strlen(text_qq)); 130 create_packet_data(raw_data, &cursor, (guint8 *) text_qq, strlen(text_qq));
129 g_free(text_qq); 131 g_free(text_qq);
130 } 132 }
131 133
132 qq_send_cmd(gc, QQ_CMD_BUDDY_AUTH, TRUE, 0, TRUE, raw_data, cursor - raw_data); 134 qq_send_cmd(gc, QQ_CMD_BUDDY_AUTH, TRUE, 0, TRUE, raw_data, cursor - raw_data);
133 g_free(uid_str); 135 g_free(uid_str);
340 342
341 void qq_process_add_buddy_reply(guint8 *buf, gint buf_len, guint16 seq, GaimConnection *gc) 343 void qq_process_add_buddy_reply(guint8 *buf, gint buf_len, guint16 seq, GaimConnection *gc)
342 { 344 {
343 qq_data *qd; 345 qq_data *qd;
344 gint len, for_uid; 346 gint len, for_uid;
345 gchar *msg, *data, **segments, *uid, *reply; 347 gchar *msg, **segments, *uid, *reply;
348 guint8 *data;
346 GList *list; 349 GList *list;
347 GaimBuddy *b; 350 GaimBuddy *b;
348 gc_and_uid *g; 351 gc_and_uid *g;
349 qq_add_buddy_request *req; 352 qq_add_buddy_request *req;
350 353