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

Fixed bugs found while compiling for baremetal. #1462

Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,19 @@ namespace ${namespace} {
return *this;
}

${name}& ${name} :: operator=(const t a)
{
this->e = a;
return *this;
}

${name}& ${name} :: operator=(const NATIVE_INT_TYPE a)
{
#set $manual_values = False
#for $item_name,$item_value,$item_comment in $items_list:
#if not $item_value == ""
#set $manual_values = True
#else
#set $manual_values = False
#break
#end if
#end for
#if $manual_values == True
Expand All @@ -82,11 +88,11 @@ a == $item_value#slurp

${name}& ${name} :: operator=(const NATIVE_UINT_TYPE a)
{
#set $manual_values = False
#for $item_name,$item_value,$item_comment in $items_list:
#if not $item_value == ""
#set $manual_values = True
#else
#set $manual_values = False
#break
#end if
#end for
#if $manual_values == True
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ namespace ${namespace} {
const ${name}& other //!< The other object
);

//! Assignment operator
${name}& operator=(
const t a //!< The integer to copy
kevin-f-ortega marked this conversation as resolved.
Show resolved Hide resolved
);

//! Assignment operator
${name}& operator=(
const NATIVE_INT_TYPE a //!< The integer to copy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,24 @@ ${return_type}Output${name}Port::invoke(${args_proto_string}) {
\#if FW_PORT_SERIALIZATION
} else if (this->m_serPort) {

Fw::SerializeStatus status;
Fw::SerializeStatus _status;

${name}PortBuffer _buffer;
#set $num = 0
#for $arg in $args:
#if $enum_marker[$num] == 'ENUM':
status = _buffer.serialize(static_cast<NATIVE_INT_TYPE>($arg[0]));
_status = _buffer.serialize(static_cast<NATIVE_INT_TYPE>($arg[0]));
#elif $pointer_marker[$num] == True:
status = _buffer.serialize(static_cast<void*>($arg[0]));
_status = _buffer.serialize(static_cast<void*>($arg[0]));
#else:
status = _buffer.serialize($arg[0]);
_status = _buffer.serialize($arg[0]);
#end if
#set $num = $num + 1
FW_ASSERT(Fw::FW_SERIALIZE_OK == status,static_cast<AssertArg>(status));
FW_ASSERT(Fw::FW_SERIALIZE_OK == _status,static_cast<AssertArg>(_status));

#end for
status = this->m_serPort->invokeSerial(_buffer);
FW_ASSERT(Fw::FW_SERIALIZE_OK == status,static_cast<AssertArg>(status));
_status = this->m_serPort->invokeSerial(_buffer);
FW_ASSERT(Fw::FW_SERIALIZE_OK == _status,static_cast<AssertArg>(_status));
}
\#else
}
Expand Down
4 changes: 2 additions & 2 deletions Autocoders/Python/test/enum_xml/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ TEST(EnumXML, InvalidNegativeConstant) {
Example::Enum1 enum1 = getEnum();
// Get a valid negative constant
const I32 negativeConstant = getNegativeConstant();
const U32 expectedLineNumber = 55;
const U32 expectedLineNumber = 61;
// Turn it into a U32
const U32 expectedArg1 = negativeConstant;
// As a U32, the constant is not valid
Expand All @@ -163,7 +163,7 @@ TEST(EnumXML, InvalidConstant) {
const I32 invalidConstant = 42;
// This should cause an assertion failure
enum1 = invalidConstant;
const U32 expectedLineNumber = 48;
const U32 expectedLineNumber = 54;
const U32 expectedArg1 = invalidConstant;
checkAssertionFailure(uta, expectedLineNumber, expectedArg1);
}
Expand Down
4 changes: 2 additions & 2 deletions Fw/Types/PolyType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ namespace Fw {
valIsEqual = false;
break;
default:
FW_ASSERT(0,static_cast<NATIVE_INT_TYPE>(this->m_dataType));
FW_ASSERT(0,static_cast<AssertArg>(this->m_dataType));
return false; // for compiler
}
return valIsEqual;
Expand Down Expand Up @@ -474,7 +474,7 @@ namespace Fw {
result = false;
break;
default:
FW_ASSERT(0,static_cast<NATIVE_INT_TYPE>(this->m_dataType));
FW_ASSERT(0,static_cast<AssertArg>(this->m_dataType));
return false; // for compiler
}
return result;
Expand Down
2 changes: 1 addition & 1 deletion Svc/BufferLogger/BufferLoggerFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ namespace Svc {
bool BufferLogger::File ::
writeBytes(
const void *const data,
const NATIVE_UINT_TYPE length
const U32 length
)
{
FW_ASSERT(length > 0, length);
Expand Down