Looks good to me, thanks! General question for the list, could these various getters/setters be handled by the generic marshalling code we have? Christophe On Tue, Aug 07, 2012 at 03:43:10PM -0300, Erlon Cruz wrote: > From: Erlon Cruz <erlon.cruz@xxxxxxxxxxxxxxxxxx> > > Signed-off-by: Erlon R. Cruz <erlon.cruz@xxxxxxxxxxxxxxxxxx> > Signed-off-by: Fabiano Fidêncio <Fabiano.Fidêncio@xxxxxxxxxxxxxxxxxxxxx> > Signed-off-by: Rafael F. Santos <Rafael.Santos@xxxxxxxxxxxxxxxxxxxxx> > --- > server/red_channel.c | 21 +++++++++++---------- > 1 files changed, 11 insertions(+), 10 deletions(-) > > diff --git a/server/red_channel.c b/server/red_channel.c > index 2a7acbf..f376265 100644 > --- a/server/red_channel.c > +++ b/server/red_channel.c > @@ -29,6 +29,7 @@ > #include <fcntl.h> > #include <unistd.h> > #include <errno.h> > +#include <endian.h> > > #include "common/generated_server_marshallers.h" > #include "common/ring.h" > @@ -84,47 +85,47 @@ static void red_channel_client_unref(RedChannelClient *rcc); > > static uint32_t full_header_get_msg_size(SpiceDataHeaderOpaque *header) > { > - return ((SpiceDataHeader *)header->data)->size; > + return le32toh(((SpiceDataHeader *)header->data)->size); > } > > static uint32_t mini_header_get_msg_size(SpiceDataHeaderOpaque *header) > { > - return ((SpiceMiniDataHeader *)header->data)->size; > + return le32toh(((SpiceMiniDataHeader *)header->data)->size); > } > > static uint16_t full_header_get_msg_type(SpiceDataHeaderOpaque *header) > { > - return ((SpiceDataHeader *)header->data)->type; > + return le16toh(((SpiceDataHeader *)header->data)->type); > } > > static uint16_t mini_header_get_msg_type(SpiceDataHeaderOpaque *header) > { > - return ((SpiceMiniDataHeader *)header->data)->type; > + return le16toh(((SpiceMiniDataHeader *)header->data)->type); > } > > static void full_header_set_msg_type(SpiceDataHeaderOpaque *header, uint16_t type) > { > - ((SpiceDataHeader *)header->data)->type = type; > + ((SpiceDataHeader *)header->data)->type = htole16(type); > } > > static void mini_header_set_msg_type(SpiceDataHeaderOpaque *header, uint16_t type) > { > - ((SpiceMiniDataHeader *)header->data)->type = type; > + ((SpiceMiniDataHeader *)header->data)->type = htole16(type); > } > > static void full_header_set_msg_size(SpiceDataHeaderOpaque *header, uint32_t size) > { > - ((SpiceDataHeader *)header->data)->size = size; > + ((SpiceDataHeader *)header->data)->size = htole32(size); > } > > static void mini_header_set_msg_size(SpiceDataHeaderOpaque *header, uint32_t size) > { > - ((SpiceMiniDataHeader *)header->data)->size = size; > + ((SpiceMiniDataHeader *)header->data)->size = htole32(size); > } > > static void full_header_set_msg_serial(SpiceDataHeaderOpaque *header, uint64_t serial) > { > - ((SpiceDataHeader *)header->data)->serial = serial; > + ((SpiceDataHeader *)header->data)->serial = htole64(serial); > } > > static void mini_header_set_msg_serial(SpiceDataHeaderOpaque *header, uint64_t serial) > @@ -134,7 +135,7 @@ static void mini_header_set_msg_serial(SpiceDataHeaderOpaque *header, uint64_t s > > static void full_header_set_msg_sub_list(SpiceDataHeaderOpaque *header, uint32_t sub_list) > { > - ((SpiceDataHeader *)header->data)->sub_list = sub_list; > + ((SpiceDataHeader *)header->data)->sub_list = htole32(sub_list); > } > > static void mini_header_set_msg_sub_list(SpiceDataHeaderOpaque *header, uint32_t sub_list) > -- > 1.7.4.1 > > _______________________________________________ > Spice-devel mailing list > Spice-devel@xxxxxxxxxxxxxxxxxxxxx > http://lists.freedesktop.org/mailman/listinfo/spice-devel
Attachment:
pgpjFOAhpvdK8.pgp
Description: PGP signature
_______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/spice-devel