spice/server
Victor Toso bdeef8b292 mjpeg and jpeg encoder: fix alignment warnings
As the input line could be uint8_t*, uint16_t* or uint32_t*, changing
the default from uint8_t* to void* seems the correct choice to deal with
upcasting warnings.

Regarding chunks->data allocation, I quote Frediano explantion:
"Lines came from spice_bitmap_get_line. This function assume that bitmap
data is split among chunks each containing some lines
(always full lines). If chunk->data is allocated using malloc or similar
SHOULD (not 100% sure) be 4 bytes aligned so in our cases
(8, 16, 24 or 32 bit images) should be aligned enough.

All the casts unfortunately came from the fact we compute based on
pixel bytes to make it generic so we use uint8_t*."

and

"Looking at code looks like these chunks came from the virtual machine.
So the question is... why should the virtual machine give use some
not-pixel align data?
I would put a large comment to state that we assume VM send aligned
data, would be stupid for the VM to not align it!"

clang output:
jpeg_encoder.c:109:26: error: cast from 'uint8_t *'
(aka 'unsigned char *') to 'uint16_t *' (aka 'unsigned short *')
increases required alignment from 1 to 2 [-Werror,-Wcast-align]
  uint16_t *src_line = (uint16_t *)line;
                       ^~~~~~~~~~~~~~~~

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

mjpeg_encoder.c:260:23: error: cast from 'uint8_t *'
(aka 'unsigned char *') to 'uint16_t *' (aka 'unsigned short *')
increases required alignment from 1 to 2 [-Werror,-Wcast-align]
  uint16_t pixel = *(uint16_t *)src;
                    ^~~~~~~~~~~~~~~
