Skip to content

Commit

Permalink
zephyr: get rid of compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
benedekkupper committed Mar 17, 2024
1 parent 7a59fde commit 4a11432
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions c2usb/port/zephyr/bluetooth/gatt.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@ class attribute : public ::bt_gatt_attr
template <typename T>
T user_value() const
{
return std::bit_cast<T>(reinterpret_cast<sized_unsigned_t<sizeof(T)>>(user_data));
return std::bit_cast<T>(
static_cast<sized_unsigned_t<sizeof(T)>>(reinterpret_cast<std::uintptr_t>(user_data)));
}

template <typename T>
Expand Down Expand Up @@ -212,7 +213,7 @@ class attribute : public ::bt_gatt_attr
{
::bt_gatt_notify_params params{.attr = this,
.data = reinterpret_cast<const void*>(data.data()),
.len = data.size(),
.len = static_cast<uint16_t>(data.size()),
.func = cb,
.user_data = reinterpret_cast<void*>(user_data)};
return bt_gatt_notify_cb(conn, &params);
Expand Down

0 comments on commit 4a11432

Please sign in to comment.