comparison libpurple/protocols/oscar/family_feedbag.c @ 30826:bbb27d65681f

Bstream cleanups: 1. g_return_val_if_fail()'s in place of XXX's. 2. byte_stream_empty() -> byte_stream_bytes_left(). I think the world is a better place now.
author ivan.komarov@soc.pidgin.im
date Wed, 28 Jul 2010 23:53:25 +0000
parents 420907755a2f
children 11c54d781835
comparison
equal deleted inserted replaced
30825:a4f579485ce6 30826:bbb27d65681f
1168 1168
1169 fmtver = byte_stream_get8(bs); /* Version of ssi data. Should be 0x00 */ 1169 fmtver = byte_stream_get8(bs); /* Version of ssi data. Should be 0x00 */
1170 od->ssi.numitems += byte_stream_get16(bs); /* # of items in this SSI SNAC */ 1170 od->ssi.numitems += byte_stream_get16(bs); /* # of items in this SSI SNAC */
1171 1171
1172 /* Read in the list */ 1172 /* Read in the list */
1173 while (byte_stream_empty(bs) > 4) { /* last four bytes are timestamp */ 1173 while (byte_stream_bytes_left(bs) > 4) { /* last four bytes are timestamp */
1174 if ((namelen = byte_stream_get16(bs))) 1174 if ((namelen = byte_stream_get16(bs)))
1175 name = byte_stream_getstr(bs, namelen); 1175 name = byte_stream_getstr(bs, namelen);
1176 else 1176 else
1177 name = NULL; 1177 name = NULL;
1178 gid = byte_stream_get16(bs); 1178 gid = byte_stream_get16(bs);
1286 aim_rxcallback_t userfunc; 1286 aim_rxcallback_t userfunc;
1287 char *name; 1287 char *name;
1288 guint16 len, gid, bid, type; 1288 guint16 len, gid, bid, type;
1289 GSList *data; 1289 GSList *data;
1290 1290
1291 while (byte_stream_empty(bs)) { 1291 while (byte_stream_bytes_left(bs)) {
1292 if ((len = byte_stream_get16(bs))) 1292 if ((len = byte_stream_get16(bs)))
1293 name = byte_stream_getstr(bs, len); 1293 name = byte_stream_getstr(bs, len);
1294 else 1294 else
1295 name = NULL; 1295 name = NULL;
1296 gid = byte_stream_get16(bs); 1296 gid = byte_stream_get16(bs);
1324 char *name; 1324 char *name;
1325 guint16 len, gid, bid, type; 1325 guint16 len, gid, bid, type;
1326 GSList *data; 1326 GSList *data;
1327 struct aim_ssi_item *item; 1327 struct aim_ssi_item *item;
1328 1328
1329 while (byte_stream_empty(bs)) { 1329 while (byte_stream_bytes_left(bs)) {
1330 if ((len = byte_stream_get16(bs))) 1330 if ((len = byte_stream_get16(bs)))
1331 name = byte_stream_getstr(bs, len); 1331 name = byte_stream_getstr(bs, len);
1332 else 1332 else
1333 name = NULL; 1333 name = NULL;
1334 gid = byte_stream_get16(bs); 1334 gid = byte_stream_get16(bs);
1376 int ret = 0; 1376 int ret = 0;
1377 aim_rxcallback_t userfunc; 1377 aim_rxcallback_t userfunc;
1378 guint16 gid, bid; 1378 guint16 gid, bid;
1379 struct aim_ssi_item *del; 1379 struct aim_ssi_item *del;
1380 1380
1381 while (byte_stream_empty(bs)) { 1381 while (byte_stream_bytes_left(bs)) {
1382 byte_stream_advance(bs, byte_stream_get16(bs)); 1382 byte_stream_advance(bs, byte_stream_get16(bs));
1383 gid = byte_stream_get16(bs); 1383 gid = byte_stream_get16(bs);
1384 bid = byte_stream_get16(bs); 1384 bid = byte_stream_get16(bs);
1385 byte_stream_get16(bs); 1385 byte_stream_get16(bs);
1386 byte_stream_advance(bs, byte_stream_get16(bs)); 1386 byte_stream_advance(bs, byte_stream_get16(bs));
1409 aim_rxcallback_t userfunc; 1409 aim_rxcallback_t userfunc;
1410 struct aim_ssi_tmp *cur, *del; 1410 struct aim_ssi_tmp *cur, *del;
1411 1411
1412 /* Read in the success/failure flags from the ack SNAC */ 1412 /* Read in the success/failure flags from the ack SNAC */
1413 cur = od->ssi.pending; 1413 cur = od->ssi.pending;
1414 while (cur && (byte_stream_empty(bs)>0)) { 1414 while (cur && (byte_stream_bytes_left(bs)>0)) {
1415 cur->ack = byte_stream_get16(bs); 1415 cur->ack = byte_stream_get16(bs);
1416 cur = cur->next; 1416 cur = cur->next;
1417 } 1417 }
1418 1418
1419 /* 1419 /*