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

@ -52,6 +52,8 @@ namespace ams::htcs::impl::rpc {
}
Result AcceptTask::ProcessResponse(const char *data, size_t size) {
AMS_UNUSED(size);
/* Convert the input to a packet. */
auto *packet = reinterpret_cast<const HtcsRpcPacket *>(data);
@ -62,6 +64,8 @@ namespace ams::htcs::impl::rpc {
}
Result AcceptTask::CreateRequest(size_t *out, char *data, size_t size, u32 task_id) {
AMS_UNUSED(size);
/* Create the packet. */
auto *packet = reinterpret_cast<HtcsRpcPacket *>(data);
*packet = {

View file

@ -46,6 +46,8 @@ namespace ams::htcs::impl::rpc {
}
Result BindTask::ProcessResponse(const char *data, size_t size) {
AMS_UNUSED(size);
/* Convert the input to a packet. */
auto *packet = reinterpret_cast<const HtcsRpcPacket *>(data);
@ -56,6 +58,8 @@ namespace ams::htcs::impl::rpc {
}
Result BindTask::CreateRequest(size_t *out, char *data, size_t size, u32 task_id) {
AMS_UNUSED(size);
/* Create the packet. */
auto *packet = reinterpret_cast<HtcsRpcPacket *>(data);
*packet = {

View file

@ -44,6 +44,8 @@ namespace ams::htcs::impl::rpc {
}
Result CloseTask::ProcessResponse(const char *data, size_t size) {
AMS_UNUSED(size);
/* Convert the input to a packet. */
auto *packet = reinterpret_cast<const HtcsRpcPacket *>(data);
@ -54,6 +56,8 @@ namespace ams::htcs::impl::rpc {
}
Result CloseTask::CreateRequest(size_t *out, char *data, size_t size, u32 task_id) {
AMS_UNUSED(size);
/* Create the packet. */
auto *packet = reinterpret_cast<HtcsRpcPacket *>(data);
*packet = {

View file

@ -46,6 +46,8 @@ namespace ams::htcs::impl::rpc {
}
Result ConnectTask::ProcessResponse(const char *data, size_t size) {
AMS_UNUSED(size);
/* Convert the input to a packet. */
auto *packet = reinterpret_cast<const HtcsRpcPacket *>(data);
@ -56,6 +58,8 @@ namespace ams::htcs::impl::rpc {
}
Result ConnectTask::CreateRequest(size_t *out, char *data, size_t size, u32 task_id) {
AMS_UNUSED(size);
/* Create the packet. */
auto *packet = reinterpret_cast<HtcsRpcPacket *>(data);
*packet = {

View file

@ -48,6 +48,8 @@ namespace ams::htcs::impl::rpc {
}
Result FcntlTask::ProcessResponse(const char *data, size_t size) {
AMS_UNUSED(size);
/* Convert the input to a packet. */
auto *packet = reinterpret_cast<const HtcsRpcPacket *>(data);
@ -58,6 +60,8 @@ namespace ams::htcs::impl::rpc {
}
Result FcntlTask::CreateRequest(size_t *out, char *data, size_t size, u32 task_id) {
AMS_UNUSED(size);
/* Create the packet. */
auto *packet = reinterpret_cast<HtcsRpcPacket *>(data);
*packet = {

View file

@ -45,6 +45,8 @@ namespace ams::htcs::impl::rpc {
}
Result ListenTask::ProcessResponse(const char *data, size_t size) {
AMS_UNUSED(size);
/* Convert the input to a packet. */
auto *packet = reinterpret_cast<const HtcsRpcPacket *>(data);
@ -55,6 +57,8 @@ namespace ams::htcs::impl::rpc {
}
Result ListenTask::CreateRequest(size_t *out, char *data, size_t size, u32 task_id) {
AMS_UNUSED(size);
/* Create the packet. */
auto *packet = reinterpret_cast<HtcsRpcPacket *>(data);
*packet = {

View file

@ -51,6 +51,8 @@ namespace ams::htcs::impl::rpc {
}
Result ReceiveSmallTask::ProcessResponse(const char *data, size_t size) {
AMS_UNUSED(size);
/* Convert the input to a packet. */
auto *packet = reinterpret_cast<const HtcsRpcPacket *>(data);
@ -64,6 +66,8 @@ namespace ams::htcs::impl::rpc {
}
Result ReceiveSmallTask::CreateRequest(size_t *out, char *data, size_t size, u32 task_id) {
AMS_UNUSED(size);
/* Create the packet. */
auto *packet = reinterpret_cast<HtcsRpcPacket *>(data);
*packet = {

View file

@ -51,6 +51,8 @@ namespace ams::htcs::impl::rpc {
}
Result ReceiveTask::ProcessResponse(const char *data, size_t size) {
AMS_UNUSED(size);
/* Convert the input to a packet. */
auto *packet = reinterpret_cast<const HtcsRpcPacket *>(data);
@ -61,6 +63,8 @@ namespace ams::htcs::impl::rpc {
}
Result ReceiveTask::CreateRequest(size_t *out, char *data, size_t size, u32 task_id) {
AMS_UNUSED(size);
/* Create the packet. */
auto *packet = reinterpret_cast<HtcsRpcPacket *>(data);
*packet = {
@ -85,6 +89,8 @@ namespace ams::htcs::impl::rpc {
}
Result ReceiveTask::CreateNotification(size_t *out, char *data, size_t size, u32 task_id) {
AMS_UNUSED(size);
/* Create the packet. */
auto *packet = reinterpret_cast<HtcsRpcPacket *>(data);
*packet = {

View file

@ -49,7 +49,7 @@ namespace ams::htcs::impl::rpc {
AMS_ASSERT(0 <= write_handle_count && write_handle_count < SocketCountMax);
AMS_ASSERT(0 <= exception_handle_count && exception_handle_count < SocketCountMax);
AMS_ASSERT(handle_count * static_cast<s64>(sizeof(s32)) == body_size);
AMS_UNUSED(handle_count);
AMS_UNUSED(handle_count, body_size);
/* Set our results. */
m_err = err;
@ -106,6 +106,8 @@ namespace ams::htcs::impl::rpc {
}
Result SelectTask::ProcessResponse(const char *data, size_t size) {
AMS_UNUSED(size);
/* Convert the input to a packet. */
auto *packet = reinterpret_cast<const HtcsRpcPacket *>(data);
@ -116,6 +118,8 @@ namespace ams::htcs::impl::rpc {
}
Result SelectTask::CreateRequest(size_t *out, char *data, size_t size, u32 task_id) {
AMS_UNUSED(size);
/* Determine the body size. */
const auto handle_count = m_read_handle_count + m_write_handle_count + m_exception_handle_count;
const s64 body_size = static_cast<s64>(handle_count * sizeof(s32));

View file

@ -86,6 +86,8 @@ namespace ams::htcs::impl::rpc {
}
Result SendSmallTask::ProcessResponse(const char *data, size_t size) {
AMS_UNUSED(size);
/* Convert the input to a packet. */
auto *packet = reinterpret_cast<const HtcsRpcPacket *>(data);
@ -96,6 +98,8 @@ namespace ams::htcs::impl::rpc {
}
Result SendSmallTask::CreateRequest(size_t *out, char *data, size_t size, u32 task_id) {
AMS_UNUSED(size);
/* Sanity check our size. */
AMS_ASSERT(sizeof(HtcsRpcPacket) + this->GetBufferSize() <= size);

View file

@ -81,6 +81,8 @@ namespace ams::htcs::impl::rpc {
}
Result SendTask::ProcessResponse(const char *data, size_t size) {
AMS_UNUSED(size);
/* Convert the input to a packet. */
auto *packet = reinterpret_cast<const HtcsRpcPacket *>(data);
@ -91,6 +93,8 @@ namespace ams::htcs::impl::rpc {
}
Result SendTask::CreateRequest(size_t *out, char *data, size_t size, u32 task_id) {
AMS_UNUSED(size);
/* Create the packet. */
auto *packet = reinterpret_cast<HtcsRpcPacket *>(data);
*packet = {
@ -115,11 +119,15 @@ namespace ams::htcs::impl::rpc {
}
Result SendTask::ProcessNotification(const char *data, size_t size) {
AMS_UNUSED(data, size);
this->NotifyDataChannelReady();
return ResultSuccess();
}
Result SendTask::CreateNotification(size_t *out, char *data, size_t size, u32 task_id) {
AMS_UNUSED(size);
/* Create the packet. */
auto *packet = reinterpret_cast<HtcsRpcPacket *>(data);
*packet = {

View file

@ -45,6 +45,8 @@ namespace ams::htcs::impl::rpc {
}
Result ShutdownTask::ProcessResponse(const char *data, size_t size) {
AMS_UNUSED(size);
/* Convert the input to a packet. */
auto *packet = reinterpret_cast<const HtcsRpcPacket *>(data);
@ -55,6 +57,8 @@ namespace ams::htcs::impl::rpc {
}
Result ShutdownTask::CreateRequest(size_t *out, char *data, size_t size, u32 task_id) {
AMS_UNUSED(size);
/* Create the packet. */
auto *packet = reinterpret_cast<HtcsRpcPacket *>(data);
*packet = {

View file

@ -53,6 +53,8 @@ namespace ams::htcs::impl::rpc {
}
Result SocketTask::ProcessResponse(const char *data, size_t size) {
AMS_UNUSED(size);
/* Convert the input to a packet. */
auto *packet = reinterpret_cast<const HtcsRpcPacket *>(data);
@ -66,6 +68,8 @@ namespace ams::htcs::impl::rpc {
}
Result SocketTask::CreateRequest(size_t *out, char *data, size_t size, u32 task_id) {
AMS_UNUSED(size);
/* Create the packet. */
auto *packet = reinterpret_cast<HtcsRpcPacket *>(data);
*packet = {