mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-31 23:08:22 -04:00
libstrat: enable -Wextra, -Werror
This caught an embarrassingly large number of bugs.
This commit is contained in:
parent
e1fbf27398
commit
7ca83c9d3b
160 changed files with 691 additions and 152 deletions
|
@ -89,6 +89,7 @@ namespace ams::i2c::driver::board::nintendo::nx::impl {
|
|||
/* Check that the device is valid. */
|
||||
AMS_ASSERT(device != nullptr);
|
||||
AMS_ASSERT(this->state == State::Initialized);
|
||||
AMS_UNUSED(device);
|
||||
|
||||
/* Acquire exclusive access. */
|
||||
std::scoped_lock lk(this->user_count_mutex);
|
||||
|
@ -144,6 +145,7 @@ namespace ams::i2c::driver::board::nintendo::nx::impl {
|
|||
/* Check that the device is valid. */
|
||||
AMS_ASSERT(device != nullptr);
|
||||
AMS_ASSERT(this->state == State::Initialized);
|
||||
AMS_UNUSED(device);
|
||||
|
||||
/* Acquire exclusive access. */
|
||||
std::scoped_lock lk(this->user_count_mutex);
|
||||
|
|
|
@ -22,7 +22,7 @@ namespace ams::i2c::driver::impl {
|
|||
namespace {
|
||||
|
||||
constexpr TransactionOption EncodeTransactionOption(bool start, bool stop) {
|
||||
return static_cast<TransactionOption>((start ? TransactionOption_StartCondition : 0) | (stop ? TransactionOption_StopCondition : 0));
|
||||
return static_cast<TransactionOption>((start ? util::ToUnderlying(TransactionOption_StartCondition) : 0) | (stop ? util::ToUnderlying(TransactionOption_StopCondition) : 0));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -66,6 +66,8 @@ namespace ams::i2c::driver::impl {
|
|||
}
|
||||
|
||||
Result I2cSessionImpl::SendHandler(const u8 **cur_cmd, u8 **cur_dst) {
|
||||
AMS_UNUSED(cur_dst);
|
||||
|
||||
/* Read the header bytes. */
|
||||
const util::BitPack8 hdr0{*((*cur_cmd)++)};
|
||||
const util::BitPack8 hdr1{*((*cur_cmd)++)};
|
||||
|
@ -104,6 +106,8 @@ namespace ams::i2c::driver::impl {
|
|||
}
|
||||
|
||||
Result I2cSessionImpl::ExtensionHandler(const u8 **cur_cmd, u8 **cur_dst) {
|
||||
AMS_UNUSED(cur_dst);
|
||||
|
||||
/* Read the header bytes. */
|
||||
const util::BitPack8 hdr0{*((*cur_cmd)++)};
|
||||
|
||||
|
@ -167,6 +171,8 @@ namespace ams::i2c::driver::impl {
|
|||
}
|
||||
|
||||
Result I2cSessionImpl::ExecuteCommandList(void *dst, size_t dst_size, const void *src, size_t src_size) {
|
||||
AMS_UNUSED(dst_size);
|
||||
|
||||
/* Acquire exclusive access to the device. */
|
||||
std::scoped_lock lk(this->GetDevice().SafeCastTo<I2cDeviceProperty>().GetDriver().SafeCastTo<II2cDriver>().GetTransactionOrderMutex());
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ namespace ams::i2c {
|
|||
|
||||
{
|
||||
std::scoped_lock lk(g_i2c_pcv_mutex);
|
||||
g_i2c_pcv_manager = std::move(sp);
|
||||
g_i2c_pcv_manager = std::move(sp_pcv);
|
||||
AMS_ABORT_UNLESS(g_i2c_pcv_count == 0);
|
||||
g_i2c_pcv_count = 1;
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@ namespace ams::i2c::server {
|
|||
|
||||
Result ManagerImpl::OpenSessionForDev(ams::sf::Out<ams::sf::SharedPointer<i2c::sf::ISession>> out, s32 bus_idx, u16 slave_address, i2c::AddressingMode addressing_mode, i2c::SpeedMode speed_mode) {
|
||||
/* TODO */
|
||||
AMS_UNUSED(out, bus_idx, slave_address, addressing_mode, speed_mode);
|
||||
AMS_ABORT();
|
||||
}
|
||||
|
||||
|
@ -38,11 +39,13 @@ namespace ams::i2c::server {
|
|||
|
||||
Result ManagerImpl::HasDevice(ams::sf::Out<bool> out, i2c::I2cDevice device) {
|
||||
/* TODO */
|
||||
AMS_UNUSED(out, device);
|
||||
AMS_ABORT();
|
||||
}
|
||||
|
||||
Result ManagerImpl::HasDeviceForDev(ams::sf::Out<bool> out, i2c::I2cDevice device) {
|
||||
/* TODO */
|
||||
AMS_UNUSED(out, device);
|
||||
AMS_ABORT();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue