-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Update to FPP v2.1.0a10 #2703
Update to FPP v2.1.0a10 #2703
Conversation
TimeBaseStoreType is not the same as TimeBase
Cast to the TimeBaseStore type with a known size
Remove unnecessary const casting
For safety's sake!
Existing code was correct but somewhat terse and obscure Refactor and add comments for clarity
// Deserialize length | ||
// Fail if length exceeds max size (the initial value of actualSize) | ||
// Otherwise deserialize length bytes and set actualSize to length | ||
SerializeStatus stat = buffer.deserialize(reinterpret_cast<U8*>(raw), actualSize, Serialization::INCLUDE_LENGTH); |
Check warning
Code scanning / CodeQL
Unchecked function argument Warning
return buffer.serialize(reinterpret_cast<const U8*>(this->toChar()), len); | ||
const FwSizeType len = FW_MIN(maxLength, this->length()); | ||
// Serialize length and then bytes | ||
return buffer.serialize(reinterpret_cast<const U8*>(this->toChar()), len, Serialization::INCLUDE_LENGTH); |
Check warning
Code scanning / CodeQL
Unchecked function argument Warning
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.
CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
Closing this PR as it has been subsumed by #2707 |
Fw::StringBase
that was terse and hard to understand (it was not clear what was going on with serializing and deserializing string lengths; because so much was implicit, it looked like the code was serializing and deserializing null-terminated strings).Note: This PR will require some minor changes in user test code, as discussed in nasa/fpp#409. The changes bring the code more into line with approved C++ standards, by eliminating reliance on implicit conversions. I've made the required changes for the F Prime unit tests in this PR.