Skip to content

Commit

Permalink
everywhere: Fix a bunch of unused variable warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennisbonke committed Jun 27, 2024
1 parent 052830d commit 5447b25
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 19 deletions.
1 change: 1 addition & 0 deletions posix/subsystem/src/subsystem/usb/attributes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ async::result<frg::expected<Error, std::string>> EndpointAddressAttribute::show(

async::result<frg::expected<Error, std::string>> PrettyIntervalAttribute::show(sysfs::Object *object) {
auto device = static_cast<UsbEndpoint *>(object);
(void)device;
co_return std::format("{}ms\n", 0);
}

Expand Down
2 changes: 1 addition & 1 deletion posix/subsystem/src/subsystem/usb/devices.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<drvcore::Device> parent)
: Object{parent, sysfs_name}, sysfs_name{sysfs_name} {

(void)mbus_id;
}

protocols::usb::Device &device();
Expand Down
3 changes: 2 additions & 1 deletion posix/subsystem/src/un-socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ struct OpenFile : File {
}

async::result<frg::expected<protocols::fs::Error, size_t>>
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<smarter::shared_ptr<File, FileHandle>> files, struct ucred ucreds) override {
assert(!(flags & ~(MSG_DONTWAIT)));
Expand Down Expand Up @@ -512,6 +512,7 @@ struct OpenFile : File {
conversation,
helix_ng::sendBuffer(ser.data(), ser.size())
);
(void)send_resp;
co_return;
}
}
Expand Down
7 changes: 4 additions & 3 deletions servers/netserver/src/ip/ip4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,10 @@ async::result<frg::expected<protocols::fs::Error, size_t>> Ip4Socket::sendmsg(vo
void *data, size_t len,
void *addr_ptr, size_t addr_size,
std::vector<uint32_t> 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;
Expand Down
11 changes: 6 additions & 5 deletions servers/netserver/src/ip/tcp4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,11 +402,12 @@ struct Tcp4Socket {
void *data, size_t size,
void *addrPtr, size_t addrSize,
std::vector<uint32_t> 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<Tcp4Socket *>(object);
auto p = reinterpret_cast<char *>(data);
Expand Down
7 changes: 4 additions & 3 deletions servers/netserver/src/ip/udp4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,10 @@ struct Udp4Socket {
void *data, size_t len,
void *addr_ptr, size_t addr_size,
std::vector<uint32_t> 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;
Expand Down
7 changes: 4 additions & 3 deletions servers/netserver/src/netlink/netlink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,10 @@ async::result<protocols::fs::RecvResult> NetlinkSocket::recvMsg(void *obj,
async::result<frg::expected<protocols::fs::Error, size_t>> NetlinkSocket::sendMsg(void *obj,
const char *creds, uint32_t flags, void *data, size_t len,
void *addr_ptr, size_t addr_size, std::vector<uint32_t> 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;
Expand Down
6 changes: 3 additions & 3 deletions servers/netserver/src/raw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<RawSocket>(this, flags);
raw_socket->holder_ = raw_socket;
Expand Down Expand Up @@ -44,7 +44,7 @@ void Raw::feedPacket(arch::dma_buffer_view frame) {
}

async::result<protocols::fs::Error> 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;

Expand All @@ -70,7 +70,7 @@ async::result<protocols::fs::Error> RawSocket::bind(void* obj,
}

async::result<frg::expected<protocols::fs::Error, size_t>> 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<RawSocket *>(obj);
assert(self->link);

Expand Down

0 comments on commit 5447b25

Please sign in to comment.