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

cleanup: Fix a few more clang-tidy warnings. #2406

Merged
merged 1 commit into from
Sep 7, 2023

Conversation

iphydf
Copy link
Member

@iphydf iphydf commented Aug 31, 2023

This change is Reviewable

@iphydf iphydf added this to the v0.2.19 milestone Aug 31, 2023
Copy link
Member

@JFreegman JFreegman left a comment

Choose a reason for hiding this comment

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

Reviewed 98 of 98 files at r1, all commit messages.
Reviewable status: 0 of 1 approvals obtained (waiting on @iphydf)


toxcore/DHT.c line 781 at r1 (raw file):

        const IPPTsPng *ipptp = NULL;

        if (net_family_is_ipv4(sa_family) || client->assoc4.timestamp >= client->assoc6.timestamp) {

Is this an intentional logic change? Previously, we set ipptp = &client->assoc6; after confirming that sa_family is ipv6, even if client->assoc4.timestamp >= client->assoc6.timestamp. Now we set ipptp = &client->assoc4; if client->assoc4.timestamp >= client->assoc6.timestamp even if sa_family is ipv6.


toxcore/tox.c line 816 at r1 (raw file):

    if (tox->m == nullptr) {
        switch (m_error) {
            case MESSENGER_ERROR_PORT:

Intentional fallthrough? Should probably comment that

Copy link
Member Author

@iphydf iphydf left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 1 approvals obtained (waiting on @JFreegman)


toxcore/DHT.c line 781 at r1 (raw file):

Previously, JFreegman wrote…

Is this an intentional logic change? Previously, we set ipptp = &client->assoc6; after confirming that sa_family is ipv6, even if client->assoc4.timestamp >= client->assoc6.timestamp. Now we set ipptp = &client->assoc4; if client->assoc4.timestamp >= client->assoc6.timestamp even if sa_family is ipv6.

Good point. Undone.


toxcore/tox.c line 816 at r1 (raw file):

Previously, JFreegman wrote…

Intentional fallthrough? Should probably comment that

I usually consider "fallthrough" to be a case that does work and then doesn't break (which we don't allow). This fallthrough is effectively an "or" case. Should we document such cases (e.g. group.c:2146)?

@iphydf iphydf marked this pull request as ready for review September 7, 2023 07:39
@codecov
Copy link

codecov bot commented Sep 7, 2023

Codecov Report

Patch coverage: 77.77% and project coverage change: +0.17% 🎉

Comparison is base (0c5b918) 74.49% compared to head (0cef46e) 74.66%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2406      +/-   ##
==========================================
+ Coverage   74.49%   74.66%   +0.17%     
==========================================
  Files          87       87              
  Lines       26194    26190       -4     
==========================================
+ Hits        19512    19555      +43     
+ Misses       6682     6635      -47     
Files Changed Coverage Δ
toxcore/tox.c 63.63% <60.00%> (-0.06%) ⬇️
toxcore/DHT.c 84.84% <100.00%> (+0.26%) ⬆️
toxcore/mono_time.c 94.33% <100.00%> (ø)
toxcore/net_crypto.c 87.82% <100.00%> (-0.01%) ⬇️

... and 6 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@JFreegman
Copy link
Member

I usually consider "fallthrough" to be a case that does work and then doesn't break (which we don't allow). This fallthrough is effectively an "or" case. Should we document such cases (e.g. group.c:2146)?

Maybe I'm misremembering because I thought we already did that. It's probably not necessary.

Copy link
Member

@JFreegman JFreegman left a comment

Choose a reason for hiding this comment

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

Reviewed 96 of 96 files at r2, all commit messages.
Reviewable status: :shipit: complete! 1 of 1 approvals obtained

@toktok-releaser toktok-releaser merged commit 0cef46e into TokTok:master Sep 7, 2023
@iphydf iphydf deleted the clang-tidy branch September 7, 2023 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants