Skip to content

Conversation

@sjanel
Copy link
Contributor

@sjanel sjanel commented Sep 16, 2025

Fix the following warnings:

drogon-src/lib/src/Utilities.cc:1042:12: warning: unused variable 'seconds' [-Wunused-variable]
 1042 |     time_t seconds = static_cast<time_t>(nowSecond);
      |            ^~~~~~~
1 warning generated.
drogon-src/lib/src/HttpControllersRouter.h:30:1: warning: class 'WebsocketControllerBinder' was previously declared as a struct; this is valid, but may result in linker errors under the Microsoft C++ ABI [-Wmismatched-tags]
   30 | class WebsocketControllerBinder;
      | ^
drogon-src/lib/src/HttpControllerBinder.h:53:8: note: previous use is here
   53 | struct WebsocketControllerBinder : public ControllerBinderBase
      |        ^
drogon-src/lib/src/HttpControllersRouter.h:30:1: note: did you mean struct here?
   30 | class WebsocketControllerBinder;
      | ^~~~~
      | struct

drogon-src/lib/src/HttpResponseImpl.cc:426:18: warning: unused variable 'contentType' [-Wunused-variable]
  426 |             auto contentType = type;
      |                  ^~~~~~~~~~~
drogon-src/lib/src/HttpResponseImpl.cc:446:18: warning: unused variable 'contentType' [-Wunused-variable]
  446 |             auto contentType = type;
      |                  ^~~~~~~~~~~
2 warnings generated.

/home/sjanel/workspaces/metaconnect/cpp-modules/flight-domain-manager/build/_deps/drogon-src/lib/src/SlidingWindowRateLimiter.cc:37:14: warning: unused variable 'startTime' [-Wunused-variable]
   37 |         auto startTime = lastTime_;
      |              ^~~~~~~~~
1 warning generated.

drogon-src/lib/src/HttpClientImpl.cc:552:11: warning: unused variable 'type' [-Wunused-variable]
  552 |     auto &type = resp->getHeaderBy("content-type");
      |           ^~~~
1 warning generated.

@sjanel sjanel force-pushed the chore/fix-unused-variables-warnings branch from e5da694 to fab2b47 Compare September 17, 2025 21:41
@an-tao an-tao requested a review from Copilot September 23, 2025 11:17
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes compiler warnings related to unused variables and mismatched class/struct declarations in the Drogon framework. The changes remove dead code and improve type safety by eliminating variables that were declared but never used.

  • Removes unused variable declarations that were causing compiler warnings
  • Fixes class/struct declaration mismatches for consistency
  • Adds proper type casting to prevent implicit conversion warnings
  • Removes commented-out dead code

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
lib/src/Utilities.cc Removes unused seconds variable and adds namespace comment
lib/src/SlidingWindowRateLimiter.cc Removes unused startTime variable
lib/src/HttpResponseImpl.cc Removes unused contentType variables and commented code
lib/src/HttpControllersRouter.h Changes class declaration to struct for consistency
lib/src/HttpClientImpl.cc Removes unused type variable
lib/inc/drogon/HttpViewData.h Adds explicit type casting to prevent warnings
lib/inc/drogon/HttpResponse.h Removes unused parameter name in template function

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant