Commit Graph

6 Commits

Author SHA1 Message Date
Frediano Ziglio
41aa4a978f utils: Avoid possible unaligned access
Code in rgb32_data_has_alpha possibly generate this warning using
clang:

utils.c:35:16: error: cast from 'uint8_t *' (aka 'unsigned char *') to 'uint32_t *' (aka 'unsigned int *') increases required alignment from 1 to 4 [-Werror,-Wcast-align]
        line = (uint32_t *)data;
               ^~~~~~~~~~~~~~~~

Although the images are expected to be all aligned in this respect
use byte access on the data instead. This, beside fixing the alignment
issue also avoid problem with big endian machines (images in SPICE are
expected to have the alpha channel as the forth byte).

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2018-01-31 14:17:39 +00:00
Frediano Ziglio
03125ef950 utils: Use const for rgb32_data_has_alpha data argument
There's no reason to change data passed, the function just check
the alpha channel of the image.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2018-01-29 21:11:38 +00:00
Frediano Ziglio
fb3e061a8e utils: Check we list all channel names
This prevent future problems supporting new channels.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2017-11-09 10:58:13 +00:00
Frediano Ziglio
ece4263055 utils: Fill in all possible channel names
Missing some names cause some debugging messages to be
generated and some of our tests to fail.

This patch was written by Christophe Fergeau.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-11-08 11:33:43 +00:00
Christophe Fergeau
699a94ca8f utils: Introduce helpers to map channel types to names
spice_server_set_channel_security() is already mostly doing that. We can
make its code more generic, and introduce a red_channel_get_name()
method. This method will then be used to make debug messages more
readable by showing the actual channel name rather than its type as
an int.

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-10-23 20:29:28 +01:00
Marc-André Lureau
029b4beb73 worker: move dcc_add_surface_area_image
Author:    Marc-André Lureau <marcandre.lureau@gmail.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2015-11-23 13:50:44 +00:00