2015-08-20 11:22:59 +01:00
..
tests Adjust to new SpiceImageCompress name 2015-07-29 17:40:48 +02:00
.gitignore gitignore: add generated_*, vim temps, pyc 2010-11-08 16:06:55 +02:00
agent-msg-filter.c server: Add support for filtering out agent file-xfer msgs (rhbz#961848) 2013-06-06 16:07:30 +02:00
agent-msg-filter.h server: Add support for filtering out agent file-xfer msgs (rhbz#961848) 2013-06-06 16:07:30 +02:00
char_device.c char-device: spice_char_device_write_to_device: protect against recursion 2015-02-08 13:13:46 +02:00
char_device.h Fix typo in comment in char_device.h 2015-08-11 17:24:36 +02:00
demarshallers.h Remove trailing blank lines 2012-01-13 18:11:59 +02:00
dispatcher.c Don't do arithmetic on void * type, use uint8_t instead 2012-04-25 09:40:18 +01:00
dispatcher.h dispatcher.h: fix - s/#define MAIN_DISPATCHER_H/#define DISPATCHER_H 2013-04-22 16:30:54 -04:00
glz_encode_match_tmpl.c add #include <config.h> to all source files 2011-05-03 14:44:10 +02:00
glz_encode_tmpl.c Remove trailing whitespace from end of lines 2012-01-13 18:11:59 +02:00
glz_encoder_config.h Fix multiple printf format problems 2012-04-25 09:42:11 +01:00
glz_encoder_dictionary_protected.h glz: WindowImageSegment lines lines_end as void* 2015-08-20 11:09:00 +01:00
glz_encoder_dictionary.c server: s/max_encdoers/max_encoders/ 2012-08-30 17:08:09 +03:00
glz_encoder_dictionary.h Remove trailing blank lines 2012-01-13 18:11:59 +02:00
glz_encoder.c ppc: Fix glz magic endianess 2015-04-10 20:24:15 +02:00
glz_encoder.h Use the spice-common submodule 2012-03-25 18:59:10 +02:00
inputs_channel.c server/inputs_channel: Cope with NULL keyboard in release_keys() 2015-08-12 10:28:57 +02:00
inputs_channel.h Remove trailing blank lines 2012-01-13 18:11:59 +02:00
jpeg_encoder.c mjpeg and jpeg encoder: fix alignment warnings 2015-08-20 11:22:59 +01:00
jpeg_encoder.h Remove trailing whitespace from end of lines 2012-01-13 18:11:59 +02:00
lz4_encoder.c LZ4: Send the original format with the compressed data 2015-02-03 10:39:16 +01:00
lz4_encoder.h LZ4: Send the original format with the compressed data 2015-02-03 10:39:16 +01:00
main_channel.c Remove unused struct RedsOutItem 2015-08-11 17:24:36 +02:00
main_channel.h Move RedsMigSpice to main-channel.h 2015-08-11 17:24:36 +02:00
main_dispatcher.c decouple disconnection of the main channel from client destruction 2013-07-29 11:35:17 -04:00
main_dispatcher.h decouple disconnection of the main channel from client destruction 2013-07-29 11:35:17 -04:00
Makefile.am Remove spice-experimental 2015-01-15 18:34:26 +01:00
migration_protocol.h migration_protocol: use SPICE_MAGIC_CONST 2015-08-20 10:54:56 +01:00
mjpeg_encoder.c mjpeg and jpeg encoder: fix alignment warnings 2015-08-20 11:22:59 +01:00
mjpeg_encoder.h server: Remove the rate_control_is_active field from MJpegEncoder. 2015-06-29 18:04:12 +02:00
red_bitmap_utils.h Remove trailing blank lines 2012-01-13 18:11:59 +02:00
red_channel.c channel: minor simplification 2015-08-11 17:24:36 +02:00
red_channel.h RedChannel: remove unused BufDescriptor struct 2015-08-11 17:24:36 +02:00
red_client_cache.h Use the spice-common logging functions 2012-03-25 19:00:00 +02:00
red_client_shared_cache.h Lock the pixmap image cache for the entire fill_bits call 2015-06-29 13:21:14 +02:00
red_common.h Remove duplicate streaming enumeration 2015-06-15 13:08:42 -05:00
red_dispatcher.c Adjust to new SpiceImageCompress name 2015-07-29 17:40:48 +02:00
red_dispatcher.h Adjust to new SpiceImageCompress name 2015-07-29 17:40:48 +02:00
red_memslots.c server: remove memslot unused functions 2013-10-01 16:23:59 +02:00
red_memslots.h server: remove memslot unused functions 2013-10-01 16:23:59 +02:00
red_parse_qxl.c red_parse_qxl: Do not compute abs unsigned int 2015-08-12 12:29:52 +02:00
red_parse_qxl.h Add support for QXLComposite to spice server 2012-08-24 13:44:42 -04:00
red_time.h server: move three functions to red_channel 2013-08-14 12:08:04 +03:00
red_worker.c worker: remove unused preload_group_id 2015-08-11 17:24:36 +02:00
red_worker.h Adjust to new SpiceImageCompress name 2015-07-29 17:40:48 +02:00
reds_gl_canvas.c Remove unused SPICE_CANVAS_INTERNAL 2014-12-03 18:32:04 +01:00
reds_gl_canvas.h Remove unused SPICE_CANVAS_INTERNAL 2014-12-03 18:32:04 +01:00
reds_stream.c reds-stream: add reds_stream_get_family() function 2015-01-15 18:29:36 +01:00
reds_stream.h reds-stream: add reds_stream_get_family() function 2015-01-15 18:29:36 +01:00
reds_sw_canvas.c Remove unused SPICE_CANVAS_INTERNAL 2014-12-03 18:32:04 +01:00
reds_sw_canvas.h Remove unused SPICE_CANVAS_INTERNAL 2014-12-03 18:32:04 +01:00
reds-private.h Cleanup: move static function declarations out of header 2015-08-11 17:24:36 +02:00
reds.c Fix typo in comments 2015-08-11 17:24:36 +02:00
reds.h Move RedsMigSpice to main-channel.h 2015-08-11 17:24:36 +02:00
smartcard.c red_channel: monitor connection latency using MSG_PING 2013-04-22 16:30:54 -04:00
smartcard.h Remove spice-experimental 2015-01-15 18:34:26 +01:00
snd_worker.c Remove unused snd_get_playback_compression() method 2015-08-11 17:24:36 +02:00
snd_worker.h Remove unused snd_get_playback_compression() method 2015-08-11 17:24:36 +02:00
spice_bitmap_utils.c server: Don't dump the bitmap when the format is invalid 2014-09-12 18:00:30 +02:00
spice_bitmap_utils.h server: move surface_format_to_image_type to spice_bitmap_utils 2013-08-14 12:08:04 +03:00
spice_image_cache.c server: split spice_image_cache from red_worker 2013-08-14 12:08:04 +03:00
spice_image_cache.h server: split spice_image_cache from red_worker 2013-08-14 12:08:04 +03:00
spice_server_utils.h server: move bit set/clear utilities out of red_worker.h 2013-08-14 12:08:04 +03:00
spice_timer_queue.c server: Fix an incorrect time calculation. 2015-06-29 17:50:26 +02:00
spice_timer_queue.h server: spice_timer_queue 2013-04-22 16:30:54 -04:00
spice-audio.h Split spice.h 2014-11-27 14:27:18 +01:00
spice-char.h Split spice.h 2014-11-27 14:27:18 +01:00
spice-core.h Split spice.h 2014-11-27 14:27:18 +01:00
spice-input.h Split spice.h 2014-11-27 14:27:18 +01:00
spice-migration.h Move spice_server_get_num_clients() declaration 2014-11-27 15:03:38 +01:00
spice-qxl.h server: allows to set maximum monitors 2015-06-26 16:17:42 +02:00
spice-server.h Adjust to new SpiceImageCompress name 2015-07-29 17:40:48 +02:00
spice-server.syms server: allows to set maximum monitors 2015-06-26 16:17:42 +02:00
spice-version.h.in build-sys: generate spice-version.h 2014-11-27 14:27:33 +01:00
spice.h Split spice.h 2014-11-27 14:27:18 +01:00
spicevmc.c red_channel: monitor connection latency using MSG_PING 2013-04-22 16:30:54 -04:00
stat.h Remove trailing blank lines 2012-01-13 18:11:59 +02:00
zlib_encoder.c Use the spice-common logging functions 2012-03-25 19:00:00 +02:00
zlib_encoder.h applying zlib compression over glz on WAN connection 2010-06-21 15:05:37 +02:00