pa_tagstruct_put_volume(tagstruct, control->volume.volume);
pa_tagstruct_put_channel_map(tagstruct, &control->volume.channel_map);
- for (i = 0; i < control->volume.channel_map.channels; i++)
- pa_tagstruct_putu64(tagstruct, *((uint64_t *) &control->volume.balance[i]));
+ for (i = 0; i < control->volume.channel_map.channels; i++) {
+ uint64_t u;
+
+ memcpy(&u, &control->volume.balance[i], sizeof(uint64_t));
+ pa_tagstruct_putu64(tagstruct, u);
+ }
pa_tagstruct_put_boolean(tagstruct, control->convertible_to_dB);
}
if (pa_tagstruct_getu64(tagstruct, &balance) < 0)
goto fail_parse;
- bvolume.balance[i] = *((double *) &balance);
+ memcpy(&bvolume.balance[i], &balance, sizeof(double));
if (!pa_balance_valid(bvolume.balance[i]))
goto fail_parse;
if (pa_tagstruct_getu64(tagstruct, &balance) < 0)
goto fail_parse;
- info.volume.balance[channel] = *((double *) &balance);
+ memcpy(&info.volume.balance[channel], &balance, sizeof(double));
if (!pa_ext_volume_api_balance_valid(info.volume.balance[channel]))
goto fail_parse;
pa_tagstruct_put_volume(tagstruct, v);
pa_tagstruct_put_channel_map(tagstruct, &channel_map);
- for (i = 0; i < channel_map.channels; i++)
- pa_tagstruct_putu64(tagstruct, *((uint64_t *) &volume->balance[i]));
+ for (i = 0; i < channel_map.channels; i++) {
+ uint64_t balance;
+
+ memcpy(&balance, &volume->balance[i], sizeof(uint64_t));
+ pa_tagstruct_putu64(tagstruct, balance);
+ }
pa_pstream_send_tagstruct(context->pstream, tagstruct);
pa_pdispatch_register_reply(context->pdispatch, tag, DEFAULT_TIMEOUT, pa_context_simple_ack_callback,
pa_tagstruct_put_volume(tagstruct, v);
pa_tagstruct_put_channel_map(tagstruct, &channel_map);
- for (i = 0; i < channel_map.channels; i++)
- pa_tagstruct_putu64(tagstruct, *((uint64_t *) &volume->balance[i]));
+ for (i = 0; i < channel_map.channels; i++) {
+ uint64_t balance;
+
+ memcpy(&balance, &volume->balance[i], sizeof(uint64_t));
+ pa_tagstruct_putu64(tagstruct, balance);
+ }
pa_pstream_send_tagstruct(context->pstream, tagstruct);
pa_pdispatch_register_reply(context->pdispatch, tag, DEFAULT_TIMEOUT, pa_context_simple_ack_callback,