From 5447b25558e4ceed665c87538673f8b05fb1deb3 Mon Sep 17 00:00:00 2001 From: Dennis Bonke Date: Thu, 27 Jun 2024 10:29:07 +0200 Subject: [PATCH] everywhere: Fix a bunch of unused variable warnings --- posix/subsystem/src/subsystem/usb/attributes.cpp | 1 + posix/subsystem/src/subsystem/usb/devices.hpp | 2 +- posix/subsystem/src/un-socket.cpp | 3 ++- servers/netserver/src/ip/ip4.cpp | 7 ++++--- servers/netserver/src/ip/tcp4.cpp | 11 ++++++----- servers/netserver/src/ip/udp4.cpp | 7 ++++--- servers/netserver/src/netlink/netlink.cpp | 7 ++++--- servers/netserver/src/raw.cpp | 6 +++--- 8 files changed, 25 insertions(+), 19 deletions(-) diff --git a/posix/subsystem/src/subsystem/usb/attributes.cpp b/posix/subsystem/src/subsystem/usb/attributes.cpp index 92e0bf9e6..d154be2d0 100644 --- a/posix/subsystem/src/subsystem/usb/attributes.cpp +++ b/posix/subsystem/src/subsystem/usb/attributes.cpp @@ -165,6 +165,7 @@ async::result> EndpointAddressAttribute::show( async::result> PrettyIntervalAttribute::show(sysfs::Object *object) { auto device = static_cast(object); + (void)device; co_return std::format("{}ms\n", 0); } diff --git a/posix/subsystem/src/subsystem/usb/devices.hpp b/posix/subsystem/src/subsystem/usb/devices.hpp index 3d999afc7..4a466361f 100644 --- a/posix/subsystem/src/subsystem/usb/devices.hpp +++ b/posix/subsystem/src/subsystem/usb/devices.hpp @@ -55,7 +55,7 @@ struct UsbController final : UsbBase { struct UsbEndpoint final : sysfs::Object { UsbEndpoint(std::string sysfs_name, int64_t mbus_id, std::shared_ptr parent) : Object{parent, sysfs_name}, sysfs_name{sysfs_name} { - + (void)mbus_id; } protocols::usb::Device &device(); diff --git a/posix/subsystem/src/un-socket.cpp b/posix/subsystem/src/un-socket.cpp index a77fdba49..2b02a4ae7 100644 --- a/posix/subsystem/src/un-socket.cpp +++ b/posix/subsystem/src/un-socket.cpp @@ -229,7 +229,7 @@ struct OpenFile : File { } async::result> - sendMsg(Process *process, uint32_t flags, const void *data, size_t max_length, + sendMsg(Process *, uint32_t flags, const void *data, size_t max_length, const void *, size_t, std::vector> files, struct ucred ucreds) override { assert(!(flags & ~(MSG_DONTWAIT))); @@ -512,6 +512,7 @@ struct OpenFile : File { conversation, helix_ng::sendBuffer(ser.data(), ser.size()) ); + (void)send_resp; co_return; } } diff --git a/servers/netserver/src/ip/ip4.cpp b/servers/netserver/src/ip/ip4.cpp index fda735d63..9a449b8ec 100644 --- a/servers/netserver/src/ip/ip4.cpp +++ b/servers/netserver/src/ip/ip4.cpp @@ -187,9 +187,10 @@ async::result> Ip4Socket::sendmsg(vo void *data, size_t len, void *addr_ptr, size_t addr_size, std::vector fds, struct ucred ucreds) { - (void) creds; - (void) flags; - (void) fds; + (void)creds; + (void)flags; + (void)fds; + (void)ucreds; using arch::convert_endian; using arch::endian; diff --git a/servers/netserver/src/ip/tcp4.cpp b/servers/netserver/src/ip/tcp4.cpp index ba24f48ae..879374e92 100644 --- a/servers/netserver/src/ip/tcp4.cpp +++ b/servers/netserver/src/ip/tcp4.cpp @@ -402,11 +402,12 @@ struct Tcp4Socket { void *data, size_t size, void *addrPtr, size_t addrSize, std::vector fds, struct ucred ucreds) { - (void) creds; - (void) flags; - (void) addrPtr; - (void) addrSize; - (void) fds; + (void)creds; + (void)flags; + (void)addrPtr; + (void)addrSize; + (void)fds; + (void)ucreds; auto self = static_cast(object); auto p = reinterpret_cast(data); diff --git a/servers/netserver/src/ip/udp4.cpp b/servers/netserver/src/ip/udp4.cpp index f99b87815..2d35dbfc9 100644 --- a/servers/netserver/src/ip/udp4.cpp +++ b/servers/netserver/src/ip/udp4.cpp @@ -269,9 +269,10 @@ struct Udp4Socket { void *data, size_t len, void *addr_ptr, size_t addr_size, std::vector fds, struct ucred ucreds) { - (void) creds; - (void) flags; - (void) fds; + (void)creds; + (void)flags; + (void)fds; + (void)ucreds; using arch::convert_endian; using arch::endian; diff --git a/servers/netserver/src/netlink/netlink.cpp b/servers/netserver/src/netlink/netlink.cpp index b5afb3f98..89c56ceba 100644 --- a/servers/netserver/src/netlink/netlink.cpp +++ b/servers/netserver/src/netlink/netlink.cpp @@ -102,9 +102,10 @@ async::result NetlinkSocket::recvMsg(void *obj, async::result> NetlinkSocket::sendMsg(void *obj, const char *creds, uint32_t flags, void *data, size_t len, void *addr_ptr, size_t addr_size, std::vector fds, struct ucred ucreds) { - (void) creds; - (void) addr_ptr; - (void) addr_size; + (void)creds; + (void)addr_ptr; + (void)addr_size; + (void)ucreds; if(logSocket) std::cout << "netserver: sendMsg on netlink socket!" << std::endl; diff --git a/servers/netserver/src/raw.cpp b/servers/netserver/src/raw.cpp index 2a1d3d80c..fc48115b0 100644 --- a/servers/netserver/src/raw.cpp +++ b/servers/netserver/src/raw.cpp @@ -13,7 +13,7 @@ Raw &raw() { return inst; } -managarm::fs::Errors Raw::serveSocket(helix::UniqueLane lane, int type, int proto, int flags) { +managarm::fs::Errors Raw::serveSocket(helix::UniqueLane lane, int, int proto, int flags) { assert(proto == htons(ETH_P_ALL)); auto raw_socket = smarter::make_shared(this, flags); raw_socket->holder_ = raw_socket; @@ -44,7 +44,7 @@ void Raw::feedPacket(arch::dma_buffer_view frame) { } async::result RawSocket::bind(void* obj, - const char *creds, const void *addr_ptr, size_t addr_size) { + const char *, const void *addr_ptr, size_t addr_size) { if(!addr_ptr || addr_size < sizeof(sockaddr)) co_return protocols::fs::Error::illegalArguments; @@ -70,7 +70,7 @@ async::result RawSocket::bind(void* obj, } async::result> RawSocket::write(void *obj, - const char *credentials, const void *buffer, size_t length) { + const char *, const void *buffer, size_t length) { auto self = static_cast(obj); assert(self->link);