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

Assorted LLVM inspired changes #930

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

bad-co-de
Copy link

Assorted code tweaks reported by clang and clang-tidy.
Not behavior change intended.
See individual commits for information.

bad code added 17 commits September 22, 2024 15:54
Simply split the expressions.
Help the compiler in finding mismatches.
Avoid implicit integer to pointer conversion.
Avoid uninitialized member variable.
Clarifies the intended scope of the functions.
Enable compilers to move temporary variables into the constructor.
Avoid leaking file descriptor via potential sibling threads.
The bounds check is done explicitly in the line before.
gethostname() might not NUL-terminate the passed buffer on truncation.
Avoid implicit conversions; these might be unwanted or truncating.
Hide class internals.
Avoid uninitialized members.
Follow the RAII paradigm and define all 5 special class function if any
of them has a non-default implementation. Avoids duplicate destruction
or other unwanted effects.
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