strat: build sysmodules with -Wextra/-Werror

This commit is contained in:
Michael Scire
2021-10-06 23:22:54 -07:00
parent e8f1efd01b
commit 6a53726833
61 changed files with 433 additions and 217 deletions

View File

@@ -64,7 +64,7 @@ namespace ams::mitm::socket::resolver {
os::ThreadType g_extra_threads[NumExtraThreads];
void LoopServerThread(void *arg) {
void LoopServerThread(void *) {
/* Loop forever, servicing our services. */
g_server_manager.LoopProcess();
}
@@ -114,7 +114,7 @@ namespace ams::mitm::socket::resolver {
}
void MitmModule::ThreadFunction(void *arg) {
void MitmModule::ThreadFunction(void *) {
/* Wait until initialization is complete. */
mitm::WaitInitialized();

View File

@@ -40,6 +40,8 @@ namespace ams::mitm::socket::resolver {
}
ssize_t SerializeRedirectedAddrInfo(u8 * const dst, size_t dst_size, const char *hostname, ams::socket::InAddrT redirect_addr, u16 redirect_port, const struct addrinfo *hint) {
AMS_UNUSED(hostname);
struct addrinfo ai = {
.ai_flags = 0,
.ai_family = AF_UNSPEC,
@@ -85,6 +87,8 @@ namespace ams::mitm::socket::resolver {
}
Result ResolverImpl::GetHostByNameRequest(u32 cancel_handle, const sf::ClientProcessId &client_pid, bool use_nsd_resolve, const sf::InBuffer &name, sf::Out<u32> out_host_error, sf::Out<u32> out_errno, const sf::OutBuffer &out_hostent, sf::Out<u32> out_size) {
AMS_UNUSED(cancel_handle, client_pid, use_nsd_resolve);
const char *hostname = reinterpret_cast<const char *>(name.GetPointer());
LogDebug("[%016lx]: GetHostByNameRequest(%s)\n", this->client_info.program_id.value, hostname);
@@ -105,6 +109,8 @@ namespace ams::mitm::socket::resolver {
}
Result ResolverImpl::GetAddrInfoRequest(u32 cancel_handle, const sf::ClientProcessId &client_pid, bool use_nsd_resolve, const sf::InBuffer &node, const sf::InBuffer &srv, const sf::InBuffer &serialized_hint, const sf::OutBuffer &out_addrinfo, sf::Out<u32> out_errno, sf::Out<s32> out_retval, sf::Out<u32> out_size) {
AMS_UNUSED(cancel_handle, client_pid, use_nsd_resolve);
const char *hostname = reinterpret_cast<const char *>(node.GetPointer());
LogDebug("[%016lx]: GetAddrInfoRequest(%s, %s)\n", this->client_info.program_id.value, reinterpret_cast<const char *>(node.GetPointer()), reinterpret_cast<const char *>(srv.GetPointer()));
@@ -142,6 +148,8 @@ namespace ams::mitm::socket::resolver {
}
Result ResolverImpl::GetHostByNameRequestWithOptions(const sf::ClientProcessId &client_pid, const sf::InAutoSelectBuffer &name, const sf::OutAutoSelectBuffer &out_hostent, sf::Out<u32> out_size, u32 options_version, const sf::InAutoSelectBuffer &options, u32 num_options, sf::Out<s32> out_host_error, sf::Out<s32> out_errno) {
AMS_UNUSED(client_pid, options_version, options, num_options);
const char *hostname = reinterpret_cast<const char *>(name.GetPointer());
LogDebug("[%016lx]: GetHostByNameRequestWithOptions(%s)\n", this->client_info.program_id.value, hostname);
@@ -162,6 +170,8 @@ namespace ams::mitm::socket::resolver {
}
Result ResolverImpl::GetAddrInfoRequestWithOptions(const sf::ClientProcessId &client_pid, const sf::InBuffer &node, const sf::InBuffer &srv, const sf::InBuffer &serialized_hint, const sf::OutAutoSelectBuffer &out_addrinfo, sf::Out<u32> out_size, sf::Out<s32> out_retval, u32 options_version, const sf::InAutoSelectBuffer &options, u32 num_options, sf::Out<s32> out_host_error, sf::Out<s32> out_errno) {
AMS_UNUSED(client_pid, options_version, options, num_options);
const char *hostname = reinterpret_cast<const char *>(node.GetPointer());
LogDebug("[%016lx]: GetAddrInfoRequestWithOptions(%s, %s)\n", this->client_info.program_id.value, hostname, reinterpret_cast<const char *>(srv.GetPointer()));

View File

@@ -35,6 +35,7 @@ namespace ams::mitm::socket::resolver {
/* We will mitm:
* - everything.
*/
AMS_UNUSED(client_info);
return true;
}
public:

View File

@@ -20,6 +20,9 @@
namespace ams::mitm::socket::resolver::serializer {
ssize_t DNSSerializer::CheckToBufferArguments(const u8 *dst, size_t dst_size, size_t required, int error_id) {
/* TODO: Logging, using error_id */
AMS_UNUSED(error_id);
if (dst == nullptr) {
return -1;
} else if (dst_size < required) {

View File

@@ -26,7 +26,7 @@ namespace ams::mitm::socket::resolver::serializer {
concept IsInAddr = std::same_as<T, ams::socket::InAddr> || std::same_as<T, struct in_addr>;
template<typename T> requires IsInAddr<T>
size_t SizeOfImpl(const T &in) {
size_t SizeOfImpl(const T &) {
return sizeof(u32);
}