Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: get rid of some more warnings #5672

Merged
merged 7 commits into from
Oct 27, 2024

Conversation

Nerixyz
Copy link
Contributor

@Nerixyz Nerixyz commented Oct 23, 2024

This mainly gets rid of -Wsign-compare warnings. These show up when compiling with clang-cl (I know we have them disabled usually).
Since Qt 6.8 got a bit more vocal with deprecation warnings, I turned them off for now (only deprecations until 5.15 are enabled). This uses an undocumented QT_WARN_DEPRECATED_UP_TO. Once we switch to Qt 6, we can bump this.

Maybe we could enable -Wextra and -Wpedantic.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

src/providers/twitch/api/Helix.cpp Show resolved Hide resolved
src/providers/twitch/api/Helix.cpp Show resolved Hide resolved
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

src/providers/twitch/api/Helix.cpp Show resolved Hide resolved
src/providers/twitch/api/Helix.cpp Show resolved Hide resolved
@pajlada pajlada enabled auto-merge (squash) October 27, 2024 12:15
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

@@ -1909,7 +1909,7 @@ void Helix::updateChatSettings(

void Helix::onFetchChattersSuccess(
std::shared_ptr<HelixChatters> finalChatters, QString broadcasterID,
QString moderatorID, int maxChattersToFetch,
QString moderatorID, size_t maxChattersToFetch,
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: the parameter 'moderatorID' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]

src/providers/twitch/api/Helix.hpp:1507:

-         QString moderatorID, size_t maxChattersToFetch,
+         const QString& moderatorID, size_t maxChattersToFetch,
Suggested change
QString moderatorID, size_t maxChattersToFetch,
const QString& moderatorID, size_t maxChattersToFetch,

@@ -2022,7 +2022,7 @@

void Helix::onFetchModeratorsSuccess(
std::shared_ptr<std::vector<HelixModerator>> finalModerators,
QString broadcasterID, int maxModeratorsToFetch,
QString broadcasterID, size_t maxModeratorsToFetch,
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: the parameter 'broadcasterID' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]

src/providers/twitch/api/Helix.hpp:1522:

-         QString broadcasterID, size_t maxModeratorsToFetch,
+         const QString& broadcasterID, size_t maxModeratorsToFetch,
Suggested change
QString broadcasterID, size_t maxModeratorsToFetch,
const QString& broadcasterID, size_t maxModeratorsToFetch,

@pajlada pajlada merged commit bbcd8c5 into Chatterino:master Oct 27, 2024
18 checks passed
@Nerixyz Nerixyz deleted the fix/conversion-warnings branch October 27, 2024 13:07
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.

2 participants