Fix unused variable warnings in ntcore (#1416)

This avoids -Wextra warnings.
This commit is contained in:
Austin Schuh
2018-11-09 20:02:58 -08:00
committed by Peter Johnson
parent 7c9a3c4d77
commit ac751d3224
4 changed files with 9 additions and 8 deletions

View File

@@ -22,8 +22,8 @@ class ConnectionNotifierThread
public:
explicit ConnectionNotifierThread(int inst) : m_inst(inst) {}
bool Matches(const ListenerData& listener,
const ConnectionNotification& data) {
bool Matches(const ListenerData& /*listener*/,
const ConnectionNotification& /*data*/) {
return true;
}

View File

@@ -44,11 +44,12 @@ class RpcServerThread
RpcServerThread(int inst, wpi::Logger& logger)
: m_inst(inst), m_logger(logger) {}
bool Matches(const RpcListenerData& listener, const RpcNotifierData& data) {
bool Matches(const RpcListenerData& /*listener*/,
const RpcNotifierData& data) {
return !data.name.empty() && data.send_response;
}
void SetListener(RpcNotifierData* data, unsigned int listener_uid) {
void SetListener(RpcNotifierData* data, unsigned int /*listener_uid*/) {
unsigned int local_id = Handle{data->entry}.GetIndex();
unsigned int call_uid = Handle{data->call}.GetIndex();
RpcIdPair lookup_uid{local_id, call_uid};

View File

@@ -310,7 +310,7 @@ void Storage::ProcessIncomingClearEntries(std::shared_ptr<Message> msg,
}
void Storage::ProcessIncomingExecuteRpc(
std::shared_ptr<Message> msg, INetworkConnection* conn,
std::shared_ptr<Message> msg, INetworkConnection* /*conn*/,
std::weak_ptr<INetworkConnection> conn_weak) {
std::unique_lock<wpi::mutex> lock(m_mutex);
if (!m_server) return; // only process on server
@@ -350,7 +350,7 @@ void Storage::ProcessIncomingExecuteRpc(
}
void Storage::ProcessIncomingRpcResponse(std::shared_ptr<Message> msg,
INetworkConnection* conn) {
INetworkConnection* /*conn*/) {
std::unique_lock<wpi::mutex> lock(m_mutex);
if (m_server) return; // only process on client
unsigned int id = msg->id();
@@ -387,7 +387,7 @@ void Storage::GetInitialAssignments(
void Storage::ApplyInitialAssignments(
INetworkConnection& conn, wpi::ArrayRef<std::shared_ptr<Message>> msgs,
bool new_server, std::vector<std::shared_ptr<Message>>* out_msgs) {
bool /*new_server*/, std::vector<std::shared_ptr<Message>>* out_msgs) {
std::unique_lock<wpi::mutex> lock(m_mutex);
if (m_server) return; // should not do this on server

View File

@@ -727,7 +727,7 @@ void NT_InitString(NT_String* str) {
str->len = 0;
}
void NT_DisposeEntryArray(NT_Entry* arr, size_t count) { std::free(arr); }
void NT_DisposeEntryArray(NT_Entry* arr, size_t /*count*/) { std::free(arr); }
void NT_DisposeConnectionInfoArray(NT_ConnectionInfo* arr, size_t count) {
for (size_t i = 0; i < count; i++) DisposeConnectionInfo(&arr[i]);