diff options
author | Szymon Janc <szymon.janc@tieto.com> | 2015-04-14 15:48:35 +0200 |
---|---|---|
committer | Szymon Janc <szymon.janc@tieto.com> | 2015-04-16 13:23:31 +0200 |
commit | d7c099fa532246cf8812ebf250b97026f0bbee7d (patch) | |
tree | c906b4c1f32d87ad826f9d6c66d3897470879c48 /android/avrcp.c | |
parent | 75eaabf09f1007c68611f06637125cc87e41a701 (diff) | |
download | bluez-d7c099fa532246cf8812ebf250b97026f0bbee7d.tar.gz |
android/avrcp-lib: Use void pointer in register_notification
In this callback params vary depending on code. Passing those as void*
allows to avoid extra memcpy that would be otherwise needed to
avoid warnings due to increased alignment when casting.
Diffstat (limited to 'android/avrcp.c')
-rw-r--r-- | android/avrcp.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/android/avrcp.c b/android/avrcp.c index bcb422842..8c3e25a95 100644 --- a/android/avrcp.c +++ b/android/avrcp.c @@ -748,11 +748,12 @@ static const struct avrcp_control_ind control_ind = { static bool handle_register_notification_rsp(struct avrcp *session, int err, uint8_t code, uint8_t event, - uint8_t *params, + void *params, void *user_data) { struct avrcp_device *dev = user_data; struct hal_ev_avrcp_volume_changed ev; + uint8_t *volume = params; if (err < 0) { error("AVRCP: %s", strerror(-err)); @@ -766,7 +767,7 @@ static bool handle_register_notification_rsp(struct avrcp *session, int err, return false; ev.type = code; - ev.volume = params[0] & 0x7f; + ev.volume = volume[0]; ipc_send_notif(hal_ipc, HAL_SERVICE_ID_AVRCP, HAL_EV_AVRCP_VOLUME_CHANGED, |