Fix unused parameter errors/warnings (#805)

This commit is contained in:
An Tao 2021-04-15 23:26:58 +08:00 committed by GitHub
parent 44a8a2d5f7
commit ab5eb955b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 25 additions and 15 deletions

View File

@ -109,7 +109,7 @@ jobs:
# Installing packages might fail as the github image becomes outdated # Installing packages might fail as the github image becomes outdated
sudo apt update sudo apt update
# These aren't available or don't work well in vcpkg # These aren't available or don't work well in vcpkg
sudo apt install libjsoncpp-dev uuid-dev openssl libssl-dev zlib1g-dev postgresql-all libsqlite3-dev sudo apt install libjsoncpp-dev uuid-dev openssl libssl-dev zlib1g-dev libsqlite3-dev
sudo apt install libbrotli-dev sudo apt install libbrotli-dev
- name: (Linux) Install gcc-10 - name: (Linux) Install gcc-10
if: matrix.buildname == 'ubuntu-20.04/gcc-10' if: matrix.buildname == 'ubuntu-20.04/gcc-10'
@ -122,6 +122,11 @@ jobs:
sudo apt update sudo apt update
sudo apt install boost1.67 sudo apt install boost1.67
- name: (Linux) Install postgresql
if: matrix.os == 'ubuntu-20.04'
run: |
sudo apt install postgresql-all
- name: install gtest - name: install gtest
run: | run: |
wget https://github.com/google/googletest/archive/release-1.10.0.tar.gz wget https://github.com/google/googletest/archive/release-1.10.0.tar.gz

View File

@ -73,8 +73,13 @@ std::vector<trantor::EventLoop *> ListenerManager::createListeners(
const WebSocketNewAsyncCallback &webSocketCallback, const WebSocketNewAsyncCallback &webSocketCallback,
const ConnectionCallback &connectionCallback, const ConnectionCallback &connectionCallback,
size_t connectionTimeout, size_t connectionTimeout,
#ifdef OpenSSL_FOUND
const std::string &globalCertFile, const std::string &globalCertFile,
const std::string &globalKeyFile, const std::string &globalKeyFile,
#else
const std::string & /*globalCertFile*/,
const std::string & /*globalKeyFile*/,
#endif
size_t threadNum, size_t threadNum,
const std::vector<std::function<HttpResponsePtr(const HttpRequestPtr &)>> const std::vector<std::function<HttpResponsePtr(const HttpRequestPtr &)>>
&syncAdvices) &syncAdvices)

View File

@ -1161,13 +1161,13 @@ std::string brotliDecompress(const char *data, const size_t ndata)
return decompressed; return decompressed;
} }
#else #else
std::string brotliCompress(const char *data, const size_t ndata) std::string brotliCompress(const char * /*data*/, const size_t /*ndata*/)
{ {
LOG_ERROR << "If you do not have the brotli package installed, you cannot " LOG_ERROR << "If you do not have the brotli package installed, you cannot "
"use brotliCompress()"; "use brotliCompress()";
abort(); abort();
} }
std::string brotliDecompress(const char *data, const size_t ndata) std::string brotliDecompress(const char * /*data*/, const size_t /*ndata*/)
{ {
LOG_ERROR << "If you do not have the brotli package installed, you cannot " LOG_ERROR << "If you do not have the brotli package installed, you cannot "
"use brotliDecompress()"; "use brotliDecompress()";

View File

@ -182,7 +182,7 @@ void RedisClientImpl::newTransactionAsync(
std::weak_ptr<RedisClientImpl> thisWeakPtr = shared_from_this(); std::weak_ptr<RedisClientImpl> thisWeakPtr = shared_from_this();
std::lock_guard<std::mutex> lock(connectionsMutex_); std::lock_guard<std::mutex> lock(connectionsMutex_);
tasks_.emplace( tasks_.emplace(
[callback, thisWeakPtr](const RedisConnectionPtr &connPtr) { [callback, thisWeakPtr](const RedisConnectionPtr & /*connPtr*/) {
auto thisPtr = thisWeakPtr.lock(); auto thisPtr = thisWeakPtr.lock();
if (thisPtr) if (thisPtr)
{ {
@ -230,4 +230,4 @@ void RedisClientImpl::handleNextTask(const RedisConnectionPtr &connPtr)
{ {
task(connPtr); task(connPtr);
} }
} }

View File

@ -161,7 +161,7 @@ void RedisClientLockFree::newTransactionAsync(
{ {
std::weak_ptr<RedisClientLockFree> thisWeakPtr = shared_from_this(); std::weak_ptr<RedisClientLockFree> thisWeakPtr = shared_from_this();
tasks_.emplace( tasks_.emplace(
[callback, thisWeakPtr](const RedisConnectionPtr &connPtr) { [callback, thisWeakPtr](const RedisConnectionPtr & /*connPtr*/) {
auto thisPtr = thisWeakPtr.lock(); auto thisPtr = thisWeakPtr.lock();
if (thisPtr) if (thisPtr)
{ {
@ -205,4 +205,4 @@ void RedisClientLockFree::handleNextTask(const RedisConnectionPtr &connPtr)
{ {
task(connPtr); task(connPtr);
} }
} }

View File

@ -113,7 +113,7 @@ void RedisConnection::startConnectionInLoop()
} }
}); });
redisAsyncSetDisconnectCallback( redisAsyncSetDisconnectCallback(
redisContext_, [](const redisAsyncContext *context, int status) { redisContext_, [](const redisAsyncContext *context, int /*status*/) {
auto thisPtr = static_cast<RedisConnection *>(context->ev.data); auto thisPtr = static_cast<RedisConnection *>(context->ev.data);
thisPtr->handleDisconnect(); thisPtr->handleDisconnect();
@ -176,7 +176,7 @@ void RedisConnection::delRead(void *userData)
assert(thisPtr->channel_); assert(thisPtr->channel_);
thisPtr->channel_->disableReading(); thisPtr->channel_->disableReading();
} }
void RedisConnection::cleanup(void *userData) void RedisConnection::cleanup(void * /*userData*/)
{ {
LOG_TRACE << "cleanup"; LOG_TRACE << "cleanup";
} }
@ -205,7 +205,7 @@ void RedisConnection::sendCommandInLoop(
redisAsyncFormattedCommand( redisAsyncFormattedCommand(
redisContext_, redisContext_,
[](redisAsyncContext *context, void *r, void *userData) { [](redisAsyncContext *context, void *r, void * /*userData*/) {
auto thisPtr = static_cast<RedisConnection *>(context->ev.data); auto thisPtr = static_cast<RedisConnection *>(context->ev.data);
thisPtr->handleResult(static_cast<redisReply *>(r)); thisPtr->handleResult(static_cast<redisReply *>(r));
}, },

View File

@ -65,8 +65,8 @@ void RedisTransactionImpl::execCommandAsync(
void RedisTransactionImpl::doBegin() void RedisTransactionImpl::doBegin()
{ {
assert(!isExecutedOrCancelled_); assert(!isExecutedOrCancelled_);
execCommandAsync([](const RedisResult &result) {}, execCommandAsync([](const RedisResult & /*result*/) {},
[](const RedisException &err) {}, [](const RedisException & /*err*/) {},
"MULTI"); "MULTI");
} }
@ -75,9 +75,9 @@ RedisTransactionImpl::~RedisTransactionImpl()
if (!isExecutedOrCancelled_) if (!isExecutedOrCancelled_)
{ {
LOG_WARN << "The transaction is not executed before being destroyed"; LOG_WARN << "The transaction is not executed before being destroyed";
connPtr_->sendCommand([](const RedisResult &result) {}, connPtr_->sendCommand([](const RedisResult & /*result*/) {},
[](const RedisException &err) {}, [](const RedisException & /*err*/) {},
"DISCARD"); "DISCARD");
} }
LOG_TRACE << "transaction is destroyed"; LOG_TRACE << "transaction is destroyed";
} }