mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2026-08-06 18:52:33 +00:00
sound: Avoid cast that could cause alignment problems
clang is reporting:
sound.c:292: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]
data = (uint32_t *)packet->data;
^~~~~~~~~~~~~~~~~~~~~~~~
however we are using memcpy to access "data" pointer so there's no
need to use uint32_t pointer. Also considering we don't do math with
that pointer.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
This commit is contained in:
parent
c4a0505f6e
commit
5d5a7bd181
@ -281,7 +281,7 @@ static bool snd_record_handle_write(RecordChannelClient *record_client, size_t s
|
|||||||
{
|
{
|
||||||
SpiceMsgcRecordPacket *packet;
|
SpiceMsgcRecordPacket *packet;
|
||||||
uint32_t write_pos;
|
uint32_t write_pos;
|
||||||
uint32_t* data;
|
uint8_t* data;
|
||||||
uint32_t len;
|
uint32_t len;
|
||||||
uint32_t now;
|
uint32_t now;
|
||||||
|
|
||||||
@ -292,7 +292,7 @@ static bool snd_record_handle_write(RecordChannelClient *record_client, size_t s
|
|||||||
packet = (SpiceMsgcRecordPacket *)message;
|
packet = (SpiceMsgcRecordPacket *)message;
|
||||||
|
|
||||||
if (record_client->mode == SPICE_AUDIO_DATA_MODE_RAW) {
|
if (record_client->mode == SPICE_AUDIO_DATA_MODE_RAW) {
|
||||||
data = (uint32_t *)packet->data;
|
data = packet->data;
|
||||||
size = packet->data_size >> 2;
|
size = packet->data_size >> 2;
|
||||||
size = MIN(size, RECORD_SAMPLES_SIZE);
|
size = MIN(size, RECORD_SAMPLES_SIZE);
|
||||||
} else {
|
} else {
|
||||||
@ -301,7 +301,7 @@ static bool snd_record_handle_write(RecordChannelClient *record_client, size_t s
|
|||||||
if (snd_codec_decode(record_client->codec, packet->data, packet->data_size,
|
if (snd_codec_decode(record_client->codec, packet->data, packet->data_size,
|
||||||
record_client->decode_buf, &decode_size) != SND_CODEC_OK)
|
record_client->decode_buf, &decode_size) != SND_CODEC_OK)
|
||||||
return false;
|
return false;
|
||||||
data = (uint32_t *) record_client->decode_buf;
|
data = record_client->decode_buf;
|
||||||
size = decode_size >> 2;
|
size = decode_size >> 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user