-
Notifications
You must be signed in to change notification settings - Fork 675
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
Updated Packet++ headers to use override
and Cpp type casts.
#1563
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #1563 +/- ##
==========================================
- Coverage 82.90% 82.88% -0.03%
==========================================
Files 273 273
Lines 46261 46206 -55
Branches 9299 9454 +155
==========================================
- Hits 38354 38297 -57
- Misses 7053 7306 +253
+ Partials 854 603 -251
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
override
and Cpp type casts.override
and Cpp type casts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for working on this tedious but important refactoring.
LGTM but didn't check all the files, @Dimi1010 did you use CPPcheck to do this ? |
Yes, when I remembered about it. Started by searching for them manually initially. |
{ | ||
return 4 * (getAHHeader()->payloadLen + 2); | ||
return static_cast<size_t>(4) * (getAHHeader()->payloadLen + 2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this casting really needed? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
VS analysis gives me a "subexpression may overflow before being assigned to a wider type" notice without the cast.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok 👍
…b#1563) * Added 'override' specifier to getOsiModelLayer implementations. * Added `override` specifier to getDataPtr implementation in Layer. * APRLayer - overrides + Cpp casts. * BgpLayer - overrides + Cpp casts. * CotpLayer - override + Cpp casts. * DhcpLayer - Overrides + Cpp casts. * DhcpV6Layer - Overrides + Cpp casts. * DnsLayer - Overrides + Cpp casts * EthDot3Layer - Overrides + Cpp casts. * EthLayer - Overrides + Cpp casts. * FtpLayer - Overrides * GreLayer - Overrides + Cpp casts. * GtpLayer - Overrides + Cpp casts. * HttpLayer - Overrides * IcmpLayer - Overrides + Cpp casts * IcmpV6Layer - Overrides + Cpp casts. * IgmpLayer - Overrides + Cpp casts. * IPLayer - Explicitly defaulted ctor/dtor. * IPv4Layer - Overrides + Cpp casts. * IPv6Layer - Overrides + Cpp casts. * Layer.h - IDataContainer - defaulted destructor. - Layer - destructor override. * LdapLayer - Overrides. * LLCLayer - Overrides + Cpp casts. * MplsLayer - Overrides + Cpp casts. * NdpLayer - Overrides + Cpp casts. * NflogLayer - Overrides + Cpp casts. * NtpLayer - Overrides. * NullLoopbackLayer - Overrides. * PayloadLayer - Overrides. * PPPoELayer - Overrides + Cpp casts. * RadiusLayer - Overrides + Cpp casts. * SdpLayer - Overrides. * SipLayer - Overrides. * SllLayer - Overrides + Cpp casts. * Sll2Layer - Overrides + Cpp casts. * SmtpLayer - Overrides. * SomeIpLayer - Overrides + Cpp casts. * SomeIpSdLayer - Overrides. * SshLayer - Overrides + Cpp casts. * SSLLayer - Overrides + Cpp casts. * StpLayer - Overrides + Cpp casts. * S7CommLayer - Overrides + Cpp casts. * TcpLayer - Overrides + Cpp casts. * TelnetLayer - Overrides. * TextBasedProtocol - Overrides. * TLVData - Explicit defaults + Cpp casts. * TpktLayer - Explicit defaults + Cpp casts. * UdpLayer - Overrides + Cpp casts. * VlanLayer - Overrides + Cpp casts. * VrrpLayer - Overrides. * VxlanLayer - Overrides + Cpp casts. * WakeOnLanLayer - Overrides + Cpp casts. * DnsResourceData - Overrides. * DnsResource - Overrides. * IPv4Layer - Fixed missed overrides. * TLVData - Fixed missed c cast. * DhcpLayer - Fixed missed overrides. * DhcpV6Layer - Fixed missed overrides. * HttpLayer - Fixed missed overrides. * IPSecLayer - Overrides + Cpp casts * NdpLayer - Fixed missed overrides. * PacketTrailerLayer - Overrides * SomeIpLayer - Fixed missed overrides. * TcpLayer - Fixed missed overrides. * SSLHandshake - Overrides + Cpp casts. * Removed 'missingOverride' cppcheck suppression from Packet++ and Common++. * DhcpV6Layer - Fixed missing override * IPSecLayer - Fixed missing override * IPv6Extensions - Fixed missing override * IPReassembly - Overrides * Simplify return literals.
override
specifier.= default
instead of{}
missingOverrides
cppcheck suppression from everywhere exceptExamples
andPcap++
as those are the only modules that currently raiseoverride
warnings.