Skip to content

Fix warnings in non-unity static-analysis builds - #20

Open
bozalina wants to merge 1 commit into
amazon-gamelift:mainfrom
bozalina:warning-fixes-non-unity-builds
Open

Fix warnings in non-unity static-analysis builds#20
bozalina wants to merge 1 commit into
amazon-gamelift:mainfrom
bozalina:warning-fixes-non-unity-builds

Conversation

@bozalina

Copy link
Copy Markdown

Description of Changes

Headers:

  • Add override to defaulted destructors in ResponseMessage and 14 WebSocket request/response subclasses (-Wsuggest-override).
  • Cast size_t loop indices to int in LogParameters::operator== to match getLogPath's int parameter.

Sources:

  • Combiner.cpp: fold insertSuccess local into assert(pair.second) directly; the local was unused under NDEBUG.
  • JsonHelper.cpp / HttpClient.cpp / AwsSigV4Utility.cpp: static_cast
    on size_t values passed to APIs that take int (send, HMAC_Init_ex, getLogPath).
  • HttpClient.cpp: widen jsonStart/jsonEnd from int to size_t to match std::string::find return type.
  • WebSocketppClientWrapper.cpp: mark unused OnMessage/OnTlsInit parameters as (void), drop an unused local errorMessage.
  • GameLiftServerState.cpp: initialize m_onUpdateGameSession(nullptr) in both GAMELIFT_USE_STD and non-STD constructor init lists to silence uninitialized-member warnings.

Description of Testing and Validations of Changes

Verified by building the vendored SDK sources as part of the GameLift Server SDK plugin inside an Unreal Engine 5 project (MSVC, non-unity, warnings-as-errors), which compiles cleanly with these changes.


Checklist

  • [ X ] I have ensured that the Server SDK builds successfully and that all unit tests pass.
  • [ X ] I have updated any affected documentation to reflect this change.
  • [ X ] I have added unit tests for any new code or logic introduced.
  • [ X ] I have linted my code before submitting this PR.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Headers:
- Add `override` to defaulted destructors in ResponseMessage and 14
  WebSocket request/response subclasses (-Wsuggest-override).
- Cast size_t loop indices to int in LogParameters::operator== to match
  getLogPath's int parameter.

Sources:
- Combiner.cpp: fold `insertSuccess` local into `assert(pair.second)`
  directly; the local was unused under NDEBUG.
- JsonHelper.cpp / HttpClient.cpp / AwsSigV4Utility.cpp: static_cast<int>
  on size_t values passed to APIs that take int (send, HMAC_Init_ex,
  getLogPath).
- HttpClient.cpp: widen jsonStart/jsonEnd from int to size_t to match
  std::string::find return type.
- WebSocketppClientWrapper.cpp: mark unused OnMessage/OnTlsInit parameters
  as (void), drop an unused local errorMessage.
- GameLiftServerState.cpp: initialize m_onUpdateGameSession(nullptr) in
  both GAMELIFT_USE_STD and non-STD constructor init lists to silence
  uninitialized-member warnings.
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