Skip to content

Commit 14976c1

Browse files
authored
Fix unused variable warnings (#2385)
1 parent 3ce6a77 commit 14976c1

File tree

7 files changed

+5
-13
lines changed

7 files changed

+5
-13
lines changed

lib/inc/drogon/HttpResponse.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ using HttpResponsePtr = std::shared_ptr<HttpResponse>;
3939
* type object. Users must specialize the template for a particular type.
4040
*/
4141
template <typename T>
42-
T fromResponse(const HttpResponse &resp)
42+
T fromResponse(const HttpResponse &)
4343
{
4444
LOG_ERROR
4545
<< "You must specialize the fromResponse template for the type of "

lib/inc/drogon/HttpViewData.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ class DROGON_EXPORT HttpViewData
8888
backup_ap);
8989
va_end(backup_ap);
9090
if ((result >= 0) &&
91-
((std::string::size_type)result < strBuffer.size()))
91+
(static_cast<std::string::size_type>(result) < strBuffer.size()))
9292
{
93-
strBuffer.resize(result);
93+
strBuffer.resize(static_cast<std::string::size_type>(result));
9494
}
9595
else
9696
{

lib/src/HttpClientImpl.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,6 @@ void HttpClientImpl::handleResponse(
549549
const trantor::TcpConnectionPtr &connPtr)
550550
{
551551
assert(!pipeliningCallbacks_.empty());
552-
auto &type = resp->getHeaderBy("content-type");
553552
auto &coding = resp->getHeaderBy("content-encoding");
554553
if (coding == "gzip")
555554
{

lib/src/HttpControllersRouter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ namespace drogon
2727
{
2828
class HttpControllerBinder;
2929
class HttpSimpleControllerBinder;
30-
class WebsocketControllerBinder;
30+
struct WebsocketControllerBinder;
3131

3232
class HttpControllersRouter : public trantor::NonCopyable
3333
{

lib/src/HttpResponseImpl.cc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,6 @@ HttpResponsePtr HttpResponse::newFileResponse(
222222
// Check for type and assign proper content type in header
223223
if (!typeString.empty())
224224
{
225-
// auto contentType = type;
226225
if (type == CT_NONE)
227226
type = parseContentType(typeString);
228227
if (type == CT_NONE)
@@ -344,7 +343,6 @@ HttpResponsePtr HttpResponse::newFileResponse(
344343
if (!typeString.empty())
345344
{
346345
auto r = static_cast<HttpResponse *>(resp.get());
347-
// auto contentType = type;
348346
if (type == CT_NONE)
349347
type = parseContentType(typeString);
350348
if (type == CT_NONE)
@@ -368,7 +366,6 @@ HttpResponsePtr HttpResponse::newFileResponse(
368366
else
369367
{
370368
auto r = static_cast<HttpResponse *>(resp.get());
371-
// auto contentType = type;
372369
if (type == CT_NONE)
373370
type = parseContentType(typeString);
374371
if (type == CT_NONE)
@@ -423,7 +420,6 @@ HttpResponsePtr HttpResponse::newStreamResponse(
423420
if (!typeString.empty())
424421
{
425422
auto r = static_cast<HttpResponse *>(resp.get());
426-
auto contentType = type;
427423
if (type == CT_NONE)
428424
type = parseContentType(typeString);
429425
if (type == CT_NONE)
@@ -443,7 +439,6 @@ HttpResponsePtr HttpResponse::newStreamResponse(
443439
else
444440
{
445441
auto r = static_cast<HttpResponse *>(resp.get());
446-
auto contentType = type;
447442
if (type == CT_NONE)
448443
type = parseContentType(typeString);
449444
if (type == CT_NONE)

lib/src/SlidingWindowRateLimiter.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ bool SlidingWindowRateLimiter::isAllowed()
3434
auto duration =
3535
std::chrono::duration_cast<std::chrono::duration<double>>(
3636
unitStartTime_ - lastTime_);
37-
auto startTime = lastTime_;
3837
if (duration >= timeUnit_)
3938
{
4039
previousRequests_ = 0;

lib/src/Utilities.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,7 +1039,6 @@ void dateToCustomFormattedString(const std::string &fmtStr,
10391039
const trantor::Date &date)
10401040
{
10411041
auto nowSecond = date.microSecondsSinceEpoch() / MICRO_SECONDS_PRE_SEC;
1042-
time_t seconds = static_cast<time_t>(nowSecond);
10431042
struct tm tm_LValue = date.tmStruct();
10441043
std::stringstream Out;
10451044
Out.imbue(std::locale{"C"});
@@ -1318,7 +1317,7 @@ const size_t fixedRandomNumber = []() {
13181317
utils::secureRandomBytes(&res, sizeof(res));
13191318
return res;
13201319
}();
1321-
}
1320+
} // namespace internal
13221321

13231322
} // namespace utils
13241323
} // namespace drogon

0 commit comments

Comments
 (0)