libstrat: enable -Wextra, -Werror

This caught an embarrassingly large number of bugs.
This commit is contained in:
Michael Scire
2021-10-06 15:20:48 -07:00
parent e1fbf27398
commit 7ca83c9d3b
160 changed files with 691 additions and 152 deletions

View File

@@ -36,6 +36,7 @@ namespace ams::htc::server::driver {
void HtclowDriver::SetDisconnectionEmulationEnabled(bool en) {
/* NOTE: Nintendo ignores the input, here. */
AMS_UNUSED(en);
m_disconnection_emulation_enabled = false;
}

View File

@@ -69,11 +69,13 @@ namespace ams::htc::server {
Result HtcServiceObject::GetHostConnectionEventForSystem(sf::OutCopyHandle out) {
/* NOTE: Nintendo presumably reserved this command in case they need it, but they haven't implemented it yet. */
AMS_UNUSED(out);
AMS_ABORT("HostEventForSystem not implemented.");
}
Result HtcServiceObject::GetHostDisconnectionEventForSystem(sf::OutCopyHandle out) {
/* NOTE: Nintendo presumably reserved this command in case they need it, but they haven't implemented it yet. */
AMS_UNUSED(out);
AMS_ABORT("HostEventForSystem not implemented.");
}
@@ -114,41 +116,49 @@ namespace ams::htc::server {
Result HtcServiceObject::GetBridgeIpAddress(const sf::OutBuffer &out) {
/* NOTE: Atmosphere does not support HostBridge, and it's unclear if we ever will. */
AMS_UNUSED(out);
AMS_ABORT("HostBridge currently not supported.");
}
Result HtcServiceObject::GetBridgePort(const sf::OutBuffer &out) {
/* NOTE: Atmosphere does not support HostBridge, and it's unclear if we ever will. */
AMS_UNUSED(out);
AMS_ABORT("HostBridge currently not supported.");
}
Result HtcServiceObject::SetCradleAttached(bool attached) {
/* NOTE: Atmosphere does not support HostBridge, and it's unclear if we ever will. */
AMS_UNUSED(attached);
AMS_ABORT("HostBridge currently not supported.");
}
Result HtcServiceObject::GetBridgeSubnetMask(const sf::OutBuffer &out) {
/* NOTE: Atmosphere does not support HostBridge, and it's unclear if we ever will. */
AMS_UNUSED(out);
AMS_ABORT("HostBridge currently not supported.");
}
Result HtcServiceObject::GetBridgeMacAddress(const sf::OutBuffer &out) {
/* NOTE: Atmosphere does not support HostBridge, and it's unclear if we ever will. */
AMS_UNUSED(out);
AMS_ABORT("HostBridge currently not supported.");
}
Result HtcServiceObject::SetBridgeIpAddress(const sf::InBuffer &arg) {
/* NOTE: Atmosphere does not support HostBridge, and it's unclear if we ever will. */
AMS_UNUSED(arg);
AMS_ABORT("HostBridge currently not supported.");
}
Result HtcServiceObject::SetBridgeSubnetMask(const sf::InBuffer &arg) {
/* NOTE: Atmosphere does not support HostBridge, and it's unclear if we ever will. */
AMS_UNUSED(arg);
AMS_ABORT("HostBridge currently not supported.");
}
Result HtcServiceObject::SetBridgePort(const sf::InBuffer &arg) {
/* NOTE: Atmosphere does not support HostBridge, and it's unclear if we ever will. */
AMS_UNUSED(arg);
AMS_ABORT("HostBridge currently not supported.");
}

View File

@@ -31,6 +31,8 @@ namespace ams::htc::server {
}
void InitializePowerStateMonitor(htclow::impl::DriverType driver_type, htclow::HtclowManager *htclow_manager) {
AMS_UNUSED(driver_type);
/* Set the htclow manager. */
g_htclow_manager = htclow_manager;

View File

@@ -135,6 +135,7 @@ namespace ams::htc::server::rpc {
Result HtcmiscRpcServer::ProcessSetTargetNameRequest(const char *name, size_t size, u32 task_id) {
/* TODO: we need to use settings::fwdbg::SetSettingsItemValue here, but this will require ams support for set:fd re-enable? */
/* Needs some thought. */
AMS_UNUSED(name, size, task_id);
AMS_ABORT("HtcmiscRpcServer::ProcessSetTargetNameRequest");
}

View File

@@ -84,6 +84,7 @@ namespace ams::htc::server::rpc {
Result GetEnvironmentVariableTask::CreateRequest(size_t *out, char *data, size_t size, u32 task_id) {
/* Validate pre-conditions. */
AMS_ASSERT(size >= sizeof(HtcmiscRpcPacket));
AMS_UNUSED(size);
/* Create the packet. */
auto *packet = reinterpret_cast<HtcmiscRpcPacket *>(data);
@@ -182,6 +183,7 @@ namespace ams::htc::server::rpc {
Result GetEnvironmentVariableLengthTask::CreateRequest(size_t *out, char *data, size_t size, u32 task_id) {
/* Validate pre-conditions. */
AMS_ASSERT(size >= sizeof(HtcmiscRpcPacket));
AMS_UNUSED(size);
/* Create the packet. */
auto *packet = reinterpret_cast<HtcmiscRpcPacket *>(data);
@@ -257,6 +259,7 @@ namespace ams::htc::server::rpc {
Result RunOnHostTask::CreateRequest(size_t *out, char *data, size_t size, u32 task_id) {
/* Validate pre-conditions. */
AMS_ASSERT(size >= sizeof(HtcmiscRpcPacket));
AMS_UNUSED(size);
/* Create the packet. */
auto *packet = reinterpret_cast<HtcmiscRpcPacket *>(data);
@@ -282,6 +285,10 @@ namespace ams::htc::server::rpc {
}
Result RunOnHostTask::ProcessResponse(const char *data, size_t size) {
/* Validate pre-conditions. */
AMS_ASSERT(size >= sizeof(HtcmiscRpcPacket));
AMS_UNUSED(size);
this->Complete(reinterpret_cast<const HtcmiscRpcPacket *>(data)->params[0]);
return ResultSuccess();
}

View File

@@ -360,6 +360,8 @@ namespace ams::htc::server::rpc {
/* Copy the received data. */
AMS_ASSERT(0 <= result_size && result_size <= buffer_size);
AMS_UNUSED(buffer_size);
std::memcpy(buffer, result_buffer, result_size);
return ResultSuccess();

View File

@@ -88,18 +88,22 @@ namespace ams::htc::server::rpc {
}
virtual Result ProcessResponse(const char *data, size_t size) {
AMS_UNUSED(data, size);
return ResultSuccess();
}
virtual Result CreateRequest(size_t *out, char *data, size_t size, u32 task_id) {
AMS_UNUSED(out, data, size, task_id);
return ResultSuccess();
}
virtual Result ProcessNotification(const char *data, size_t size) {
AMS_UNUSED(data, size);
return ResultSuccess();
}
virtual Result CreateNotification(size_t *out, char *data, size_t size, u32 task_id) {
AMS_UNUSED(out, data, size, task_id);
return ResultSuccess();
}