On Thu, Jan 14, 2016 at 05:32:44PM +0000, Frediano Ziglio wrote:
> Do not print directly binary data but serialize in a portable way
> and then use write functions.
> ---
> server/spice-bitmap-utils.c | 75
> +++++++++++++++++++++++++--------------------
> 1 file changed, 41 insertions(+), 34 deletions(-)
>
> diff --git a/server/spice-bitmap-utils.c b/server/spice-bitmap-utils.c
> index f72af65..64102f3 100644
> --- a/server/spice-bitmap-utils.c
> +++ b/server/spice-bitmap-utils.c
> @@ -137,6 +137,22 @@ int spice_bitmap_from_surface_type(uint32_t
> surface_format)
>
> #define RAM_PATH "/tmp/tmpfs"
>
> +static void put_16le(uint8_t **ptr, uint16_t val)
> +{
> + **ptr = val & 0xffu;
> + (*ptr)++;
> + val >>= 8;
> + **ptr = val & 0xffu;
> + (*ptr)++;
> +}
> +
> +static void put_32le(uint8_t **ptr, uint32_t val)
> +{
> + put_16le(ptr, val & 0xffffu);
> + val >>= 16;
> + put_16le(ptr, val & 0xffffu);
> +}
> +
> static void dump_palette(FILE *f, SpicePalette* plt)
> {
> int i;
> @@ -152,8 +168,9 @@ static void dump_line(FILE *f, uint8_t* line, uint16_t
> n_pixel_bits, int width,
>
> fwrite(line, 1, copy_bytes_size, f);
> // each line should be 4 bytes aligned
> - g_return_if_fail(row_size - copy_bytes_size >= 0 && row_size -
> copy_bytes_size <= 4);
> fwrite(zeroes, 1, row_size - copy_bytes_size, f);
> + g_return_val_if_fail(row_size - copy_bytes_size >= 0 && row_size -
> copy_bytes_size <= 4, false);
> + spice_assert(row_size - copy_bytes_size >= 0 && row_size -
> copy_bytes_size <= 4);Rebase issue it seems. This should be g_return_if_fail() in this patch as the function returns a boolean only in the next one. With that fixed, Acked-by: Christophe Fergeau <[email protected]> Christophe
signature.asc
Description: PGP signature
_______________________________________________ Spice-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/spice-devel
