-
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
Fix string records for data products #2697
Conversation
TimeBaseStoreType is not the same as TimeBase
Cast to the TimeBaseStore type with a known size
Remove unnecessary const casting
Fw/Prm/PrmString.hpp
Outdated
|
||
const char* toChar() const; | ||
NATIVE_UINT_TYPE getCapacity() const; | ||
ParamString(const StringBase& src) : StringBase() { *this = src; } |
Check warning
Code scanning / CppCheck
Single-parameter constructors should be marked explicit. Warning
Fw/Prm/PrmString.hpp
Outdated
|
||
private: | ||
ParamString(const char* src) : StringBase() { *this = src; } |
Check warning
Code scanning / CppCheck
Single-parameter constructors should be marked explicit. Warning
Fw/Test/String.hpp
Outdated
|
||
const char* toChar() const; //!< gets char buffer | ||
NATIVE_UINT_TYPE getCapacity() const ; //!< return buffer size | ||
String(const StringBase& src) : StringBase() { *this = src; } |
Check warning
Code scanning / CppCheck
Single-parameter constructors should be marked explicit. Warning
Fw/Test/String.hpp
Outdated
|
||
private: | ||
String(const char* src) : StringBase() { *this = src; } |
Check warning
Code scanning / CppCheck
Single-parameter constructors should be marked explicit. 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.
return static_cast<SizeType>(sizeof(FwSizeStoreType)) + this->length(); | ||
} | ||
|
||
StringBase::SizeType StringBase::serializedTruncatedSize(FwSizeType maxLength) const { |
Check notice
Code scanning / CodeQL
Use of basic integral type Note
return static_cast<SizeType>(sizeof(FwSizeStoreType)) + this->length(); | ||
} | ||
|
||
StringBase::SizeType StringBase::serializedTruncatedSize(FwSizeType maxLength) const { |
Check notice
Code scanning / CodeQL
Use of basic integral type Note
@@ -117,6 +117,14 @@ | |||
return static_cast<SizeType>(StringUtils::string_length(this->toChar(), this->getCapacity())); | |||
} | |||
|
|||
StringBase::SizeType StringBase::serializedSize() const { |
Check notice
Code scanning / CodeQL
Use of basic integral type Note
This PR is a companion to nasa/fpp#408. It incorporates the fix for nasa/fpp#392.
Note: Review and merge #2679 first.