Skip to content

Commit

Permalink
Fixing conversion warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
LeStarch committed Apr 30, 2024
1 parent 895297d commit f594e75
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Fw/Types/StringBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ SerializeStatus StringBase::serialize(SerializeBufferBase& buffer, SizeType maxL

SerializeStatus StringBase::deserialize(SerializeBufferBase& buffer) {
// Get the max size of the deserialized string
const FwSizeType maxSize = this->maxLength();
const SizeType maxSize = this->maxLength();

Check notice

Code scanning / CodeQL

Use of basic integral type Note

maxSize uses the basic integral type unsigned long rather than a typedef with size and signedness.
// Initial estimate of actual size is max size
// This estimate is refined when calling the deserialize function below
SizeType actualSize = maxSize;

Check notice

Code scanning / CodeQL

Use of basic integral type Note

actualSize uses the basic integral type unsigned long rather than a typedef with size and signedness.
Expand Down
4 changes: 2 additions & 2 deletions Fw/Types/StringBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ class StringBase : public Serializable {
SizeType maxLength() const;
//! Get the static serialized size of a string
//! This is the max length of the string plus the size of the stored size
static constexpr FwSizeType STATIC_SERIALIZED_SIZE(FwSizeType maxLength //!< The maximum string length
static constexpr SizeType STATIC_SERIALIZED_SIZE(SizeType maxLength //!< The maximum string length

Check notice

Code scanning / CodeQL

Use of basic integral type Note

STATIC_SERIALIZED_SIZE uses the basic integral type unsigned long rather than a typedef with size and signedness.

Check notice

Code scanning / CodeQL

Use of basic integral type Note

maxLength uses the basic integral type unsigned long rather than a typedef with size and signedness.
) {
return sizeof(FwSizeStoreType) + maxLength;
}

//! Get the size of a null-terminated string buffer
static constexpr FwSizeType BUFFER_SIZE(FwSizeType maxLength //!< The maximum string length
static constexpr SizeType BUFFER_SIZE(SizeType maxLength //!< The maximum string length

Check notice

Code scanning / CodeQL

Use of basic integral type Note

BUFFER_SIZE uses the basic integral type unsigned long rather than a typedef with size and signedness.

Check notice

Code scanning / CodeQL

Use of basic integral type Note

maxLength uses the basic integral type unsigned long rather than a typedef with size and signedness.
) {
// Reserve one byte for each character plus one for the null terminator
return maxLength + 1;
Expand Down

0 comments on commit f594e75

Please sign in to comment.