Mercurial > pidgin.yaz
comparison libpurple/protocols/oscar/family_oservice.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 | 553cd883a29a |
children | be056399ae5f |
comparison
equal
deleted
inserted
replaced
30825:a4f579485ce6 | 30826:bbb27d65681f |
---|---|
95 static int | 95 static int |
96 hostonline(OscarData *od, FlapConnection *conn, aim_module_t *mod, FlapFrame *frame, aim_modsnac_t *snac, ByteStream *bs) | 96 hostonline(OscarData *od, FlapConnection *conn, aim_module_t *mod, FlapFrame *frame, aim_modsnac_t *snac, ByteStream *bs) |
97 { | 97 { |
98 int group; | 98 int group; |
99 | 99 |
100 while (byte_stream_empty(bs)) | 100 while (byte_stream_bytes_left(bs)) |
101 { | 101 { |
102 group = byte_stream_get16(bs); | 102 group = byte_stream_get16(bs); |
103 conn->groups = g_slist_prepend(conn->groups, GUINT_TO_POINTER(group)); | 103 conn->groups = g_slist_prepend(conn->groups, GUINT_TO_POINTER(group)); |
104 } | 104 } |
105 | 105 |
584 | 584 |
585 memset(&userinfo, 0, sizeof(aim_userinfo_t)); | 585 memset(&userinfo, 0, sizeof(aim_userinfo_t)); |
586 | 586 |
587 newevil = byte_stream_get16(bs); | 587 newevil = byte_stream_get16(bs); |
588 | 588 |
589 if (byte_stream_empty(bs)) | 589 if (byte_stream_bytes_left(bs)) |
590 aim_info_extract(od, bs, &userinfo); | 590 aim_info_extract(od, bs, &userinfo); |
591 | 591 |
592 if ((userfunc = aim_callhandler(od, snac->family, snac->subtype))) | 592 if ((userfunc = aim_callhandler(od, snac->family, snac->subtype))) |
593 ret = userfunc(od, conn, frame, newevil, &userinfo); | 593 ret = userfunc(od, conn, frame, newevil, &userinfo); |
594 | 594 |
761 { | 761 { |
762 int vercount; | 762 int vercount; |
763 guint8 *versions; | 763 guint8 *versions; |
764 | 764 |
765 /* This is frivolous. (Thank you SmarterChild.) */ | 765 /* This is frivolous. (Thank you SmarterChild.) */ |
766 vercount = byte_stream_empty(bs)/4; | 766 vercount = byte_stream_bytes_left(bs)/4; |
767 versions = byte_stream_getraw(bs, byte_stream_empty(bs)); | 767 versions = byte_stream_getraw(bs, byte_stream_bytes_left(bs)); |
768 g_free(versions); | 768 g_free(versions); |
769 | 769 |
770 /* | 770 /* |
771 * Now request rates. | 771 * Now request rates. |
772 */ | 772 */ |