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

Formatting and cleanup #86

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

JohannesKauffmann
Copy link
Collaborator

  • Prevent copy of sockaddr_in when calling getAddr()
  • Formatting and cleanup (newline, spaces etc.)
  • Group headers according to stdlib, internal, and sort them
  • Fixed some warnings (Wsign-compare, unused variables/parameters)

[35/90] Building CXX object src/CMakeFiles/EIPScanner.dir/MessageRouter.cpp.obj
/EIPScanner/src/MessageRouter.cpp:27:7: warning: extra ‘;’ [-Wpedantic]
   27 |     {};
      |       ^
Remove the void cast and unname them instead, per C++ Core Guidelines:

https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#f9-unused-parameters-should-be-unnamed

For the assert, use the maybe_unused attribute.
Visual Studio generated a note about this (lnt-accidental-copy).

UDPBoundSocket.cpp's usage of getAddr() has been left untouched, as to
not change behaviour there (it writes to the value returned by
getAddr()).
To avoid creating a new warning in DiscoveryManager.cpp, use
static_cast. The IdentityObject takes a CipUint anyway.

On Windows, setsocktopt() with SO_RCVTIMEO takes a uint32_t, but
std::chrono::duration::count() returnes a "signed integer type of at
least 45 bits" [1], so it also produces a warning.

[1]. https://en.cppreference.com/w/cpp/chrono/duration
Headers are now grouped using a newline, ranging from standard library,
to external (GTest) headers, and finally our own headers.

Commented out and duplicate #includes removed.

Removed "private" immediately followed by "public".

Also added a newline to the last line of every file.
Also fixed a spelling mistake.
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