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 more clang tidy findings #35

Merged
merged 3 commits into from
May 18, 2020

Conversation

wolframroesler
Copy link
Contributor

We're still cleaning up the mDNS source code according to findings of the clang-tidy-9 static checker. This time we're removing narrowing conversions, unneeded casts, and an unsafe string->int conversion.

Integer types are still being handled in a sloppy way in some places, e. g. by storing a size_t in an int, which may not necessarily fit. I added casts in a few places which both silence the static checker and point out the possible overruns. In completely clean code, most of these casts should not be necessary. No functional changes were introduced.

Also, a vim swap file was committed by accident. May well have been me in a previous commit, sorry :-/ Removed it and added *.swp to the git ignore file.

Wolfram Rösler added 3 commits May 18, 2020 10:03
A vim swap file was accidentially committed at some time in the past.
This commit removes it and adds *.swp to the git ignore file so that
this can't happen again in the future
Spotted by the clang-tidy-9 static checker. Also removed a few casts
because void* implicitly converts to any other pointer type without
a cast. Unfortunately, a few casts (e. g. size_t to int) needed to
be added in order to make the static checker happy; these, however,
point to possible problems and should be addressed in the future.
clang-tidy-9, in accordance with the CERT standard, doesn't like
atoi, for good reasons.
@wolframroesler wolframroesler force-pushed the more-clang-tidy-findings branch from 7dabc3c to d6180fd Compare May 18, 2020 08:35
@troglobit
Copy link
Owner

Looks good, thanks!

@troglobit troglobit merged commit d7c3191 into troglobit:master May 18, 2020
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