diff --git a/compiler/lib/src/main/scala/codegen/CppWriter/ComponentCppWriter/ComponentCppWriter.scala b/compiler/lib/src/main/scala/codegen/CppWriter/ComponentCppWriter/ComponentCppWriter.scala index f39484068..7038534b6 100644 --- a/compiler/lib/src/main/scala/codegen/CppWriter/ComponentCppWriter/ComponentCppWriter.scala +++ b/compiler/lib/src/main/scala/codegen/CppWriter/ComponentCppWriter/ComponentCppWriter.scala @@ -967,21 +967,13 @@ object ComponentCppWriter extends CppWriterUtils { }, Line.blank :: lines( s"""|#if FW_OBJECT_NAMES == 1 - |// The port name consists of this->m_objName and some extra info. - |// We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - |// However, the compiler may assume that this->m_objName fills - |// the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - |// avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - |// bytes to cover the extra info. - |char portName[2*FW_OBJ_NAME_MAX_SIZE]; - |(void) snprintf( - | portName, - | sizeof(portName), + |Fw::ObjectName portName; + |portName.format( | "%s_${printName(port)}[%" PRI_PlatformIntType "]", - | this->m_objName, + | this->m_objName.toChar(), | port |); - |this->${variableName(port)}[port].setObjName(portName); + |this->${variableName(port)}[port].setObjName(portName.toChar()); |#endif |""" ) diff --git a/compiler/lib/src/main/scala/codegen/CppWriter/ComponentCppWriter/ComponentEvents.scala b/compiler/lib/src/main/scala/codegen/CppWriter/ComponentCppWriter/ComponentEvents.scala index 5debea9c2..4ec978453 100644 --- a/compiler/lib/src/main/scala/codegen/CppWriter/ComponentCppWriter/ComponentEvents.scala +++ b/compiler/lib/src/main/scala/codegen/CppWriter/ComponentCppWriter/ComponentEvents.scala @@ -214,7 +214,7 @@ case class ComponentEvents ( | FW_LOG_TEXT_BUFFER_SIZE, | _formatString, |#if FW_OBJECT_NAMES == 1 - | this->m_objName, + | this->m_objName.toChar(), |#endif |""" ), diff --git a/compiler/tools/fpp-to-cpp/test/component/base/ActiveAsyncProductPortsOnlyComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/ActiveAsyncProductPortsOnlyComponentAc.ref.cpp index 6d049a76a..d101736cf 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/ActiveAsyncProductPortsOnlyComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/ActiveAsyncProductPortsOnlyComponentAc.ref.cpp @@ -86,21 +86,13 @@ void ActiveAsyncProductPortsOnlyComponentBase :: this->m_productRecvIn_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_productRecvIn_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_productRecvIn_InputPort[port].setObjName(portName); + this->m_productRecvIn_InputPort[port].setObjName(portName.toChar()); #endif } @@ -113,21 +105,13 @@ void ActiveAsyncProductPortsOnlyComponentBase :: this->m_productRequestOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_productRequestOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_productRequestOut_OutputPort[port].setObjName(portName); + this->m_productRequestOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -140,21 +124,13 @@ void ActiveAsyncProductPortsOnlyComponentBase :: this->m_productSendOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_productSendOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_productSendOut_OutputPort[port].setObjName(portName); + this->m_productSendOut_OutputPort[port].setObjName(portName.toChar()); #endif } diff --git a/compiler/tools/fpp-to-cpp/test/component/base/ActiveAsyncProductsComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/ActiveAsyncProductsComponentAc.ref.cpp index d9a7c7f42..cd9777871 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/ActiveAsyncProductsComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/ActiveAsyncProductsComponentAc.ref.cpp @@ -251,21 +251,13 @@ void ActiveAsyncProductsComponentBase :: this->m_cmdIn_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdIn_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdIn_InputPort[port].setObjName(portName); + this->m_cmdIn_InputPort[port].setObjName(portName.toChar()); #endif } @@ -283,21 +275,13 @@ void ActiveAsyncProductsComponentBase :: this->m_productRecvIn_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_productRecvIn_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_productRecvIn_InputPort[port].setObjName(portName); + this->m_productRecvIn_InputPort[port].setObjName(portName.toChar()); #endif } @@ -315,21 +299,13 @@ void ActiveAsyncProductsComponentBase :: this->m_noArgsAsync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsAsync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsAsync_InputPort[port].setObjName(portName); + this->m_noArgsAsync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -347,21 +323,13 @@ void ActiveAsyncProductsComponentBase :: this->m_noArgsGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsGuarded_InputPort[port].setObjName(portName); + this->m_noArgsGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -379,21 +347,13 @@ void ActiveAsyncProductsComponentBase :: this->m_noArgsReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName); + this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -411,21 +371,13 @@ void ActiveAsyncProductsComponentBase :: this->m_noArgsReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnSync_InputPort[port].setObjName(portName); + this->m_noArgsReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -443,21 +395,13 @@ void ActiveAsyncProductsComponentBase :: this->m_noArgsSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsSync_InputPort[port].setObjName(portName); + this->m_noArgsSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -475,21 +419,13 @@ void ActiveAsyncProductsComponentBase :: this->m_typedAsync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsync_InputPort[port].setObjName(portName); + this->m_typedAsync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -507,21 +443,13 @@ void ActiveAsyncProductsComponentBase :: this->m_typedAsyncAssert_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncAssert_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncAssert_InputPort[port].setObjName(portName); + this->m_typedAsyncAssert_InputPort[port].setObjName(portName.toChar()); #endif } @@ -539,21 +467,13 @@ void ActiveAsyncProductsComponentBase :: this->m_typedAsyncBlockPriority_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncBlockPriority_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncBlockPriority_InputPort[port].setObjName(portName); + this->m_typedAsyncBlockPriority_InputPort[port].setObjName(portName.toChar()); #endif } @@ -571,21 +491,13 @@ void ActiveAsyncProductsComponentBase :: this->m_typedAsyncDropPriority_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncDropPriority_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncDropPriority_InputPort[port].setObjName(portName); + this->m_typedAsyncDropPriority_InputPort[port].setObjName(portName.toChar()); #endif } @@ -603,21 +515,13 @@ void ActiveAsyncProductsComponentBase :: this->m_typedGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedGuarded_InputPort[port].setObjName(portName); + this->m_typedGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -635,21 +539,13 @@ void ActiveAsyncProductsComponentBase :: this->m_typedReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnGuarded_InputPort[port].setObjName(portName); + this->m_typedReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -667,21 +563,13 @@ void ActiveAsyncProductsComponentBase :: this->m_typedReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnSync_InputPort[port].setObjName(portName); + this->m_typedReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -699,21 +587,13 @@ void ActiveAsyncProductsComponentBase :: this->m_typedSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedSync_InputPort[port].setObjName(portName); + this->m_typedSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -726,21 +606,13 @@ void ActiveAsyncProductsComponentBase :: this->m_cmdRegOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdRegOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdRegOut_OutputPort[port].setObjName(portName); + this->m_cmdRegOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -753,21 +625,13 @@ void ActiveAsyncProductsComponentBase :: this->m_cmdResponseOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdResponseOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdResponseOut_OutputPort[port].setObjName(portName); + this->m_cmdResponseOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -780,21 +644,13 @@ void ActiveAsyncProductsComponentBase :: this->m_eventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_eventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_eventOut_OutputPort[port].setObjName(portName); + this->m_eventOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -807,21 +663,13 @@ void ActiveAsyncProductsComponentBase :: this->m_prmGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmGetOut_OutputPort[port].setObjName(portName); + this->m_prmGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -834,21 +682,13 @@ void ActiveAsyncProductsComponentBase :: this->m_prmSetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmSetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmSetOut_OutputPort[port].setObjName(portName); + this->m_prmSetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -861,21 +701,13 @@ void ActiveAsyncProductsComponentBase :: this->m_productRequestOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_productRequestOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_productRequestOut_OutputPort[port].setObjName(portName); + this->m_productRequestOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -888,21 +720,13 @@ void ActiveAsyncProductsComponentBase :: this->m_productSendOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_productSendOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_productSendOut_OutputPort[port].setObjName(portName); + this->m_productSendOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -916,21 +740,13 @@ void ActiveAsyncProductsComponentBase :: this->m_textEventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_textEventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_textEventOut_OutputPort[port].setObjName(portName); + this->m_textEventOut_OutputPort[port].setObjName(portName.toChar()); #endif } #endif @@ -944,21 +760,13 @@ void ActiveAsyncProductsComponentBase :: this->m_timeGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_timeGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_timeGetOut_OutputPort[port].setObjName(portName); + this->m_timeGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -971,21 +779,13 @@ void ActiveAsyncProductsComponentBase :: this->m_tlmOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_tlmOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_tlmOut_OutputPort[port].setObjName(portName); + this->m_tlmOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -998,21 +798,13 @@ void ActiveAsyncProductsComponentBase :: this->m_noArgsOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsOut_OutputPort[port].setObjName(portName); + this->m_noArgsOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -1025,21 +817,13 @@ void ActiveAsyncProductsComponentBase :: this->m_noArgsReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnOut_OutputPort[port].setObjName(portName); + this->m_noArgsReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -1052,21 +836,13 @@ void ActiveAsyncProductsComponentBase :: this->m_typedOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedOut_OutputPort[port].setObjName(portName); + this->m_typedOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -1079,21 +855,13 @@ void ActiveAsyncProductsComponentBase :: this->m_typedReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnOut_OutputPort[port].setObjName(portName); + this->m_typedReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } diff --git a/compiler/tools/fpp-to-cpp/test/component/base/ActiveCommandsComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/ActiveCommandsComponentAc.ref.cpp index 68d21e515..6686984a8 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/ActiveCommandsComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/ActiveCommandsComponentAc.ref.cpp @@ -99,21 +99,13 @@ void ActiveCommandsComponentBase :: this->m_cmdIn_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdIn_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdIn_InputPort[port].setObjName(portName); + this->m_cmdIn_InputPort[port].setObjName(portName.toChar()); #endif } @@ -131,21 +123,13 @@ void ActiveCommandsComponentBase :: this->m_noArgsAsync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsAsync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsAsync_InputPort[port].setObjName(portName); + this->m_noArgsAsync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -163,21 +147,13 @@ void ActiveCommandsComponentBase :: this->m_noArgsGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsGuarded_InputPort[port].setObjName(portName); + this->m_noArgsGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -195,21 +171,13 @@ void ActiveCommandsComponentBase :: this->m_noArgsReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName); + this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -227,21 +195,13 @@ void ActiveCommandsComponentBase :: this->m_noArgsReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnSync_InputPort[port].setObjName(portName); + this->m_noArgsReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -259,21 +219,13 @@ void ActiveCommandsComponentBase :: this->m_noArgsSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsSync_InputPort[port].setObjName(portName); + this->m_noArgsSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -291,21 +243,13 @@ void ActiveCommandsComponentBase :: this->m_typedAsync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsync_InputPort[port].setObjName(portName); + this->m_typedAsync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -323,21 +267,13 @@ void ActiveCommandsComponentBase :: this->m_typedAsyncAssert_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncAssert_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncAssert_InputPort[port].setObjName(portName); + this->m_typedAsyncAssert_InputPort[port].setObjName(portName.toChar()); #endif } @@ -355,21 +291,13 @@ void ActiveCommandsComponentBase :: this->m_typedAsyncBlockPriority_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncBlockPriority_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncBlockPriority_InputPort[port].setObjName(portName); + this->m_typedAsyncBlockPriority_InputPort[port].setObjName(portName.toChar()); #endif } @@ -387,21 +315,13 @@ void ActiveCommandsComponentBase :: this->m_typedAsyncDropPriority_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncDropPriority_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncDropPriority_InputPort[port].setObjName(portName); + this->m_typedAsyncDropPriority_InputPort[port].setObjName(portName.toChar()); #endif } @@ -419,21 +339,13 @@ void ActiveCommandsComponentBase :: this->m_typedGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedGuarded_InputPort[port].setObjName(portName); + this->m_typedGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -451,21 +363,13 @@ void ActiveCommandsComponentBase :: this->m_typedReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnGuarded_InputPort[port].setObjName(portName); + this->m_typedReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -483,21 +387,13 @@ void ActiveCommandsComponentBase :: this->m_typedReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnSync_InputPort[port].setObjName(portName); + this->m_typedReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -515,21 +411,13 @@ void ActiveCommandsComponentBase :: this->m_typedSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedSync_InputPort[port].setObjName(portName); + this->m_typedSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -542,21 +430,13 @@ void ActiveCommandsComponentBase :: this->m_cmdRegOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdRegOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdRegOut_OutputPort[port].setObjName(portName); + this->m_cmdRegOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -569,21 +449,13 @@ void ActiveCommandsComponentBase :: this->m_cmdResponseOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdResponseOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdResponseOut_OutputPort[port].setObjName(portName); + this->m_cmdResponseOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -596,21 +468,13 @@ void ActiveCommandsComponentBase :: this->m_eventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_eventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_eventOut_OutputPort[port].setObjName(portName); + this->m_eventOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -623,21 +487,13 @@ void ActiveCommandsComponentBase :: this->m_prmGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmGetOut_OutputPort[port].setObjName(portName); + this->m_prmGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -650,21 +506,13 @@ void ActiveCommandsComponentBase :: this->m_prmSetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmSetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmSetOut_OutputPort[port].setObjName(portName); + this->m_prmSetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -678,21 +526,13 @@ void ActiveCommandsComponentBase :: this->m_textEventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_textEventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_textEventOut_OutputPort[port].setObjName(portName); + this->m_textEventOut_OutputPort[port].setObjName(portName.toChar()); #endif } #endif @@ -706,21 +546,13 @@ void ActiveCommandsComponentBase :: this->m_timeGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_timeGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_timeGetOut_OutputPort[port].setObjName(portName); + this->m_timeGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -733,21 +565,13 @@ void ActiveCommandsComponentBase :: this->m_tlmOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_tlmOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_tlmOut_OutputPort[port].setObjName(portName); + this->m_tlmOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -760,21 +584,13 @@ void ActiveCommandsComponentBase :: this->m_noArgsOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsOut_OutputPort[port].setObjName(portName); + this->m_noArgsOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -787,21 +603,13 @@ void ActiveCommandsComponentBase :: this->m_noArgsReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnOut_OutputPort[port].setObjName(portName); + this->m_noArgsReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -814,21 +622,13 @@ void ActiveCommandsComponentBase :: this->m_typedOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedOut_OutputPort[port].setObjName(portName); + this->m_typedOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -841,21 +641,13 @@ void ActiveCommandsComponentBase :: this->m_typedReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnOut_OutputPort[port].setObjName(portName); + this->m_typedReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } diff --git a/compiler/tools/fpp-to-cpp/test/component/base/ActiveEventsComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/ActiveEventsComponentAc.ref.cpp index 42e1b8ec6..0461b3b4d 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/ActiveEventsComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/ActiveEventsComponentAc.ref.cpp @@ -94,21 +94,13 @@ void ActiveEventsComponentBase :: this->m_cmdIn_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdIn_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdIn_InputPort[port].setObjName(portName); + this->m_cmdIn_InputPort[port].setObjName(portName.toChar()); #endif } @@ -126,21 +118,13 @@ void ActiveEventsComponentBase :: this->m_noArgsAsync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsAsync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsAsync_InputPort[port].setObjName(portName); + this->m_noArgsAsync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -158,21 +142,13 @@ void ActiveEventsComponentBase :: this->m_noArgsGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsGuarded_InputPort[port].setObjName(portName); + this->m_noArgsGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -190,21 +166,13 @@ void ActiveEventsComponentBase :: this->m_noArgsReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName); + this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -222,21 +190,13 @@ void ActiveEventsComponentBase :: this->m_noArgsReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnSync_InputPort[port].setObjName(portName); + this->m_noArgsReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -254,21 +214,13 @@ void ActiveEventsComponentBase :: this->m_noArgsSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsSync_InputPort[port].setObjName(portName); + this->m_noArgsSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -286,21 +238,13 @@ void ActiveEventsComponentBase :: this->m_typedAsync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsync_InputPort[port].setObjName(portName); + this->m_typedAsync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -318,21 +262,13 @@ void ActiveEventsComponentBase :: this->m_typedAsyncAssert_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncAssert_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncAssert_InputPort[port].setObjName(portName); + this->m_typedAsyncAssert_InputPort[port].setObjName(portName.toChar()); #endif } @@ -350,21 +286,13 @@ void ActiveEventsComponentBase :: this->m_typedAsyncBlockPriority_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncBlockPriority_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncBlockPriority_InputPort[port].setObjName(portName); + this->m_typedAsyncBlockPriority_InputPort[port].setObjName(portName.toChar()); #endif } @@ -382,21 +310,13 @@ void ActiveEventsComponentBase :: this->m_typedAsyncDropPriority_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncDropPriority_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncDropPriority_InputPort[port].setObjName(portName); + this->m_typedAsyncDropPriority_InputPort[port].setObjName(portName.toChar()); #endif } @@ -414,21 +334,13 @@ void ActiveEventsComponentBase :: this->m_typedGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedGuarded_InputPort[port].setObjName(portName); + this->m_typedGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -446,21 +358,13 @@ void ActiveEventsComponentBase :: this->m_typedReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnGuarded_InputPort[port].setObjName(portName); + this->m_typedReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -478,21 +382,13 @@ void ActiveEventsComponentBase :: this->m_typedReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnSync_InputPort[port].setObjName(portName); + this->m_typedReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -510,21 +406,13 @@ void ActiveEventsComponentBase :: this->m_typedSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedSync_InputPort[port].setObjName(portName); + this->m_typedSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -537,21 +425,13 @@ void ActiveEventsComponentBase :: this->m_cmdRegOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdRegOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdRegOut_OutputPort[port].setObjName(portName); + this->m_cmdRegOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -564,21 +444,13 @@ void ActiveEventsComponentBase :: this->m_cmdResponseOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdResponseOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdResponseOut_OutputPort[port].setObjName(portName); + this->m_cmdResponseOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -591,21 +463,13 @@ void ActiveEventsComponentBase :: this->m_eventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_eventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_eventOut_OutputPort[port].setObjName(portName); + this->m_eventOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -618,21 +482,13 @@ void ActiveEventsComponentBase :: this->m_prmGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmGetOut_OutputPort[port].setObjName(portName); + this->m_prmGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -645,21 +501,13 @@ void ActiveEventsComponentBase :: this->m_prmSetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmSetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmSetOut_OutputPort[port].setObjName(portName); + this->m_prmSetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -673,21 +521,13 @@ void ActiveEventsComponentBase :: this->m_textEventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_textEventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_textEventOut_OutputPort[port].setObjName(portName); + this->m_textEventOut_OutputPort[port].setObjName(portName.toChar()); #endif } #endif @@ -701,21 +541,13 @@ void ActiveEventsComponentBase :: this->m_timeGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_timeGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_timeGetOut_OutputPort[port].setObjName(portName); + this->m_timeGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -728,21 +560,13 @@ void ActiveEventsComponentBase :: this->m_tlmOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_tlmOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_tlmOut_OutputPort[port].setObjName(portName); + this->m_tlmOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -755,21 +579,13 @@ void ActiveEventsComponentBase :: this->m_noArgsOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsOut_OutputPort[port].setObjName(portName); + this->m_noArgsOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -782,21 +598,13 @@ void ActiveEventsComponentBase :: this->m_noArgsReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnOut_OutputPort[port].setObjName(portName); + this->m_noArgsReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -809,21 +617,13 @@ void ActiveEventsComponentBase :: this->m_typedOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedOut_OutputPort[port].setObjName(portName); + this->m_typedOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -836,21 +636,13 @@ void ActiveEventsComponentBase :: this->m_typedReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnOut_OutputPort[port].setObjName(portName); + this->m_typedReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -2595,7 +2387,7 @@ void ActiveEventsComponentBase :: FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventActivityHigh " ); @@ -2726,7 +2518,7 @@ void ActiveEventsComponentBase :: FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventActivityLowThrottled ", u32, @@ -2815,7 +2607,7 @@ void ActiveEventsComponentBase :: FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventCommand ", str1.toChar(), @@ -2907,7 +2699,7 @@ void ActiveEventsComponentBase :: FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventDiagnostic ", eStr.toChar() @@ -3019,7 +2811,7 @@ void ActiveEventsComponentBase :: FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventFatalThrottled ", aStr.toChar() @@ -3110,7 +2902,7 @@ void ActiveEventsComponentBase :: FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventWarningHigh ", sStr.toChar() @@ -3190,7 +2982,7 @@ void ActiveEventsComponentBase :: FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventWarningLowThrottled " ); diff --git a/compiler/tools/fpp-to-cpp/test/component/base/ActiveGetProductsComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/ActiveGetProductsComponentAc.ref.cpp index bdfc809c7..6ca051426 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/ActiveGetProductsComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/ActiveGetProductsComponentAc.ref.cpp @@ -249,21 +249,13 @@ void ActiveGetProductsComponentBase :: this->m_cmdIn_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdIn_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdIn_InputPort[port].setObjName(portName); + this->m_cmdIn_InputPort[port].setObjName(portName.toChar()); #endif } @@ -281,21 +273,13 @@ void ActiveGetProductsComponentBase :: this->m_noArgsAsync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsAsync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsAsync_InputPort[port].setObjName(portName); + this->m_noArgsAsync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -313,21 +297,13 @@ void ActiveGetProductsComponentBase :: this->m_noArgsGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsGuarded_InputPort[port].setObjName(portName); + this->m_noArgsGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -345,21 +321,13 @@ void ActiveGetProductsComponentBase :: this->m_noArgsReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName); + this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -377,21 +345,13 @@ void ActiveGetProductsComponentBase :: this->m_noArgsReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnSync_InputPort[port].setObjName(portName); + this->m_noArgsReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -409,21 +369,13 @@ void ActiveGetProductsComponentBase :: this->m_noArgsSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsSync_InputPort[port].setObjName(portName); + this->m_noArgsSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -441,21 +393,13 @@ void ActiveGetProductsComponentBase :: this->m_typedAsync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsync_InputPort[port].setObjName(portName); + this->m_typedAsync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -473,21 +417,13 @@ void ActiveGetProductsComponentBase :: this->m_typedAsyncAssert_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncAssert_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncAssert_InputPort[port].setObjName(portName); + this->m_typedAsyncAssert_InputPort[port].setObjName(portName.toChar()); #endif } @@ -505,21 +441,13 @@ void ActiveGetProductsComponentBase :: this->m_typedAsyncBlockPriority_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncBlockPriority_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncBlockPriority_InputPort[port].setObjName(portName); + this->m_typedAsyncBlockPriority_InputPort[port].setObjName(portName.toChar()); #endif } @@ -537,21 +465,13 @@ void ActiveGetProductsComponentBase :: this->m_typedAsyncDropPriority_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncDropPriority_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncDropPriority_InputPort[port].setObjName(portName); + this->m_typedAsyncDropPriority_InputPort[port].setObjName(portName.toChar()); #endif } @@ -569,21 +489,13 @@ void ActiveGetProductsComponentBase :: this->m_typedGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedGuarded_InputPort[port].setObjName(portName); + this->m_typedGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -601,21 +513,13 @@ void ActiveGetProductsComponentBase :: this->m_typedReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnGuarded_InputPort[port].setObjName(portName); + this->m_typedReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -633,21 +537,13 @@ void ActiveGetProductsComponentBase :: this->m_typedReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnSync_InputPort[port].setObjName(portName); + this->m_typedReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -665,21 +561,13 @@ void ActiveGetProductsComponentBase :: this->m_typedSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedSync_InputPort[port].setObjName(portName); + this->m_typedSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -692,21 +580,13 @@ void ActiveGetProductsComponentBase :: this->m_cmdRegOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdRegOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdRegOut_OutputPort[port].setObjName(portName); + this->m_cmdRegOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -719,21 +599,13 @@ void ActiveGetProductsComponentBase :: this->m_cmdResponseOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdResponseOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdResponseOut_OutputPort[port].setObjName(portName); + this->m_cmdResponseOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -746,21 +618,13 @@ void ActiveGetProductsComponentBase :: this->m_eventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_eventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_eventOut_OutputPort[port].setObjName(portName); + this->m_eventOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -773,21 +637,13 @@ void ActiveGetProductsComponentBase :: this->m_prmGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmGetOut_OutputPort[port].setObjName(portName); + this->m_prmGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -800,21 +656,13 @@ void ActiveGetProductsComponentBase :: this->m_prmSetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmSetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmSetOut_OutputPort[port].setObjName(portName); + this->m_prmSetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -827,21 +675,13 @@ void ActiveGetProductsComponentBase :: this->m_productGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_productGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_productGetOut_OutputPort[port].setObjName(portName); + this->m_productGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -854,21 +694,13 @@ void ActiveGetProductsComponentBase :: this->m_productSendOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_productSendOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_productSendOut_OutputPort[port].setObjName(portName); + this->m_productSendOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -882,21 +714,13 @@ void ActiveGetProductsComponentBase :: this->m_textEventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_textEventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_textEventOut_OutputPort[port].setObjName(portName); + this->m_textEventOut_OutputPort[port].setObjName(portName.toChar()); #endif } #endif @@ -910,21 +734,13 @@ void ActiveGetProductsComponentBase :: this->m_timeGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_timeGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_timeGetOut_OutputPort[port].setObjName(portName); + this->m_timeGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -937,21 +753,13 @@ void ActiveGetProductsComponentBase :: this->m_tlmOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_tlmOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_tlmOut_OutputPort[port].setObjName(portName); + this->m_tlmOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -964,21 +772,13 @@ void ActiveGetProductsComponentBase :: this->m_noArgsOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsOut_OutputPort[port].setObjName(portName); + this->m_noArgsOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -991,21 +791,13 @@ void ActiveGetProductsComponentBase :: this->m_noArgsReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnOut_OutputPort[port].setObjName(portName); + this->m_noArgsReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -1018,21 +810,13 @@ void ActiveGetProductsComponentBase :: this->m_typedOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedOut_OutputPort[port].setObjName(portName); + this->m_typedOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -1045,21 +829,13 @@ void ActiveGetProductsComponentBase :: this->m_typedReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnOut_OutputPort[port].setObjName(portName); + this->m_typedReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } diff --git a/compiler/tools/fpp-to-cpp/test/component/base/ActiveGuardedProductsComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/ActiveGuardedProductsComponentAc.ref.cpp index 7c1f6129f..d55bbfe77 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/ActiveGuardedProductsComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/ActiveGuardedProductsComponentAc.ref.cpp @@ -249,21 +249,13 @@ void ActiveGuardedProductsComponentBase :: this->m_cmdIn_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdIn_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdIn_InputPort[port].setObjName(portName); + this->m_cmdIn_InputPort[port].setObjName(portName.toChar()); #endif } @@ -281,21 +273,13 @@ void ActiveGuardedProductsComponentBase :: this->m_productRecvIn_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_productRecvIn_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_productRecvIn_InputPort[port].setObjName(portName); + this->m_productRecvIn_InputPort[port].setObjName(portName.toChar()); #endif } @@ -313,21 +297,13 @@ void ActiveGuardedProductsComponentBase :: this->m_noArgsAsync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsAsync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsAsync_InputPort[port].setObjName(portName); + this->m_noArgsAsync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -345,21 +321,13 @@ void ActiveGuardedProductsComponentBase :: this->m_noArgsGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsGuarded_InputPort[port].setObjName(portName); + this->m_noArgsGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -377,21 +345,13 @@ void ActiveGuardedProductsComponentBase :: this->m_noArgsReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName); + this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -409,21 +369,13 @@ void ActiveGuardedProductsComponentBase :: this->m_noArgsReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnSync_InputPort[port].setObjName(portName); + this->m_noArgsReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -441,21 +393,13 @@ void ActiveGuardedProductsComponentBase :: this->m_noArgsSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsSync_InputPort[port].setObjName(portName); + this->m_noArgsSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -473,21 +417,13 @@ void ActiveGuardedProductsComponentBase :: this->m_typedAsync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsync_InputPort[port].setObjName(portName); + this->m_typedAsync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -505,21 +441,13 @@ void ActiveGuardedProductsComponentBase :: this->m_typedAsyncAssert_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncAssert_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncAssert_InputPort[port].setObjName(portName); + this->m_typedAsyncAssert_InputPort[port].setObjName(portName.toChar()); #endif } @@ -537,21 +465,13 @@ void ActiveGuardedProductsComponentBase :: this->m_typedAsyncBlockPriority_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncBlockPriority_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncBlockPriority_InputPort[port].setObjName(portName); + this->m_typedAsyncBlockPriority_InputPort[port].setObjName(portName.toChar()); #endif } @@ -569,21 +489,13 @@ void ActiveGuardedProductsComponentBase :: this->m_typedAsyncDropPriority_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncDropPriority_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncDropPriority_InputPort[port].setObjName(portName); + this->m_typedAsyncDropPriority_InputPort[port].setObjName(portName.toChar()); #endif } @@ -601,21 +513,13 @@ void ActiveGuardedProductsComponentBase :: this->m_typedGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedGuarded_InputPort[port].setObjName(portName); + this->m_typedGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -633,21 +537,13 @@ void ActiveGuardedProductsComponentBase :: this->m_typedReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnGuarded_InputPort[port].setObjName(portName); + this->m_typedReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -665,21 +561,13 @@ void ActiveGuardedProductsComponentBase :: this->m_typedReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnSync_InputPort[port].setObjName(portName); + this->m_typedReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -697,21 +585,13 @@ void ActiveGuardedProductsComponentBase :: this->m_typedSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedSync_InputPort[port].setObjName(portName); + this->m_typedSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -724,21 +604,13 @@ void ActiveGuardedProductsComponentBase :: this->m_cmdRegOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdRegOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdRegOut_OutputPort[port].setObjName(portName); + this->m_cmdRegOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -751,21 +623,13 @@ void ActiveGuardedProductsComponentBase :: this->m_cmdResponseOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdResponseOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdResponseOut_OutputPort[port].setObjName(portName); + this->m_cmdResponseOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -778,21 +642,13 @@ void ActiveGuardedProductsComponentBase :: this->m_eventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_eventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_eventOut_OutputPort[port].setObjName(portName); + this->m_eventOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -805,21 +661,13 @@ void ActiveGuardedProductsComponentBase :: this->m_prmGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmGetOut_OutputPort[port].setObjName(portName); + this->m_prmGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -832,21 +680,13 @@ void ActiveGuardedProductsComponentBase :: this->m_prmSetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmSetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmSetOut_OutputPort[port].setObjName(portName); + this->m_prmSetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -859,21 +699,13 @@ void ActiveGuardedProductsComponentBase :: this->m_productRequestOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_productRequestOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_productRequestOut_OutputPort[port].setObjName(portName); + this->m_productRequestOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -886,21 +718,13 @@ void ActiveGuardedProductsComponentBase :: this->m_productSendOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_productSendOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_productSendOut_OutputPort[port].setObjName(portName); + this->m_productSendOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -914,21 +738,13 @@ void ActiveGuardedProductsComponentBase :: this->m_textEventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_textEventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_textEventOut_OutputPort[port].setObjName(portName); + this->m_textEventOut_OutputPort[port].setObjName(portName.toChar()); #endif } #endif @@ -942,21 +758,13 @@ void ActiveGuardedProductsComponentBase :: this->m_timeGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_timeGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_timeGetOut_OutputPort[port].setObjName(portName); + this->m_timeGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -969,21 +777,13 @@ void ActiveGuardedProductsComponentBase :: this->m_tlmOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_tlmOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_tlmOut_OutputPort[port].setObjName(portName); + this->m_tlmOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -996,21 +796,13 @@ void ActiveGuardedProductsComponentBase :: this->m_noArgsOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsOut_OutputPort[port].setObjName(portName); + this->m_noArgsOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -1023,21 +815,13 @@ void ActiveGuardedProductsComponentBase :: this->m_noArgsReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnOut_OutputPort[port].setObjName(portName); + this->m_noArgsReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -1050,21 +834,13 @@ void ActiveGuardedProductsComponentBase :: this->m_typedOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedOut_OutputPort[port].setObjName(portName); + this->m_typedOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -1077,21 +853,13 @@ void ActiveGuardedProductsComponentBase :: this->m_typedReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnOut_OutputPort[port].setObjName(portName); + this->m_typedReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } diff --git a/compiler/tools/fpp-to-cpp/test/component/base/ActiveNoArgsPortsOnlyComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/ActiveNoArgsPortsOnlyComponentAc.ref.cpp index 02d8879bb..f5c996219 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/ActiveNoArgsPortsOnlyComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/ActiveNoArgsPortsOnlyComponentAc.ref.cpp @@ -79,21 +79,13 @@ void ActiveNoArgsPortsOnlyComponentBase :: this->m_noArgsAsync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsAsync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsAsync_InputPort[port].setObjName(portName); + this->m_noArgsAsync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -111,21 +103,13 @@ void ActiveNoArgsPortsOnlyComponentBase :: this->m_noArgsGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsGuarded_InputPort[port].setObjName(portName); + this->m_noArgsGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -143,21 +127,13 @@ void ActiveNoArgsPortsOnlyComponentBase :: this->m_noArgsReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName); + this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -175,21 +151,13 @@ void ActiveNoArgsPortsOnlyComponentBase :: this->m_noArgsReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnSync_InputPort[port].setObjName(portName); + this->m_noArgsReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -202,21 +170,13 @@ void ActiveNoArgsPortsOnlyComponentBase :: this->m_noArgsOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsOut_OutputPort[port].setObjName(portName); + this->m_noArgsOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -229,21 +189,13 @@ void ActiveNoArgsPortsOnlyComponentBase :: this->m_noArgsReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnOut_OutputPort[port].setObjName(portName); + this->m_noArgsReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } diff --git a/compiler/tools/fpp-to-cpp/test/component/base/ActiveParamsComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/ActiveParamsComponentAc.ref.cpp index c0e1e461c..6c9148966 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/ActiveParamsComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/ActiveParamsComponentAc.ref.cpp @@ -94,21 +94,13 @@ void ActiveParamsComponentBase :: this->m_cmdIn_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdIn_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdIn_InputPort[port].setObjName(portName); + this->m_cmdIn_InputPort[port].setObjName(portName.toChar()); #endif } @@ -126,21 +118,13 @@ void ActiveParamsComponentBase :: this->m_noArgsAsync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsAsync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsAsync_InputPort[port].setObjName(portName); + this->m_noArgsAsync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -158,21 +142,13 @@ void ActiveParamsComponentBase :: this->m_noArgsGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsGuarded_InputPort[port].setObjName(portName); + this->m_noArgsGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -190,21 +166,13 @@ void ActiveParamsComponentBase :: this->m_noArgsReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName); + this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -222,21 +190,13 @@ void ActiveParamsComponentBase :: this->m_noArgsReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnSync_InputPort[port].setObjName(portName); + this->m_noArgsReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -254,21 +214,13 @@ void ActiveParamsComponentBase :: this->m_noArgsSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsSync_InputPort[port].setObjName(portName); + this->m_noArgsSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -286,21 +238,13 @@ void ActiveParamsComponentBase :: this->m_typedAsync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsync_InputPort[port].setObjName(portName); + this->m_typedAsync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -318,21 +262,13 @@ void ActiveParamsComponentBase :: this->m_typedAsyncAssert_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncAssert_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncAssert_InputPort[port].setObjName(portName); + this->m_typedAsyncAssert_InputPort[port].setObjName(portName.toChar()); #endif } @@ -350,21 +286,13 @@ void ActiveParamsComponentBase :: this->m_typedAsyncBlockPriority_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncBlockPriority_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncBlockPriority_InputPort[port].setObjName(portName); + this->m_typedAsyncBlockPriority_InputPort[port].setObjName(portName.toChar()); #endif } @@ -382,21 +310,13 @@ void ActiveParamsComponentBase :: this->m_typedAsyncDropPriority_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncDropPriority_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncDropPriority_InputPort[port].setObjName(portName); + this->m_typedAsyncDropPriority_InputPort[port].setObjName(portName.toChar()); #endif } @@ -414,21 +334,13 @@ void ActiveParamsComponentBase :: this->m_typedGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedGuarded_InputPort[port].setObjName(portName); + this->m_typedGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -446,21 +358,13 @@ void ActiveParamsComponentBase :: this->m_typedReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnGuarded_InputPort[port].setObjName(portName); + this->m_typedReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -478,21 +382,13 @@ void ActiveParamsComponentBase :: this->m_typedReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnSync_InputPort[port].setObjName(portName); + this->m_typedReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -510,21 +406,13 @@ void ActiveParamsComponentBase :: this->m_typedSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedSync_InputPort[port].setObjName(portName); + this->m_typedSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -537,21 +425,13 @@ void ActiveParamsComponentBase :: this->m_cmdRegOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdRegOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdRegOut_OutputPort[port].setObjName(portName); + this->m_cmdRegOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -564,21 +444,13 @@ void ActiveParamsComponentBase :: this->m_cmdResponseOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdResponseOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdResponseOut_OutputPort[port].setObjName(portName); + this->m_cmdResponseOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -591,21 +463,13 @@ void ActiveParamsComponentBase :: this->m_eventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_eventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_eventOut_OutputPort[port].setObjName(portName); + this->m_eventOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -618,21 +482,13 @@ void ActiveParamsComponentBase :: this->m_prmGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmGetOut_OutputPort[port].setObjName(portName); + this->m_prmGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -645,21 +501,13 @@ void ActiveParamsComponentBase :: this->m_prmSetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmSetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmSetOut_OutputPort[port].setObjName(portName); + this->m_prmSetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -673,21 +521,13 @@ void ActiveParamsComponentBase :: this->m_textEventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_textEventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_textEventOut_OutputPort[port].setObjName(portName); + this->m_textEventOut_OutputPort[port].setObjName(portName.toChar()); #endif } #endif @@ -701,21 +541,13 @@ void ActiveParamsComponentBase :: this->m_timeGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_timeGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_timeGetOut_OutputPort[port].setObjName(portName); + this->m_timeGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -728,21 +560,13 @@ void ActiveParamsComponentBase :: this->m_tlmOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_tlmOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_tlmOut_OutputPort[port].setObjName(portName); + this->m_tlmOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -755,21 +579,13 @@ void ActiveParamsComponentBase :: this->m_noArgsOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsOut_OutputPort[port].setObjName(portName); + this->m_noArgsOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -782,21 +598,13 @@ void ActiveParamsComponentBase :: this->m_noArgsReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnOut_OutputPort[port].setObjName(portName); + this->m_noArgsReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -809,21 +617,13 @@ void ActiveParamsComponentBase :: this->m_typedOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedOut_OutputPort[port].setObjName(portName); + this->m_typedOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -836,21 +636,13 @@ void ActiveParamsComponentBase :: this->m_typedReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnOut_OutputPort[port].setObjName(portName); + this->m_typedReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } diff --git a/compiler/tools/fpp-to-cpp/test/component/base/ActiveSerialComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/ActiveSerialComponentAc.ref.cpp index 47a7fc93e..4850001ea 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/ActiveSerialComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/ActiveSerialComponentAc.ref.cpp @@ -133,21 +133,13 @@ void ActiveSerialComponentBase :: this->m_cmdIn_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdIn_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdIn_InputPort[port].setObjName(portName); + this->m_cmdIn_InputPort[port].setObjName(portName.toChar()); #endif } @@ -165,21 +157,13 @@ void ActiveSerialComponentBase :: this->m_noArgsAsync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsAsync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsAsync_InputPort[port].setObjName(portName); + this->m_noArgsAsync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -197,21 +181,13 @@ void ActiveSerialComponentBase :: this->m_noArgsGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsGuarded_InputPort[port].setObjName(portName); + this->m_noArgsGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -229,21 +205,13 @@ void ActiveSerialComponentBase :: this->m_noArgsReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName); + this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -261,21 +229,13 @@ void ActiveSerialComponentBase :: this->m_noArgsReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnSync_InputPort[port].setObjName(portName); + this->m_noArgsReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -293,21 +253,13 @@ void ActiveSerialComponentBase :: this->m_noArgsSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsSync_InputPort[port].setObjName(portName); + this->m_noArgsSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -325,21 +277,13 @@ void ActiveSerialComponentBase :: this->m_typedAsync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsync_InputPort[port].setObjName(portName); + this->m_typedAsync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -357,21 +301,13 @@ void ActiveSerialComponentBase :: this->m_typedAsyncAssert_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncAssert_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncAssert_InputPort[port].setObjName(portName); + this->m_typedAsyncAssert_InputPort[port].setObjName(portName.toChar()); #endif } @@ -389,21 +325,13 @@ void ActiveSerialComponentBase :: this->m_typedAsyncBlockPriority_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncBlockPriority_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncBlockPriority_InputPort[port].setObjName(portName); + this->m_typedAsyncBlockPriority_InputPort[port].setObjName(portName.toChar()); #endif } @@ -421,21 +349,13 @@ void ActiveSerialComponentBase :: this->m_typedAsyncDropPriority_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncDropPriority_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncDropPriority_InputPort[port].setObjName(portName); + this->m_typedAsyncDropPriority_InputPort[port].setObjName(portName.toChar()); #endif } @@ -453,21 +373,13 @@ void ActiveSerialComponentBase :: this->m_typedGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedGuarded_InputPort[port].setObjName(portName); + this->m_typedGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -485,21 +397,13 @@ void ActiveSerialComponentBase :: this->m_typedReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnGuarded_InputPort[port].setObjName(portName); + this->m_typedReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -517,21 +421,13 @@ void ActiveSerialComponentBase :: this->m_typedReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnSync_InputPort[port].setObjName(portName); + this->m_typedReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -549,21 +445,13 @@ void ActiveSerialComponentBase :: this->m_typedSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedSync_InputPort[port].setObjName(portName); + this->m_typedSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -581,21 +469,13 @@ void ActiveSerialComponentBase :: this->m_serialAsync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_serialAsync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_serialAsync_InputPort[port].setObjName(portName); + this->m_serialAsync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -613,21 +493,13 @@ void ActiveSerialComponentBase :: this->m_serialAsyncAssert_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_serialAsyncAssert_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_serialAsyncAssert_InputPort[port].setObjName(portName); + this->m_serialAsyncAssert_InputPort[port].setObjName(portName.toChar()); #endif } @@ -645,21 +517,13 @@ void ActiveSerialComponentBase :: this->m_serialAsyncBlockPriority_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_serialAsyncBlockPriority_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_serialAsyncBlockPriority_InputPort[port].setObjName(portName); + this->m_serialAsyncBlockPriority_InputPort[port].setObjName(portName.toChar()); #endif } @@ -677,21 +541,13 @@ void ActiveSerialComponentBase :: this->m_serialAsyncDropPriority_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_serialAsyncDropPriority_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_serialAsyncDropPriority_InputPort[port].setObjName(portName); + this->m_serialAsyncDropPriority_InputPort[port].setObjName(portName.toChar()); #endif } @@ -709,21 +565,13 @@ void ActiveSerialComponentBase :: this->m_serialGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_serialGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_serialGuarded_InputPort[port].setObjName(portName); + this->m_serialGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -741,21 +589,13 @@ void ActiveSerialComponentBase :: this->m_serialSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_serialSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_serialSync_InputPort[port].setObjName(portName); + this->m_serialSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -768,21 +608,13 @@ void ActiveSerialComponentBase :: this->m_cmdRegOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdRegOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdRegOut_OutputPort[port].setObjName(portName); + this->m_cmdRegOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -795,21 +627,13 @@ void ActiveSerialComponentBase :: this->m_cmdResponseOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdResponseOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdResponseOut_OutputPort[port].setObjName(portName); + this->m_cmdResponseOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -822,21 +646,13 @@ void ActiveSerialComponentBase :: this->m_eventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_eventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_eventOut_OutputPort[port].setObjName(portName); + this->m_eventOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -849,21 +665,13 @@ void ActiveSerialComponentBase :: this->m_prmGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmGetOut_OutputPort[port].setObjName(portName); + this->m_prmGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -876,21 +684,13 @@ void ActiveSerialComponentBase :: this->m_prmSetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmSetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmSetOut_OutputPort[port].setObjName(portName); + this->m_prmSetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -904,21 +704,13 @@ void ActiveSerialComponentBase :: this->m_textEventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_textEventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_textEventOut_OutputPort[port].setObjName(portName); + this->m_textEventOut_OutputPort[port].setObjName(portName.toChar()); #endif } #endif @@ -932,21 +724,13 @@ void ActiveSerialComponentBase :: this->m_timeGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_timeGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_timeGetOut_OutputPort[port].setObjName(portName); + this->m_timeGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -959,21 +743,13 @@ void ActiveSerialComponentBase :: this->m_tlmOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_tlmOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_tlmOut_OutputPort[port].setObjName(portName); + this->m_tlmOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -986,21 +762,13 @@ void ActiveSerialComponentBase :: this->m_noArgsOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsOut_OutputPort[port].setObjName(portName); + this->m_noArgsOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -1013,21 +781,13 @@ void ActiveSerialComponentBase :: this->m_noArgsReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnOut_OutputPort[port].setObjName(portName); + this->m_noArgsReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -1040,21 +800,13 @@ void ActiveSerialComponentBase :: this->m_typedOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedOut_OutputPort[port].setObjName(portName); + this->m_typedOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -1067,21 +819,13 @@ void ActiveSerialComponentBase :: this->m_typedReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnOut_OutputPort[port].setObjName(portName); + this->m_typedReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -1094,21 +838,13 @@ void ActiveSerialComponentBase :: this->m_serialOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_serialOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_serialOut_OutputPort[port].setObjName(portName); + this->m_serialOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -4915,7 +4651,7 @@ void ActiveSerialComponentBase :: FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventActivityHigh " ); @@ -5046,7 +4782,7 @@ void ActiveSerialComponentBase :: FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventActivityLowThrottled ", u32, @@ -5135,7 +4871,7 @@ void ActiveSerialComponentBase :: FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventCommand ", str1.toChar(), @@ -5227,7 +4963,7 @@ void ActiveSerialComponentBase :: FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventDiagnostic ", eStr.toChar() @@ -5339,7 +5075,7 @@ void ActiveSerialComponentBase :: FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventFatalThrottled ", aStr.toChar() @@ -5430,7 +5166,7 @@ void ActiveSerialComponentBase :: FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventWarningHigh ", sStr.toChar() @@ -5510,7 +5246,7 @@ void ActiveSerialComponentBase :: FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventWarningLowThrottled " ); diff --git a/compiler/tools/fpp-to-cpp/test/component/base/ActiveSyncProductsComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/ActiveSyncProductsComponentAc.ref.cpp index 989c1431a..52b9f954d 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/ActiveSyncProductsComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/ActiveSyncProductsComponentAc.ref.cpp @@ -249,21 +249,13 @@ void ActiveSyncProductsComponentBase :: this->m_cmdIn_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdIn_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdIn_InputPort[port].setObjName(portName); + this->m_cmdIn_InputPort[port].setObjName(portName.toChar()); #endif } @@ -281,21 +273,13 @@ void ActiveSyncProductsComponentBase :: this->m_productRecvIn_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_productRecvIn_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_productRecvIn_InputPort[port].setObjName(portName); + this->m_productRecvIn_InputPort[port].setObjName(portName.toChar()); #endif } @@ -313,21 +297,13 @@ void ActiveSyncProductsComponentBase :: this->m_noArgsAsync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsAsync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsAsync_InputPort[port].setObjName(portName); + this->m_noArgsAsync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -345,21 +321,13 @@ void ActiveSyncProductsComponentBase :: this->m_noArgsGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsGuarded_InputPort[port].setObjName(portName); + this->m_noArgsGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -377,21 +345,13 @@ void ActiveSyncProductsComponentBase :: this->m_noArgsReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName); + this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -409,21 +369,13 @@ void ActiveSyncProductsComponentBase :: this->m_noArgsReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnSync_InputPort[port].setObjName(portName); + this->m_noArgsReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -441,21 +393,13 @@ void ActiveSyncProductsComponentBase :: this->m_noArgsSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsSync_InputPort[port].setObjName(portName); + this->m_noArgsSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -473,21 +417,13 @@ void ActiveSyncProductsComponentBase :: this->m_typedAsync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsync_InputPort[port].setObjName(portName); + this->m_typedAsync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -505,21 +441,13 @@ void ActiveSyncProductsComponentBase :: this->m_typedAsyncAssert_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncAssert_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncAssert_InputPort[port].setObjName(portName); + this->m_typedAsyncAssert_InputPort[port].setObjName(portName.toChar()); #endif } @@ -537,21 +465,13 @@ void ActiveSyncProductsComponentBase :: this->m_typedAsyncBlockPriority_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncBlockPriority_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncBlockPriority_InputPort[port].setObjName(portName); + this->m_typedAsyncBlockPriority_InputPort[port].setObjName(portName.toChar()); #endif } @@ -569,21 +489,13 @@ void ActiveSyncProductsComponentBase :: this->m_typedAsyncDropPriority_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncDropPriority_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncDropPriority_InputPort[port].setObjName(portName); + this->m_typedAsyncDropPriority_InputPort[port].setObjName(portName.toChar()); #endif } @@ -601,21 +513,13 @@ void ActiveSyncProductsComponentBase :: this->m_typedGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedGuarded_InputPort[port].setObjName(portName); + this->m_typedGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -633,21 +537,13 @@ void ActiveSyncProductsComponentBase :: this->m_typedReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnGuarded_InputPort[port].setObjName(portName); + this->m_typedReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -665,21 +561,13 @@ void ActiveSyncProductsComponentBase :: this->m_typedReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnSync_InputPort[port].setObjName(portName); + this->m_typedReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -697,21 +585,13 @@ void ActiveSyncProductsComponentBase :: this->m_typedSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedSync_InputPort[port].setObjName(portName); + this->m_typedSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -724,21 +604,13 @@ void ActiveSyncProductsComponentBase :: this->m_cmdRegOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdRegOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdRegOut_OutputPort[port].setObjName(portName); + this->m_cmdRegOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -751,21 +623,13 @@ void ActiveSyncProductsComponentBase :: this->m_cmdResponseOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdResponseOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdResponseOut_OutputPort[port].setObjName(portName); + this->m_cmdResponseOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -778,21 +642,13 @@ void ActiveSyncProductsComponentBase :: this->m_eventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_eventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_eventOut_OutputPort[port].setObjName(portName); + this->m_eventOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -805,21 +661,13 @@ void ActiveSyncProductsComponentBase :: this->m_prmGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmGetOut_OutputPort[port].setObjName(portName); + this->m_prmGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -832,21 +680,13 @@ void ActiveSyncProductsComponentBase :: this->m_prmSetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmSetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmSetOut_OutputPort[port].setObjName(portName); + this->m_prmSetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -859,21 +699,13 @@ void ActiveSyncProductsComponentBase :: this->m_productRequestOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_productRequestOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_productRequestOut_OutputPort[port].setObjName(portName); + this->m_productRequestOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -886,21 +718,13 @@ void ActiveSyncProductsComponentBase :: this->m_productSendOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_productSendOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_productSendOut_OutputPort[port].setObjName(portName); + this->m_productSendOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -914,21 +738,13 @@ void ActiveSyncProductsComponentBase :: this->m_textEventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_textEventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_textEventOut_OutputPort[port].setObjName(portName); + this->m_textEventOut_OutputPort[port].setObjName(portName.toChar()); #endif } #endif @@ -942,21 +758,13 @@ void ActiveSyncProductsComponentBase :: this->m_timeGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_timeGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_timeGetOut_OutputPort[port].setObjName(portName); + this->m_timeGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -969,21 +777,13 @@ void ActiveSyncProductsComponentBase :: this->m_tlmOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_tlmOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_tlmOut_OutputPort[port].setObjName(portName); + this->m_tlmOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -996,21 +796,13 @@ void ActiveSyncProductsComponentBase :: this->m_noArgsOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsOut_OutputPort[port].setObjName(portName); + this->m_noArgsOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -1023,21 +815,13 @@ void ActiveSyncProductsComponentBase :: this->m_noArgsReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnOut_OutputPort[port].setObjName(portName); + this->m_noArgsReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -1050,21 +834,13 @@ void ActiveSyncProductsComponentBase :: this->m_typedOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedOut_OutputPort[port].setObjName(portName); + this->m_typedOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -1077,21 +853,13 @@ void ActiveSyncProductsComponentBase :: this->m_typedReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnOut_OutputPort[port].setObjName(portName); + this->m_typedReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } diff --git a/compiler/tools/fpp-to-cpp/test/component/base/ActiveTelemetryComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/ActiveTelemetryComponentAc.ref.cpp index 47294c1f9..fff232bf0 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/ActiveTelemetryComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/ActiveTelemetryComponentAc.ref.cpp @@ -94,21 +94,13 @@ void ActiveTelemetryComponentBase :: this->m_cmdIn_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdIn_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdIn_InputPort[port].setObjName(portName); + this->m_cmdIn_InputPort[port].setObjName(portName.toChar()); #endif } @@ -126,21 +118,13 @@ void ActiveTelemetryComponentBase :: this->m_noArgsAsync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsAsync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsAsync_InputPort[port].setObjName(portName); + this->m_noArgsAsync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -158,21 +142,13 @@ void ActiveTelemetryComponentBase :: this->m_noArgsGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsGuarded_InputPort[port].setObjName(portName); + this->m_noArgsGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -190,21 +166,13 @@ void ActiveTelemetryComponentBase :: this->m_noArgsReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName); + this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -222,21 +190,13 @@ void ActiveTelemetryComponentBase :: this->m_noArgsReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnSync_InputPort[port].setObjName(portName); + this->m_noArgsReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -254,21 +214,13 @@ void ActiveTelemetryComponentBase :: this->m_noArgsSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsSync_InputPort[port].setObjName(portName); + this->m_noArgsSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -286,21 +238,13 @@ void ActiveTelemetryComponentBase :: this->m_typedAsync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsync_InputPort[port].setObjName(portName); + this->m_typedAsync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -318,21 +262,13 @@ void ActiveTelemetryComponentBase :: this->m_typedAsyncAssert_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncAssert_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncAssert_InputPort[port].setObjName(portName); + this->m_typedAsyncAssert_InputPort[port].setObjName(portName.toChar()); #endif } @@ -350,21 +286,13 @@ void ActiveTelemetryComponentBase :: this->m_typedAsyncBlockPriority_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncBlockPriority_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncBlockPriority_InputPort[port].setObjName(portName); + this->m_typedAsyncBlockPriority_InputPort[port].setObjName(portName.toChar()); #endif } @@ -382,21 +310,13 @@ void ActiveTelemetryComponentBase :: this->m_typedAsyncDropPriority_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncDropPriority_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncDropPriority_InputPort[port].setObjName(portName); + this->m_typedAsyncDropPriority_InputPort[port].setObjName(portName.toChar()); #endif } @@ -414,21 +334,13 @@ void ActiveTelemetryComponentBase :: this->m_typedGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedGuarded_InputPort[port].setObjName(portName); + this->m_typedGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -446,21 +358,13 @@ void ActiveTelemetryComponentBase :: this->m_typedReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnGuarded_InputPort[port].setObjName(portName); + this->m_typedReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -478,21 +382,13 @@ void ActiveTelemetryComponentBase :: this->m_typedReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnSync_InputPort[port].setObjName(portName); + this->m_typedReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -510,21 +406,13 @@ void ActiveTelemetryComponentBase :: this->m_typedSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedSync_InputPort[port].setObjName(portName); + this->m_typedSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -537,21 +425,13 @@ void ActiveTelemetryComponentBase :: this->m_cmdRegOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdRegOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdRegOut_OutputPort[port].setObjName(portName); + this->m_cmdRegOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -564,21 +444,13 @@ void ActiveTelemetryComponentBase :: this->m_cmdResponseOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdResponseOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdResponseOut_OutputPort[port].setObjName(portName); + this->m_cmdResponseOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -591,21 +463,13 @@ void ActiveTelemetryComponentBase :: this->m_eventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_eventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_eventOut_OutputPort[port].setObjName(portName); + this->m_eventOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -618,21 +482,13 @@ void ActiveTelemetryComponentBase :: this->m_prmGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmGetOut_OutputPort[port].setObjName(portName); + this->m_prmGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -645,21 +501,13 @@ void ActiveTelemetryComponentBase :: this->m_prmSetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmSetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmSetOut_OutputPort[port].setObjName(portName); + this->m_prmSetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -673,21 +521,13 @@ void ActiveTelemetryComponentBase :: this->m_textEventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_textEventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_textEventOut_OutputPort[port].setObjName(portName); + this->m_textEventOut_OutputPort[port].setObjName(portName.toChar()); #endif } #endif @@ -701,21 +541,13 @@ void ActiveTelemetryComponentBase :: this->m_timeGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_timeGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_timeGetOut_OutputPort[port].setObjName(portName); + this->m_timeGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -728,21 +560,13 @@ void ActiveTelemetryComponentBase :: this->m_tlmOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_tlmOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_tlmOut_OutputPort[port].setObjName(portName); + this->m_tlmOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -755,21 +579,13 @@ void ActiveTelemetryComponentBase :: this->m_noArgsOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsOut_OutputPort[port].setObjName(portName); + this->m_noArgsOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -782,21 +598,13 @@ void ActiveTelemetryComponentBase :: this->m_noArgsReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnOut_OutputPort[port].setObjName(portName); + this->m_noArgsReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -809,21 +617,13 @@ void ActiveTelemetryComponentBase :: this->m_typedOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedOut_OutputPort[port].setObjName(portName); + this->m_typedOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -836,21 +636,13 @@ void ActiveTelemetryComponentBase :: this->m_typedReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnOut_OutputPort[port].setObjName(portName); + this->m_typedReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } diff --git a/compiler/tools/fpp-to-cpp/test/component/base/ActiveTestComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/ActiveTestComponentAc.ref.cpp index 6ec8e7bec..59f7de008 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/ActiveTestComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/ActiveTestComponentAc.ref.cpp @@ -287,21 +287,13 @@ namespace M { this->m_cmdIn_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdIn_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdIn_InputPort[port].setObjName(portName); + this->m_cmdIn_InputPort[port].setObjName(portName.toChar()); #endif } @@ -319,21 +311,13 @@ namespace M { this->m_productRecvIn_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_productRecvIn_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_productRecvIn_InputPort[port].setObjName(portName); + this->m_productRecvIn_InputPort[port].setObjName(portName.toChar()); #endif } @@ -351,21 +335,13 @@ namespace M { this->m_noArgsAsync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsAsync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsAsync_InputPort[port].setObjName(portName); + this->m_noArgsAsync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -383,21 +359,13 @@ namespace M { this->m_noArgsGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsGuarded_InputPort[port].setObjName(portName); + this->m_noArgsGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -415,21 +383,13 @@ namespace M { this->m_noArgsReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName); + this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -447,21 +407,13 @@ namespace M { this->m_noArgsReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnSync_InputPort[port].setObjName(portName); + this->m_noArgsReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -479,21 +431,13 @@ namespace M { this->m_noArgsSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsSync_InputPort[port].setObjName(portName); + this->m_noArgsSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -511,21 +455,13 @@ namespace M { this->m_typedAsync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsync_InputPort[port].setObjName(portName); + this->m_typedAsync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -543,21 +479,13 @@ namespace M { this->m_typedAsyncAssert_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncAssert_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncAssert_InputPort[port].setObjName(portName); + this->m_typedAsyncAssert_InputPort[port].setObjName(portName.toChar()); #endif } @@ -575,21 +503,13 @@ namespace M { this->m_typedAsyncBlockPriority_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncBlockPriority_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncBlockPriority_InputPort[port].setObjName(portName); + this->m_typedAsyncBlockPriority_InputPort[port].setObjName(portName.toChar()); #endif } @@ -607,21 +527,13 @@ namespace M { this->m_typedAsyncDropPriority_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncDropPriority_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncDropPriority_InputPort[port].setObjName(portName); + this->m_typedAsyncDropPriority_InputPort[port].setObjName(portName.toChar()); #endif } @@ -639,21 +551,13 @@ namespace M { this->m_typedGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedGuarded_InputPort[port].setObjName(portName); + this->m_typedGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -671,21 +575,13 @@ namespace M { this->m_typedReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnGuarded_InputPort[port].setObjName(portName); + this->m_typedReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -703,21 +599,13 @@ namespace M { this->m_typedReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnSync_InputPort[port].setObjName(portName); + this->m_typedReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -735,21 +623,13 @@ namespace M { this->m_typedSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedSync_InputPort[port].setObjName(portName); + this->m_typedSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -762,21 +642,13 @@ namespace M { this->m_cmdRegOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdRegOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdRegOut_OutputPort[port].setObjName(portName); + this->m_cmdRegOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -789,21 +661,13 @@ namespace M { this->m_cmdResponseOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdResponseOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdResponseOut_OutputPort[port].setObjName(portName); + this->m_cmdResponseOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -816,21 +680,13 @@ namespace M { this->m_eventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_eventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_eventOut_OutputPort[port].setObjName(portName); + this->m_eventOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -843,21 +699,13 @@ namespace M { this->m_prmGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmGetOut_OutputPort[port].setObjName(portName); + this->m_prmGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -870,21 +718,13 @@ namespace M { this->m_prmSetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmSetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmSetOut_OutputPort[port].setObjName(portName); + this->m_prmSetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -897,21 +737,13 @@ namespace M { this->m_productRequestOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_productRequestOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_productRequestOut_OutputPort[port].setObjName(portName); + this->m_productRequestOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -924,21 +756,13 @@ namespace M { this->m_productSendOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_productSendOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_productSendOut_OutputPort[port].setObjName(portName); + this->m_productSendOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -952,21 +776,13 @@ namespace M { this->m_textEventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_textEventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_textEventOut_OutputPort[port].setObjName(portName); + this->m_textEventOut_OutputPort[port].setObjName(portName.toChar()); #endif } #endif @@ -980,21 +796,13 @@ namespace M { this->m_timeGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_timeGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_timeGetOut_OutputPort[port].setObjName(portName); + this->m_timeGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -1007,21 +815,13 @@ namespace M { this->m_tlmOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_tlmOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_tlmOut_OutputPort[port].setObjName(portName); + this->m_tlmOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -1034,21 +834,13 @@ namespace M { this->m_noArgsOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsOut_OutputPort[port].setObjName(portName); + this->m_noArgsOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -1061,21 +853,13 @@ namespace M { this->m_noArgsReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnOut_OutputPort[port].setObjName(portName); + this->m_noArgsReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -1088,21 +872,13 @@ namespace M { this->m_typedOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedOut_OutputPort[port].setObjName(portName); + this->m_typedOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -1115,21 +891,13 @@ namespace M { this->m_typedReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnOut_OutputPort[port].setObjName(portName); + this->m_typedReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -4696,7 +4464,7 @@ namespace M { FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventActivityHigh " ); @@ -4827,7 +4595,7 @@ namespace M { FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventActivityLowThrottled ", u32, @@ -4916,7 +4684,7 @@ namespace M { FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventCommand ", str1.toChar(), @@ -5008,7 +4776,7 @@ namespace M { FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventDiagnostic ", eStr.toChar() @@ -5120,7 +4888,7 @@ namespace M { FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventFatalThrottled ", aStr.toChar() @@ -5211,7 +4979,7 @@ namespace M { FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventWarningHigh ", sStr.toChar() @@ -5291,7 +5059,7 @@ namespace M { FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventWarningLowThrottled " ); diff --git a/compiler/tools/fpp-to-cpp/test/component/base/PassiveCommandsComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/PassiveCommandsComponentAc.ref.cpp index 640ef2b82..f069dfa77 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/PassiveCommandsComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/PassiveCommandsComponentAc.ref.cpp @@ -36,21 +36,13 @@ void PassiveCommandsComponentBase :: this->m_cmdIn_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdIn_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdIn_InputPort[port].setObjName(portName); + this->m_cmdIn_InputPort[port].setObjName(portName.toChar()); #endif } @@ -68,21 +60,13 @@ void PassiveCommandsComponentBase :: this->m_noArgsGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsGuarded_InputPort[port].setObjName(portName); + this->m_noArgsGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -100,21 +84,13 @@ void PassiveCommandsComponentBase :: this->m_noArgsReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName); + this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -132,21 +108,13 @@ void PassiveCommandsComponentBase :: this->m_noArgsReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnSync_InputPort[port].setObjName(portName); + this->m_noArgsReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -164,21 +132,13 @@ void PassiveCommandsComponentBase :: this->m_noArgsSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsSync_InputPort[port].setObjName(portName); + this->m_noArgsSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -196,21 +156,13 @@ void PassiveCommandsComponentBase :: this->m_typedGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedGuarded_InputPort[port].setObjName(portName); + this->m_typedGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -228,21 +180,13 @@ void PassiveCommandsComponentBase :: this->m_typedReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnGuarded_InputPort[port].setObjName(portName); + this->m_typedReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -260,21 +204,13 @@ void PassiveCommandsComponentBase :: this->m_typedReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnSync_InputPort[port].setObjName(portName); + this->m_typedReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -292,21 +228,13 @@ void PassiveCommandsComponentBase :: this->m_typedSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedSync_InputPort[port].setObjName(portName); + this->m_typedSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -319,21 +247,13 @@ void PassiveCommandsComponentBase :: this->m_cmdRegOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdRegOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdRegOut_OutputPort[port].setObjName(portName); + this->m_cmdRegOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -346,21 +266,13 @@ void PassiveCommandsComponentBase :: this->m_cmdResponseOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdResponseOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdResponseOut_OutputPort[port].setObjName(portName); + this->m_cmdResponseOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -373,21 +285,13 @@ void PassiveCommandsComponentBase :: this->m_eventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_eventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_eventOut_OutputPort[port].setObjName(portName); + this->m_eventOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -400,21 +304,13 @@ void PassiveCommandsComponentBase :: this->m_prmGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmGetOut_OutputPort[port].setObjName(portName); + this->m_prmGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -427,21 +323,13 @@ void PassiveCommandsComponentBase :: this->m_prmSetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmSetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmSetOut_OutputPort[port].setObjName(portName); + this->m_prmSetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -455,21 +343,13 @@ void PassiveCommandsComponentBase :: this->m_textEventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_textEventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_textEventOut_OutputPort[port].setObjName(portName); + this->m_textEventOut_OutputPort[port].setObjName(portName.toChar()); #endif } #endif @@ -483,21 +363,13 @@ void PassiveCommandsComponentBase :: this->m_timeGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_timeGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_timeGetOut_OutputPort[port].setObjName(portName); + this->m_timeGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -510,21 +382,13 @@ void PassiveCommandsComponentBase :: this->m_tlmOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_tlmOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_tlmOut_OutputPort[port].setObjName(portName); + this->m_tlmOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -537,21 +401,13 @@ void PassiveCommandsComponentBase :: this->m_noArgsOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsOut_OutputPort[port].setObjName(portName); + this->m_noArgsOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -564,21 +420,13 @@ void PassiveCommandsComponentBase :: this->m_noArgsReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnOut_OutputPort[port].setObjName(portName); + this->m_noArgsReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -591,21 +439,13 @@ void PassiveCommandsComponentBase :: this->m_typedOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedOut_OutputPort[port].setObjName(portName); + this->m_typedOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -618,21 +458,13 @@ void PassiveCommandsComponentBase :: this->m_typedReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnOut_OutputPort[port].setObjName(portName); + this->m_typedReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } } diff --git a/compiler/tools/fpp-to-cpp/test/component/base/PassiveEventsComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/PassiveEventsComponentAc.ref.cpp index e0401def1..fe2252b26 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/PassiveEventsComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/PassiveEventsComponentAc.ref.cpp @@ -36,21 +36,13 @@ void PassiveEventsComponentBase :: this->m_cmdIn_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdIn_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdIn_InputPort[port].setObjName(portName); + this->m_cmdIn_InputPort[port].setObjName(portName.toChar()); #endif } @@ -68,21 +60,13 @@ void PassiveEventsComponentBase :: this->m_noArgsGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsGuarded_InputPort[port].setObjName(portName); + this->m_noArgsGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -100,21 +84,13 @@ void PassiveEventsComponentBase :: this->m_noArgsReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName); + this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -132,21 +108,13 @@ void PassiveEventsComponentBase :: this->m_noArgsReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnSync_InputPort[port].setObjName(portName); + this->m_noArgsReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -164,21 +132,13 @@ void PassiveEventsComponentBase :: this->m_noArgsSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsSync_InputPort[port].setObjName(portName); + this->m_noArgsSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -196,21 +156,13 @@ void PassiveEventsComponentBase :: this->m_typedGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedGuarded_InputPort[port].setObjName(portName); + this->m_typedGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -228,21 +180,13 @@ void PassiveEventsComponentBase :: this->m_typedReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnGuarded_InputPort[port].setObjName(portName); + this->m_typedReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -260,21 +204,13 @@ void PassiveEventsComponentBase :: this->m_typedReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnSync_InputPort[port].setObjName(portName); + this->m_typedReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -292,21 +228,13 @@ void PassiveEventsComponentBase :: this->m_typedSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedSync_InputPort[port].setObjName(portName); + this->m_typedSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -319,21 +247,13 @@ void PassiveEventsComponentBase :: this->m_cmdRegOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdRegOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdRegOut_OutputPort[port].setObjName(portName); + this->m_cmdRegOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -346,21 +266,13 @@ void PassiveEventsComponentBase :: this->m_cmdResponseOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdResponseOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdResponseOut_OutputPort[port].setObjName(portName); + this->m_cmdResponseOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -373,21 +285,13 @@ void PassiveEventsComponentBase :: this->m_eventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_eventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_eventOut_OutputPort[port].setObjName(portName); + this->m_eventOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -400,21 +304,13 @@ void PassiveEventsComponentBase :: this->m_prmGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmGetOut_OutputPort[port].setObjName(portName); + this->m_prmGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -427,21 +323,13 @@ void PassiveEventsComponentBase :: this->m_prmSetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmSetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmSetOut_OutputPort[port].setObjName(portName); + this->m_prmSetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -455,21 +343,13 @@ void PassiveEventsComponentBase :: this->m_textEventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_textEventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_textEventOut_OutputPort[port].setObjName(portName); + this->m_textEventOut_OutputPort[port].setObjName(portName.toChar()); #endif } #endif @@ -483,21 +363,13 @@ void PassiveEventsComponentBase :: this->m_timeGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_timeGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_timeGetOut_OutputPort[port].setObjName(portName); + this->m_timeGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -510,21 +382,13 @@ void PassiveEventsComponentBase :: this->m_tlmOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_tlmOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_tlmOut_OutputPort[port].setObjName(portName); + this->m_tlmOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -537,21 +401,13 @@ void PassiveEventsComponentBase :: this->m_noArgsOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsOut_OutputPort[port].setObjName(portName); + this->m_noArgsOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -564,21 +420,13 @@ void PassiveEventsComponentBase :: this->m_noArgsReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnOut_OutputPort[port].setObjName(portName); + this->m_noArgsReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -591,21 +439,13 @@ void PassiveEventsComponentBase :: this->m_typedOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedOut_OutputPort[port].setObjName(portName); + this->m_typedOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -618,21 +458,13 @@ void PassiveEventsComponentBase :: this->m_typedReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnOut_OutputPort[port].setObjName(portName); + this->m_typedReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } } @@ -1736,7 +1568,7 @@ void PassiveEventsComponentBase :: FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventActivityHigh " ); @@ -1867,7 +1699,7 @@ void PassiveEventsComponentBase :: FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventActivityLowThrottled ", u32, @@ -1956,7 +1788,7 @@ void PassiveEventsComponentBase :: FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventCommand ", str1.toChar(), @@ -2048,7 +1880,7 @@ void PassiveEventsComponentBase :: FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventDiagnostic ", eStr.toChar() @@ -2160,7 +1992,7 @@ void PassiveEventsComponentBase :: FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventFatalThrottled ", aStr.toChar() @@ -2251,7 +2083,7 @@ void PassiveEventsComponentBase :: FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventWarningHigh ", sStr.toChar() @@ -2331,7 +2163,7 @@ void PassiveEventsComponentBase :: FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventWarningLowThrottled " ); diff --git a/compiler/tools/fpp-to-cpp/test/component/base/PassiveGetProductPortsOnlyComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/PassiveGetProductPortsOnlyComponentAc.ref.cpp index 3ea6647d8..c90e4f24e 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/PassiveGetProductPortsOnlyComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/PassiveGetProductPortsOnlyComponentAc.ref.cpp @@ -31,21 +31,13 @@ void PassiveGetProductPortsOnlyComponentBase :: this->m_productGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_productGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_productGetOut_OutputPort[port].setObjName(portName); + this->m_productGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -58,21 +50,13 @@ void PassiveGetProductPortsOnlyComponentBase :: this->m_productSendOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_productSendOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_productSendOut_OutputPort[port].setObjName(portName); + this->m_productSendOut_OutputPort[port].setObjName(portName.toChar()); #endif } } diff --git a/compiler/tools/fpp-to-cpp/test/component/base/PassiveGetProductsComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/PassiveGetProductsComponentAc.ref.cpp index 8535ed6b5..1ec13f31c 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/PassiveGetProductsComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/PassiveGetProductsComponentAc.ref.cpp @@ -191,21 +191,13 @@ void PassiveGetProductsComponentBase :: this->m_cmdIn_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdIn_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdIn_InputPort[port].setObjName(portName); + this->m_cmdIn_InputPort[port].setObjName(portName.toChar()); #endif } @@ -223,21 +215,13 @@ void PassiveGetProductsComponentBase :: this->m_noArgsGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsGuarded_InputPort[port].setObjName(portName); + this->m_noArgsGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -255,21 +239,13 @@ void PassiveGetProductsComponentBase :: this->m_noArgsReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName); + this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -287,21 +263,13 @@ void PassiveGetProductsComponentBase :: this->m_noArgsReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnSync_InputPort[port].setObjName(portName); + this->m_noArgsReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -319,21 +287,13 @@ void PassiveGetProductsComponentBase :: this->m_noArgsSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsSync_InputPort[port].setObjName(portName); + this->m_noArgsSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -351,21 +311,13 @@ void PassiveGetProductsComponentBase :: this->m_typedGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedGuarded_InputPort[port].setObjName(portName); + this->m_typedGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -383,21 +335,13 @@ void PassiveGetProductsComponentBase :: this->m_typedReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnGuarded_InputPort[port].setObjName(portName); + this->m_typedReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -415,21 +359,13 @@ void PassiveGetProductsComponentBase :: this->m_typedReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnSync_InputPort[port].setObjName(portName); + this->m_typedReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -447,21 +383,13 @@ void PassiveGetProductsComponentBase :: this->m_typedSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedSync_InputPort[port].setObjName(portName); + this->m_typedSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -474,21 +402,13 @@ void PassiveGetProductsComponentBase :: this->m_cmdRegOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdRegOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdRegOut_OutputPort[port].setObjName(portName); + this->m_cmdRegOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -501,21 +421,13 @@ void PassiveGetProductsComponentBase :: this->m_cmdResponseOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdResponseOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdResponseOut_OutputPort[port].setObjName(portName); + this->m_cmdResponseOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -528,21 +440,13 @@ void PassiveGetProductsComponentBase :: this->m_eventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_eventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_eventOut_OutputPort[port].setObjName(portName); + this->m_eventOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -555,21 +459,13 @@ void PassiveGetProductsComponentBase :: this->m_prmGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmGetOut_OutputPort[port].setObjName(portName); + this->m_prmGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -582,21 +478,13 @@ void PassiveGetProductsComponentBase :: this->m_prmSetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmSetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmSetOut_OutputPort[port].setObjName(portName); + this->m_prmSetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -609,21 +497,13 @@ void PassiveGetProductsComponentBase :: this->m_productGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_productGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_productGetOut_OutputPort[port].setObjName(portName); + this->m_productGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -636,21 +516,13 @@ void PassiveGetProductsComponentBase :: this->m_productSendOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_productSendOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_productSendOut_OutputPort[port].setObjName(portName); + this->m_productSendOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -664,21 +536,13 @@ void PassiveGetProductsComponentBase :: this->m_textEventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_textEventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_textEventOut_OutputPort[port].setObjName(portName); + this->m_textEventOut_OutputPort[port].setObjName(portName.toChar()); #endif } #endif @@ -692,21 +556,13 @@ void PassiveGetProductsComponentBase :: this->m_timeGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_timeGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_timeGetOut_OutputPort[port].setObjName(portName); + this->m_timeGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -719,21 +575,13 @@ void PassiveGetProductsComponentBase :: this->m_tlmOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_tlmOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_tlmOut_OutputPort[port].setObjName(portName); + this->m_tlmOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -746,21 +594,13 @@ void PassiveGetProductsComponentBase :: this->m_noArgsOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsOut_OutputPort[port].setObjName(portName); + this->m_noArgsOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -773,21 +613,13 @@ void PassiveGetProductsComponentBase :: this->m_noArgsReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnOut_OutputPort[port].setObjName(portName); + this->m_noArgsReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -800,21 +632,13 @@ void PassiveGetProductsComponentBase :: this->m_typedOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedOut_OutputPort[port].setObjName(portName); + this->m_typedOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -827,21 +651,13 @@ void PassiveGetProductsComponentBase :: this->m_typedReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnOut_OutputPort[port].setObjName(portName); + this->m_typedReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } } diff --git a/compiler/tools/fpp-to-cpp/test/component/base/PassiveGuardedProductsComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/PassiveGuardedProductsComponentAc.ref.cpp index 05b931fe2..468359b0f 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/PassiveGuardedProductsComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/PassiveGuardedProductsComponentAc.ref.cpp @@ -191,21 +191,13 @@ void PassiveGuardedProductsComponentBase :: this->m_cmdIn_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdIn_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdIn_InputPort[port].setObjName(portName); + this->m_cmdIn_InputPort[port].setObjName(portName.toChar()); #endif } @@ -223,21 +215,13 @@ void PassiveGuardedProductsComponentBase :: this->m_productRecvIn_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_productRecvIn_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_productRecvIn_InputPort[port].setObjName(portName); + this->m_productRecvIn_InputPort[port].setObjName(portName.toChar()); #endif } @@ -255,21 +239,13 @@ void PassiveGuardedProductsComponentBase :: this->m_noArgsGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsGuarded_InputPort[port].setObjName(portName); + this->m_noArgsGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -287,21 +263,13 @@ void PassiveGuardedProductsComponentBase :: this->m_noArgsReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName); + this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -319,21 +287,13 @@ void PassiveGuardedProductsComponentBase :: this->m_noArgsReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnSync_InputPort[port].setObjName(portName); + this->m_noArgsReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -351,21 +311,13 @@ void PassiveGuardedProductsComponentBase :: this->m_noArgsSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsSync_InputPort[port].setObjName(portName); + this->m_noArgsSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -383,21 +335,13 @@ void PassiveGuardedProductsComponentBase :: this->m_typedGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedGuarded_InputPort[port].setObjName(portName); + this->m_typedGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -415,21 +359,13 @@ void PassiveGuardedProductsComponentBase :: this->m_typedReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnGuarded_InputPort[port].setObjName(portName); + this->m_typedReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -447,21 +383,13 @@ void PassiveGuardedProductsComponentBase :: this->m_typedReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnSync_InputPort[port].setObjName(portName); + this->m_typedReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -479,21 +407,13 @@ void PassiveGuardedProductsComponentBase :: this->m_typedSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedSync_InputPort[port].setObjName(portName); + this->m_typedSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -506,21 +426,13 @@ void PassiveGuardedProductsComponentBase :: this->m_cmdRegOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdRegOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdRegOut_OutputPort[port].setObjName(portName); + this->m_cmdRegOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -533,21 +445,13 @@ void PassiveGuardedProductsComponentBase :: this->m_cmdResponseOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdResponseOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdResponseOut_OutputPort[port].setObjName(portName); + this->m_cmdResponseOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -560,21 +464,13 @@ void PassiveGuardedProductsComponentBase :: this->m_eventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_eventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_eventOut_OutputPort[port].setObjName(portName); + this->m_eventOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -587,21 +483,13 @@ void PassiveGuardedProductsComponentBase :: this->m_prmGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmGetOut_OutputPort[port].setObjName(portName); + this->m_prmGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -614,21 +502,13 @@ void PassiveGuardedProductsComponentBase :: this->m_prmSetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmSetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmSetOut_OutputPort[port].setObjName(portName); + this->m_prmSetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -641,21 +521,13 @@ void PassiveGuardedProductsComponentBase :: this->m_productRequestOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_productRequestOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_productRequestOut_OutputPort[port].setObjName(portName); + this->m_productRequestOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -668,21 +540,13 @@ void PassiveGuardedProductsComponentBase :: this->m_productSendOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_productSendOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_productSendOut_OutputPort[port].setObjName(portName); + this->m_productSendOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -696,21 +560,13 @@ void PassiveGuardedProductsComponentBase :: this->m_textEventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_textEventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_textEventOut_OutputPort[port].setObjName(portName); + this->m_textEventOut_OutputPort[port].setObjName(portName.toChar()); #endif } #endif @@ -724,21 +580,13 @@ void PassiveGuardedProductsComponentBase :: this->m_timeGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_timeGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_timeGetOut_OutputPort[port].setObjName(portName); + this->m_timeGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -751,21 +599,13 @@ void PassiveGuardedProductsComponentBase :: this->m_tlmOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_tlmOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_tlmOut_OutputPort[port].setObjName(portName); + this->m_tlmOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -778,21 +618,13 @@ void PassiveGuardedProductsComponentBase :: this->m_noArgsOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsOut_OutputPort[port].setObjName(portName); + this->m_noArgsOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -805,21 +637,13 @@ void PassiveGuardedProductsComponentBase :: this->m_noArgsReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnOut_OutputPort[port].setObjName(portName); + this->m_noArgsReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -832,21 +656,13 @@ void PassiveGuardedProductsComponentBase :: this->m_typedOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedOut_OutputPort[port].setObjName(portName); + this->m_typedOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -859,21 +675,13 @@ void PassiveGuardedProductsComponentBase :: this->m_typedReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnOut_OutputPort[port].setObjName(portName); + this->m_typedReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } } diff --git a/compiler/tools/fpp-to-cpp/test/component/base/PassiveParamsComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/PassiveParamsComponentAc.ref.cpp index 893cb6b6c..ec69bcc2b 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/PassiveParamsComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/PassiveParamsComponentAc.ref.cpp @@ -36,21 +36,13 @@ void PassiveParamsComponentBase :: this->m_cmdIn_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdIn_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdIn_InputPort[port].setObjName(portName); + this->m_cmdIn_InputPort[port].setObjName(portName.toChar()); #endif } @@ -68,21 +60,13 @@ void PassiveParamsComponentBase :: this->m_noArgsGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsGuarded_InputPort[port].setObjName(portName); + this->m_noArgsGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -100,21 +84,13 @@ void PassiveParamsComponentBase :: this->m_noArgsReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName); + this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -132,21 +108,13 @@ void PassiveParamsComponentBase :: this->m_noArgsReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnSync_InputPort[port].setObjName(portName); + this->m_noArgsReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -164,21 +132,13 @@ void PassiveParamsComponentBase :: this->m_noArgsSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsSync_InputPort[port].setObjName(portName); + this->m_noArgsSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -196,21 +156,13 @@ void PassiveParamsComponentBase :: this->m_typedGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedGuarded_InputPort[port].setObjName(portName); + this->m_typedGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -228,21 +180,13 @@ void PassiveParamsComponentBase :: this->m_typedReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnGuarded_InputPort[port].setObjName(portName); + this->m_typedReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -260,21 +204,13 @@ void PassiveParamsComponentBase :: this->m_typedReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnSync_InputPort[port].setObjName(portName); + this->m_typedReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -292,21 +228,13 @@ void PassiveParamsComponentBase :: this->m_typedSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedSync_InputPort[port].setObjName(portName); + this->m_typedSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -319,21 +247,13 @@ void PassiveParamsComponentBase :: this->m_cmdRegOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdRegOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdRegOut_OutputPort[port].setObjName(portName); + this->m_cmdRegOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -346,21 +266,13 @@ void PassiveParamsComponentBase :: this->m_cmdResponseOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdResponseOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdResponseOut_OutputPort[port].setObjName(portName); + this->m_cmdResponseOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -373,21 +285,13 @@ void PassiveParamsComponentBase :: this->m_eventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_eventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_eventOut_OutputPort[port].setObjName(portName); + this->m_eventOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -400,21 +304,13 @@ void PassiveParamsComponentBase :: this->m_prmGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmGetOut_OutputPort[port].setObjName(portName); + this->m_prmGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -427,21 +323,13 @@ void PassiveParamsComponentBase :: this->m_prmSetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmSetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmSetOut_OutputPort[port].setObjName(portName); + this->m_prmSetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -455,21 +343,13 @@ void PassiveParamsComponentBase :: this->m_textEventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_textEventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_textEventOut_OutputPort[port].setObjName(portName); + this->m_textEventOut_OutputPort[port].setObjName(portName.toChar()); #endif } #endif @@ -483,21 +363,13 @@ void PassiveParamsComponentBase :: this->m_timeGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_timeGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_timeGetOut_OutputPort[port].setObjName(portName); + this->m_timeGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -510,21 +382,13 @@ void PassiveParamsComponentBase :: this->m_tlmOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_tlmOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_tlmOut_OutputPort[port].setObjName(portName); + this->m_tlmOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -537,21 +401,13 @@ void PassiveParamsComponentBase :: this->m_noArgsOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsOut_OutputPort[port].setObjName(portName); + this->m_noArgsOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -564,21 +420,13 @@ void PassiveParamsComponentBase :: this->m_noArgsReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnOut_OutputPort[port].setObjName(portName); + this->m_noArgsReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -591,21 +439,13 @@ void PassiveParamsComponentBase :: this->m_typedOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedOut_OutputPort[port].setObjName(portName); + this->m_typedOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -618,21 +458,13 @@ void PassiveParamsComponentBase :: this->m_typedReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnOut_OutputPort[port].setObjName(portName); + this->m_typedReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } } diff --git a/compiler/tools/fpp-to-cpp/test/component/base/PassiveSerialComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/PassiveSerialComponentAc.ref.cpp index 02b8a3a58..0ff7380ca 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/PassiveSerialComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/PassiveSerialComponentAc.ref.cpp @@ -36,21 +36,13 @@ void PassiveSerialComponentBase :: this->m_cmdIn_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdIn_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdIn_InputPort[port].setObjName(portName); + this->m_cmdIn_InputPort[port].setObjName(portName.toChar()); #endif } @@ -68,21 +60,13 @@ void PassiveSerialComponentBase :: this->m_noArgsGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsGuarded_InputPort[port].setObjName(portName); + this->m_noArgsGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -100,21 +84,13 @@ void PassiveSerialComponentBase :: this->m_noArgsReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName); + this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -132,21 +108,13 @@ void PassiveSerialComponentBase :: this->m_noArgsReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnSync_InputPort[port].setObjName(portName); + this->m_noArgsReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -164,21 +132,13 @@ void PassiveSerialComponentBase :: this->m_noArgsSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsSync_InputPort[port].setObjName(portName); + this->m_noArgsSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -196,21 +156,13 @@ void PassiveSerialComponentBase :: this->m_typedGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedGuarded_InputPort[port].setObjName(portName); + this->m_typedGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -228,21 +180,13 @@ void PassiveSerialComponentBase :: this->m_typedReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnGuarded_InputPort[port].setObjName(portName); + this->m_typedReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -260,21 +204,13 @@ void PassiveSerialComponentBase :: this->m_typedReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnSync_InputPort[port].setObjName(portName); + this->m_typedReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -292,21 +228,13 @@ void PassiveSerialComponentBase :: this->m_typedSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedSync_InputPort[port].setObjName(portName); + this->m_typedSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -324,21 +252,13 @@ void PassiveSerialComponentBase :: this->m_serialGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_serialGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_serialGuarded_InputPort[port].setObjName(portName); + this->m_serialGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -356,21 +276,13 @@ void PassiveSerialComponentBase :: this->m_serialSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_serialSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_serialSync_InputPort[port].setObjName(portName); + this->m_serialSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -383,21 +295,13 @@ void PassiveSerialComponentBase :: this->m_cmdRegOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdRegOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdRegOut_OutputPort[port].setObjName(portName); + this->m_cmdRegOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -410,21 +314,13 @@ void PassiveSerialComponentBase :: this->m_cmdResponseOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdResponseOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdResponseOut_OutputPort[port].setObjName(portName); + this->m_cmdResponseOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -437,21 +333,13 @@ void PassiveSerialComponentBase :: this->m_eventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_eventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_eventOut_OutputPort[port].setObjName(portName); + this->m_eventOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -464,21 +352,13 @@ void PassiveSerialComponentBase :: this->m_prmGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmGetOut_OutputPort[port].setObjName(portName); + this->m_prmGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -491,21 +371,13 @@ void PassiveSerialComponentBase :: this->m_prmSetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmSetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmSetOut_OutputPort[port].setObjName(portName); + this->m_prmSetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -519,21 +391,13 @@ void PassiveSerialComponentBase :: this->m_textEventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_textEventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_textEventOut_OutputPort[port].setObjName(portName); + this->m_textEventOut_OutputPort[port].setObjName(portName.toChar()); #endif } #endif @@ -547,21 +411,13 @@ void PassiveSerialComponentBase :: this->m_timeGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_timeGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_timeGetOut_OutputPort[port].setObjName(portName); + this->m_timeGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -574,21 +430,13 @@ void PassiveSerialComponentBase :: this->m_tlmOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_tlmOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_tlmOut_OutputPort[port].setObjName(portName); + this->m_tlmOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -601,21 +449,13 @@ void PassiveSerialComponentBase :: this->m_noArgsOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsOut_OutputPort[port].setObjName(portName); + this->m_noArgsOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -628,21 +468,13 @@ void PassiveSerialComponentBase :: this->m_noArgsReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnOut_OutputPort[port].setObjName(portName); + this->m_noArgsReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -655,21 +487,13 @@ void PassiveSerialComponentBase :: this->m_typedOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedOut_OutputPort[port].setObjName(portName); + this->m_typedOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -682,21 +506,13 @@ void PassiveSerialComponentBase :: this->m_typedReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnOut_OutputPort[port].setObjName(portName); + this->m_typedReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -709,21 +525,13 @@ void PassiveSerialComponentBase :: this->m_serialOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_serialOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_serialOut_OutputPort[port].setObjName(portName); + this->m_serialOut_OutputPort[port].setObjName(portName.toChar()); #endif } } @@ -2929,7 +2737,7 @@ void PassiveSerialComponentBase :: FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventActivityHigh " ); @@ -3060,7 +2868,7 @@ void PassiveSerialComponentBase :: FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventActivityLowThrottled ", u32, @@ -3149,7 +2957,7 @@ void PassiveSerialComponentBase :: FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventCommand ", str1.toChar(), @@ -3241,7 +3049,7 @@ void PassiveSerialComponentBase :: FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventDiagnostic ", eStr.toChar() @@ -3353,7 +3161,7 @@ void PassiveSerialComponentBase :: FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventFatalThrottled ", aStr.toChar() @@ -3444,7 +3252,7 @@ void PassiveSerialComponentBase :: FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventWarningHigh ", sStr.toChar() @@ -3524,7 +3332,7 @@ void PassiveSerialComponentBase :: FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventWarningLowThrottled " ); diff --git a/compiler/tools/fpp-to-cpp/test/component/base/PassiveSyncProductPortsOnlyComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/PassiveSyncProductPortsOnlyComponentAc.ref.cpp index 09c63ccb6..811829fc2 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/PassiveSyncProductPortsOnlyComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/PassiveSyncProductPortsOnlyComponentAc.ref.cpp @@ -36,21 +36,13 @@ void PassiveSyncProductPortsOnlyComponentBase :: this->m_productRecvIn_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_productRecvIn_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_productRecvIn_InputPort[port].setObjName(portName); + this->m_productRecvIn_InputPort[port].setObjName(portName.toChar()); #endif } @@ -63,21 +55,13 @@ void PassiveSyncProductPortsOnlyComponentBase :: this->m_productRequestOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_productRequestOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_productRequestOut_OutputPort[port].setObjName(portName); + this->m_productRequestOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -90,21 +74,13 @@ void PassiveSyncProductPortsOnlyComponentBase :: this->m_productSendOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_productSendOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_productSendOut_OutputPort[port].setObjName(portName); + this->m_productSendOut_OutputPort[port].setObjName(portName.toChar()); #endif } } diff --git a/compiler/tools/fpp-to-cpp/test/component/base/PassiveSyncProductsComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/PassiveSyncProductsComponentAc.ref.cpp index c1b86d2d1..c7bb9e146 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/PassiveSyncProductsComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/PassiveSyncProductsComponentAc.ref.cpp @@ -191,21 +191,13 @@ void PassiveSyncProductsComponentBase :: this->m_cmdIn_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdIn_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdIn_InputPort[port].setObjName(portName); + this->m_cmdIn_InputPort[port].setObjName(portName.toChar()); #endif } @@ -223,21 +215,13 @@ void PassiveSyncProductsComponentBase :: this->m_productRecvIn_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_productRecvIn_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_productRecvIn_InputPort[port].setObjName(portName); + this->m_productRecvIn_InputPort[port].setObjName(portName.toChar()); #endif } @@ -255,21 +239,13 @@ void PassiveSyncProductsComponentBase :: this->m_noArgsGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsGuarded_InputPort[port].setObjName(portName); + this->m_noArgsGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -287,21 +263,13 @@ void PassiveSyncProductsComponentBase :: this->m_noArgsReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName); + this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -319,21 +287,13 @@ void PassiveSyncProductsComponentBase :: this->m_noArgsReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnSync_InputPort[port].setObjName(portName); + this->m_noArgsReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -351,21 +311,13 @@ void PassiveSyncProductsComponentBase :: this->m_noArgsSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsSync_InputPort[port].setObjName(portName); + this->m_noArgsSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -383,21 +335,13 @@ void PassiveSyncProductsComponentBase :: this->m_typedGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedGuarded_InputPort[port].setObjName(portName); + this->m_typedGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -415,21 +359,13 @@ void PassiveSyncProductsComponentBase :: this->m_typedReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnGuarded_InputPort[port].setObjName(portName); + this->m_typedReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -447,21 +383,13 @@ void PassiveSyncProductsComponentBase :: this->m_typedReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnSync_InputPort[port].setObjName(portName); + this->m_typedReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -479,21 +407,13 @@ void PassiveSyncProductsComponentBase :: this->m_typedSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedSync_InputPort[port].setObjName(portName); + this->m_typedSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -506,21 +426,13 @@ void PassiveSyncProductsComponentBase :: this->m_cmdRegOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdRegOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdRegOut_OutputPort[port].setObjName(portName); + this->m_cmdRegOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -533,21 +445,13 @@ void PassiveSyncProductsComponentBase :: this->m_cmdResponseOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdResponseOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdResponseOut_OutputPort[port].setObjName(portName); + this->m_cmdResponseOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -560,21 +464,13 @@ void PassiveSyncProductsComponentBase :: this->m_eventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_eventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_eventOut_OutputPort[port].setObjName(portName); + this->m_eventOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -587,21 +483,13 @@ void PassiveSyncProductsComponentBase :: this->m_prmGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmGetOut_OutputPort[port].setObjName(portName); + this->m_prmGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -614,21 +502,13 @@ void PassiveSyncProductsComponentBase :: this->m_prmSetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmSetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmSetOut_OutputPort[port].setObjName(portName); + this->m_prmSetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -641,21 +521,13 @@ void PassiveSyncProductsComponentBase :: this->m_productRequestOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_productRequestOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_productRequestOut_OutputPort[port].setObjName(portName); + this->m_productRequestOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -668,21 +540,13 @@ void PassiveSyncProductsComponentBase :: this->m_productSendOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_productSendOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_productSendOut_OutputPort[port].setObjName(portName); + this->m_productSendOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -696,21 +560,13 @@ void PassiveSyncProductsComponentBase :: this->m_textEventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_textEventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_textEventOut_OutputPort[port].setObjName(portName); + this->m_textEventOut_OutputPort[port].setObjName(portName.toChar()); #endif } #endif @@ -724,21 +580,13 @@ void PassiveSyncProductsComponentBase :: this->m_timeGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_timeGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_timeGetOut_OutputPort[port].setObjName(portName); + this->m_timeGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -751,21 +599,13 @@ void PassiveSyncProductsComponentBase :: this->m_tlmOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_tlmOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_tlmOut_OutputPort[port].setObjName(portName); + this->m_tlmOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -778,21 +618,13 @@ void PassiveSyncProductsComponentBase :: this->m_noArgsOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsOut_OutputPort[port].setObjName(portName); + this->m_noArgsOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -805,21 +637,13 @@ void PassiveSyncProductsComponentBase :: this->m_noArgsReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnOut_OutputPort[port].setObjName(portName); + this->m_noArgsReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -832,21 +656,13 @@ void PassiveSyncProductsComponentBase :: this->m_typedOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedOut_OutputPort[port].setObjName(portName); + this->m_typedOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -859,21 +675,13 @@ void PassiveSyncProductsComponentBase :: this->m_typedReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnOut_OutputPort[port].setObjName(portName); + this->m_typedReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } } diff --git a/compiler/tools/fpp-to-cpp/test/component/base/PassiveTelemetryComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/PassiveTelemetryComponentAc.ref.cpp index 0fcf0d6f2..286e5c6b8 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/PassiveTelemetryComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/PassiveTelemetryComponentAc.ref.cpp @@ -36,21 +36,13 @@ void PassiveTelemetryComponentBase :: this->m_cmdIn_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdIn_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdIn_InputPort[port].setObjName(portName); + this->m_cmdIn_InputPort[port].setObjName(portName.toChar()); #endif } @@ -68,21 +60,13 @@ void PassiveTelemetryComponentBase :: this->m_noArgsGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsGuarded_InputPort[port].setObjName(portName); + this->m_noArgsGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -100,21 +84,13 @@ void PassiveTelemetryComponentBase :: this->m_noArgsReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName); + this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -132,21 +108,13 @@ void PassiveTelemetryComponentBase :: this->m_noArgsReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnSync_InputPort[port].setObjName(portName); + this->m_noArgsReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -164,21 +132,13 @@ void PassiveTelemetryComponentBase :: this->m_noArgsSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsSync_InputPort[port].setObjName(portName); + this->m_noArgsSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -196,21 +156,13 @@ void PassiveTelemetryComponentBase :: this->m_typedGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedGuarded_InputPort[port].setObjName(portName); + this->m_typedGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -228,21 +180,13 @@ void PassiveTelemetryComponentBase :: this->m_typedReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnGuarded_InputPort[port].setObjName(portName); + this->m_typedReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -260,21 +204,13 @@ void PassiveTelemetryComponentBase :: this->m_typedReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnSync_InputPort[port].setObjName(portName); + this->m_typedReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -292,21 +228,13 @@ void PassiveTelemetryComponentBase :: this->m_typedSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedSync_InputPort[port].setObjName(portName); + this->m_typedSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -319,21 +247,13 @@ void PassiveTelemetryComponentBase :: this->m_cmdRegOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdRegOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdRegOut_OutputPort[port].setObjName(portName); + this->m_cmdRegOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -346,21 +266,13 @@ void PassiveTelemetryComponentBase :: this->m_cmdResponseOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdResponseOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdResponseOut_OutputPort[port].setObjName(portName); + this->m_cmdResponseOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -373,21 +285,13 @@ void PassiveTelemetryComponentBase :: this->m_eventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_eventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_eventOut_OutputPort[port].setObjName(portName); + this->m_eventOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -400,21 +304,13 @@ void PassiveTelemetryComponentBase :: this->m_prmGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmGetOut_OutputPort[port].setObjName(portName); + this->m_prmGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -427,21 +323,13 @@ void PassiveTelemetryComponentBase :: this->m_prmSetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmSetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmSetOut_OutputPort[port].setObjName(portName); + this->m_prmSetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -455,21 +343,13 @@ void PassiveTelemetryComponentBase :: this->m_textEventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_textEventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_textEventOut_OutputPort[port].setObjName(portName); + this->m_textEventOut_OutputPort[port].setObjName(portName.toChar()); #endif } #endif @@ -483,21 +363,13 @@ void PassiveTelemetryComponentBase :: this->m_timeGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_timeGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_timeGetOut_OutputPort[port].setObjName(portName); + this->m_timeGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -510,21 +382,13 @@ void PassiveTelemetryComponentBase :: this->m_tlmOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_tlmOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_tlmOut_OutputPort[port].setObjName(portName); + this->m_tlmOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -537,21 +401,13 @@ void PassiveTelemetryComponentBase :: this->m_noArgsOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsOut_OutputPort[port].setObjName(portName); + this->m_noArgsOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -564,21 +420,13 @@ void PassiveTelemetryComponentBase :: this->m_noArgsReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnOut_OutputPort[port].setObjName(portName); + this->m_noArgsReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -591,21 +439,13 @@ void PassiveTelemetryComponentBase :: this->m_typedOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedOut_OutputPort[port].setObjName(portName); + this->m_typedOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -618,21 +458,13 @@ void PassiveTelemetryComponentBase :: this->m_typedReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnOut_OutputPort[port].setObjName(portName); + this->m_typedReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } } diff --git a/compiler/tools/fpp-to-cpp/test/component/base/PassiveTestComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/PassiveTestComponentAc.ref.cpp index 44e65da1c..e2c720de1 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/PassiveTestComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/PassiveTestComponentAc.ref.cpp @@ -191,21 +191,13 @@ void PassiveTestComponentBase :: this->m_cmdIn_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdIn_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdIn_InputPort[port].setObjName(portName); + this->m_cmdIn_InputPort[port].setObjName(portName.toChar()); #endif } @@ -223,21 +215,13 @@ void PassiveTestComponentBase :: this->m_productRecvIn_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_productRecvIn_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_productRecvIn_InputPort[port].setObjName(portName); + this->m_productRecvIn_InputPort[port].setObjName(portName.toChar()); #endif } @@ -255,21 +239,13 @@ void PassiveTestComponentBase :: this->m_noArgsGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsGuarded_InputPort[port].setObjName(portName); + this->m_noArgsGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -287,21 +263,13 @@ void PassiveTestComponentBase :: this->m_noArgsReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName); + this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -319,21 +287,13 @@ void PassiveTestComponentBase :: this->m_noArgsReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnSync_InputPort[port].setObjName(portName); + this->m_noArgsReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -351,21 +311,13 @@ void PassiveTestComponentBase :: this->m_noArgsSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsSync_InputPort[port].setObjName(portName); + this->m_noArgsSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -383,21 +335,13 @@ void PassiveTestComponentBase :: this->m_typedGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedGuarded_InputPort[port].setObjName(portName); + this->m_typedGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -415,21 +359,13 @@ void PassiveTestComponentBase :: this->m_typedReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnGuarded_InputPort[port].setObjName(portName); + this->m_typedReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -447,21 +383,13 @@ void PassiveTestComponentBase :: this->m_typedReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnSync_InputPort[port].setObjName(portName); + this->m_typedReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -479,21 +407,13 @@ void PassiveTestComponentBase :: this->m_typedSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedSync_InputPort[port].setObjName(portName); + this->m_typedSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -506,21 +426,13 @@ void PassiveTestComponentBase :: this->m_cmdRegOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdRegOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdRegOut_OutputPort[port].setObjName(portName); + this->m_cmdRegOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -533,21 +445,13 @@ void PassiveTestComponentBase :: this->m_cmdResponseOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdResponseOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdResponseOut_OutputPort[port].setObjName(portName); + this->m_cmdResponseOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -560,21 +464,13 @@ void PassiveTestComponentBase :: this->m_eventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_eventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_eventOut_OutputPort[port].setObjName(portName); + this->m_eventOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -587,21 +483,13 @@ void PassiveTestComponentBase :: this->m_prmGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmGetOut_OutputPort[port].setObjName(portName); + this->m_prmGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -614,21 +502,13 @@ void PassiveTestComponentBase :: this->m_prmSetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmSetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmSetOut_OutputPort[port].setObjName(portName); + this->m_prmSetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -641,21 +521,13 @@ void PassiveTestComponentBase :: this->m_productRequestOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_productRequestOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_productRequestOut_OutputPort[port].setObjName(portName); + this->m_productRequestOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -668,21 +540,13 @@ void PassiveTestComponentBase :: this->m_productSendOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_productSendOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_productSendOut_OutputPort[port].setObjName(portName); + this->m_productSendOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -696,21 +560,13 @@ void PassiveTestComponentBase :: this->m_textEventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_textEventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_textEventOut_OutputPort[port].setObjName(portName); + this->m_textEventOut_OutputPort[port].setObjName(portName.toChar()); #endif } #endif @@ -724,21 +580,13 @@ void PassiveTestComponentBase :: this->m_timeGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_timeGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_timeGetOut_OutputPort[port].setObjName(portName); + this->m_timeGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -751,21 +599,13 @@ void PassiveTestComponentBase :: this->m_tlmOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_tlmOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_tlmOut_OutputPort[port].setObjName(portName); + this->m_tlmOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -778,21 +618,13 @@ void PassiveTestComponentBase :: this->m_noArgsOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsOut_OutputPort[port].setObjName(portName); + this->m_noArgsOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -805,21 +637,13 @@ void PassiveTestComponentBase :: this->m_noArgsReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnOut_OutputPort[port].setObjName(portName); + this->m_noArgsReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -832,21 +656,13 @@ void PassiveTestComponentBase :: this->m_typedOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedOut_OutputPort[port].setObjName(portName); + this->m_typedOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -859,21 +675,13 @@ void PassiveTestComponentBase :: this->m_typedReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnOut_OutputPort[port].setObjName(portName); + this->m_typedReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } } @@ -3114,7 +2922,7 @@ void PassiveTestComponentBase :: FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventActivityHigh " ); @@ -3245,7 +3053,7 @@ void PassiveTestComponentBase :: FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventActivityLowThrottled ", u32, @@ -3334,7 +3142,7 @@ void PassiveTestComponentBase :: FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventCommand ", str1.toChar(), @@ -3426,7 +3234,7 @@ void PassiveTestComponentBase :: FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventDiagnostic ", eStr.toChar() @@ -3538,7 +3346,7 @@ void PassiveTestComponentBase :: FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventFatalThrottled ", aStr.toChar() @@ -3629,7 +3437,7 @@ void PassiveTestComponentBase :: FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventWarningHigh ", sStr.toChar() @@ -3709,7 +3517,7 @@ void PassiveTestComponentBase :: FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventWarningLowThrottled " ); diff --git a/compiler/tools/fpp-to-cpp/test/component/base/QueuedAsyncProductPortsOnlyComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/QueuedAsyncProductPortsOnlyComponentAc.ref.cpp index a9106b7b7..947625d7b 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/QueuedAsyncProductPortsOnlyComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/QueuedAsyncProductPortsOnlyComponentAc.ref.cpp @@ -86,21 +86,13 @@ void QueuedAsyncProductPortsOnlyComponentBase :: this->m_productRecvIn_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_productRecvIn_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_productRecvIn_InputPort[port].setObjName(portName); + this->m_productRecvIn_InputPort[port].setObjName(portName.toChar()); #endif } @@ -113,21 +105,13 @@ void QueuedAsyncProductPortsOnlyComponentBase :: this->m_productRequestOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_productRequestOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_productRequestOut_OutputPort[port].setObjName(portName); + this->m_productRequestOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -140,21 +124,13 @@ void QueuedAsyncProductPortsOnlyComponentBase :: this->m_productSendOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_productSendOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_productSendOut_OutputPort[port].setObjName(portName); + this->m_productSendOut_OutputPort[port].setObjName(portName.toChar()); #endif } diff --git a/compiler/tools/fpp-to-cpp/test/component/base/QueuedAsyncProductsComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/QueuedAsyncProductsComponentAc.ref.cpp index 2742ea0b5..169863c68 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/QueuedAsyncProductsComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/QueuedAsyncProductsComponentAc.ref.cpp @@ -251,21 +251,13 @@ void QueuedAsyncProductsComponentBase :: this->m_cmdIn_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdIn_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdIn_InputPort[port].setObjName(portName); + this->m_cmdIn_InputPort[port].setObjName(portName.toChar()); #endif } @@ -283,21 +275,13 @@ void QueuedAsyncProductsComponentBase :: this->m_productRecvIn_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_productRecvIn_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_productRecvIn_InputPort[port].setObjName(portName); + this->m_productRecvIn_InputPort[port].setObjName(portName.toChar()); #endif } @@ -315,21 +299,13 @@ void QueuedAsyncProductsComponentBase :: this->m_noArgsAsync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsAsync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsAsync_InputPort[port].setObjName(portName); + this->m_noArgsAsync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -347,21 +323,13 @@ void QueuedAsyncProductsComponentBase :: this->m_noArgsGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsGuarded_InputPort[port].setObjName(portName); + this->m_noArgsGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -379,21 +347,13 @@ void QueuedAsyncProductsComponentBase :: this->m_noArgsReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName); + this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -411,21 +371,13 @@ void QueuedAsyncProductsComponentBase :: this->m_noArgsReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnSync_InputPort[port].setObjName(portName); + this->m_noArgsReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -443,21 +395,13 @@ void QueuedAsyncProductsComponentBase :: this->m_noArgsSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsSync_InputPort[port].setObjName(portName); + this->m_noArgsSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -475,21 +419,13 @@ void QueuedAsyncProductsComponentBase :: this->m_typedAsync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsync_InputPort[port].setObjName(portName); + this->m_typedAsync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -507,21 +443,13 @@ void QueuedAsyncProductsComponentBase :: this->m_typedAsyncAssert_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncAssert_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncAssert_InputPort[port].setObjName(portName); + this->m_typedAsyncAssert_InputPort[port].setObjName(portName.toChar()); #endif } @@ -539,21 +467,13 @@ void QueuedAsyncProductsComponentBase :: this->m_typedAsyncBlockPriority_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncBlockPriority_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncBlockPriority_InputPort[port].setObjName(portName); + this->m_typedAsyncBlockPriority_InputPort[port].setObjName(portName.toChar()); #endif } @@ -571,21 +491,13 @@ void QueuedAsyncProductsComponentBase :: this->m_typedAsyncDropPriority_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncDropPriority_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncDropPriority_InputPort[port].setObjName(portName); + this->m_typedAsyncDropPriority_InputPort[port].setObjName(portName.toChar()); #endif } @@ -603,21 +515,13 @@ void QueuedAsyncProductsComponentBase :: this->m_typedGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedGuarded_InputPort[port].setObjName(portName); + this->m_typedGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -635,21 +539,13 @@ void QueuedAsyncProductsComponentBase :: this->m_typedReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnGuarded_InputPort[port].setObjName(portName); + this->m_typedReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -667,21 +563,13 @@ void QueuedAsyncProductsComponentBase :: this->m_typedReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnSync_InputPort[port].setObjName(portName); + this->m_typedReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -699,21 +587,13 @@ void QueuedAsyncProductsComponentBase :: this->m_typedSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedSync_InputPort[port].setObjName(portName); + this->m_typedSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -726,21 +606,13 @@ void QueuedAsyncProductsComponentBase :: this->m_cmdRegOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdRegOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdRegOut_OutputPort[port].setObjName(portName); + this->m_cmdRegOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -753,21 +625,13 @@ void QueuedAsyncProductsComponentBase :: this->m_cmdResponseOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdResponseOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdResponseOut_OutputPort[port].setObjName(portName); + this->m_cmdResponseOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -780,21 +644,13 @@ void QueuedAsyncProductsComponentBase :: this->m_eventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_eventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_eventOut_OutputPort[port].setObjName(portName); + this->m_eventOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -807,21 +663,13 @@ void QueuedAsyncProductsComponentBase :: this->m_prmGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmGetOut_OutputPort[port].setObjName(portName); + this->m_prmGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -834,21 +682,13 @@ void QueuedAsyncProductsComponentBase :: this->m_prmSetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmSetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmSetOut_OutputPort[port].setObjName(portName); + this->m_prmSetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -861,21 +701,13 @@ void QueuedAsyncProductsComponentBase :: this->m_productRequestOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_productRequestOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_productRequestOut_OutputPort[port].setObjName(portName); + this->m_productRequestOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -888,21 +720,13 @@ void QueuedAsyncProductsComponentBase :: this->m_productSendOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_productSendOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_productSendOut_OutputPort[port].setObjName(portName); + this->m_productSendOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -916,21 +740,13 @@ void QueuedAsyncProductsComponentBase :: this->m_textEventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_textEventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_textEventOut_OutputPort[port].setObjName(portName); + this->m_textEventOut_OutputPort[port].setObjName(portName.toChar()); #endif } #endif @@ -944,21 +760,13 @@ void QueuedAsyncProductsComponentBase :: this->m_timeGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_timeGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_timeGetOut_OutputPort[port].setObjName(portName); + this->m_timeGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -971,21 +779,13 @@ void QueuedAsyncProductsComponentBase :: this->m_tlmOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_tlmOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_tlmOut_OutputPort[port].setObjName(portName); + this->m_tlmOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -998,21 +798,13 @@ void QueuedAsyncProductsComponentBase :: this->m_noArgsOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsOut_OutputPort[port].setObjName(portName); + this->m_noArgsOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -1025,21 +817,13 @@ void QueuedAsyncProductsComponentBase :: this->m_noArgsReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnOut_OutputPort[port].setObjName(portName); + this->m_noArgsReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -1052,21 +836,13 @@ void QueuedAsyncProductsComponentBase :: this->m_typedOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedOut_OutputPort[port].setObjName(portName); + this->m_typedOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -1079,21 +855,13 @@ void QueuedAsyncProductsComponentBase :: this->m_typedReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnOut_OutputPort[port].setObjName(portName); + this->m_typedReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } diff --git a/compiler/tools/fpp-to-cpp/test/component/base/QueuedCommandsComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/QueuedCommandsComponentAc.ref.cpp index a19101d9f..11a8ef140 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/QueuedCommandsComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/QueuedCommandsComponentAc.ref.cpp @@ -99,21 +99,13 @@ void QueuedCommandsComponentBase :: this->m_cmdIn_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdIn_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdIn_InputPort[port].setObjName(portName); + this->m_cmdIn_InputPort[port].setObjName(portName.toChar()); #endif } @@ -131,21 +123,13 @@ void QueuedCommandsComponentBase :: this->m_noArgsAsync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsAsync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsAsync_InputPort[port].setObjName(portName); + this->m_noArgsAsync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -163,21 +147,13 @@ void QueuedCommandsComponentBase :: this->m_noArgsGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsGuarded_InputPort[port].setObjName(portName); + this->m_noArgsGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -195,21 +171,13 @@ void QueuedCommandsComponentBase :: this->m_noArgsReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName); + this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -227,21 +195,13 @@ void QueuedCommandsComponentBase :: this->m_noArgsReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnSync_InputPort[port].setObjName(portName); + this->m_noArgsReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -259,21 +219,13 @@ void QueuedCommandsComponentBase :: this->m_noArgsSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsSync_InputPort[port].setObjName(portName); + this->m_noArgsSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -291,21 +243,13 @@ void QueuedCommandsComponentBase :: this->m_typedAsync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsync_InputPort[port].setObjName(portName); + this->m_typedAsync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -323,21 +267,13 @@ void QueuedCommandsComponentBase :: this->m_typedAsyncAssert_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncAssert_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncAssert_InputPort[port].setObjName(portName); + this->m_typedAsyncAssert_InputPort[port].setObjName(portName.toChar()); #endif } @@ -355,21 +291,13 @@ void QueuedCommandsComponentBase :: this->m_typedAsyncBlockPriority_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncBlockPriority_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncBlockPriority_InputPort[port].setObjName(portName); + this->m_typedAsyncBlockPriority_InputPort[port].setObjName(portName.toChar()); #endif } @@ -387,21 +315,13 @@ void QueuedCommandsComponentBase :: this->m_typedAsyncDropPriority_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncDropPriority_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncDropPriority_InputPort[port].setObjName(portName); + this->m_typedAsyncDropPriority_InputPort[port].setObjName(portName.toChar()); #endif } @@ -419,21 +339,13 @@ void QueuedCommandsComponentBase :: this->m_typedGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedGuarded_InputPort[port].setObjName(portName); + this->m_typedGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -451,21 +363,13 @@ void QueuedCommandsComponentBase :: this->m_typedReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnGuarded_InputPort[port].setObjName(portName); + this->m_typedReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -483,21 +387,13 @@ void QueuedCommandsComponentBase :: this->m_typedReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnSync_InputPort[port].setObjName(portName); + this->m_typedReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -515,21 +411,13 @@ void QueuedCommandsComponentBase :: this->m_typedSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedSync_InputPort[port].setObjName(portName); + this->m_typedSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -542,21 +430,13 @@ void QueuedCommandsComponentBase :: this->m_cmdRegOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdRegOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdRegOut_OutputPort[port].setObjName(portName); + this->m_cmdRegOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -569,21 +449,13 @@ void QueuedCommandsComponentBase :: this->m_cmdResponseOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdResponseOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdResponseOut_OutputPort[port].setObjName(portName); + this->m_cmdResponseOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -596,21 +468,13 @@ void QueuedCommandsComponentBase :: this->m_eventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_eventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_eventOut_OutputPort[port].setObjName(portName); + this->m_eventOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -623,21 +487,13 @@ void QueuedCommandsComponentBase :: this->m_prmGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmGetOut_OutputPort[port].setObjName(portName); + this->m_prmGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -650,21 +506,13 @@ void QueuedCommandsComponentBase :: this->m_prmSetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmSetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmSetOut_OutputPort[port].setObjName(portName); + this->m_prmSetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -678,21 +526,13 @@ void QueuedCommandsComponentBase :: this->m_textEventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_textEventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_textEventOut_OutputPort[port].setObjName(portName); + this->m_textEventOut_OutputPort[port].setObjName(portName.toChar()); #endif } #endif @@ -706,21 +546,13 @@ void QueuedCommandsComponentBase :: this->m_timeGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_timeGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_timeGetOut_OutputPort[port].setObjName(portName); + this->m_timeGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -733,21 +565,13 @@ void QueuedCommandsComponentBase :: this->m_tlmOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_tlmOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_tlmOut_OutputPort[port].setObjName(portName); + this->m_tlmOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -760,21 +584,13 @@ void QueuedCommandsComponentBase :: this->m_noArgsOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsOut_OutputPort[port].setObjName(portName); + this->m_noArgsOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -787,21 +603,13 @@ void QueuedCommandsComponentBase :: this->m_noArgsReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnOut_OutputPort[port].setObjName(portName); + this->m_noArgsReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -814,21 +622,13 @@ void QueuedCommandsComponentBase :: this->m_typedOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedOut_OutputPort[port].setObjName(portName); + this->m_typedOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -841,21 +641,13 @@ void QueuedCommandsComponentBase :: this->m_typedReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnOut_OutputPort[port].setObjName(portName); + this->m_typedReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } diff --git a/compiler/tools/fpp-to-cpp/test/component/base/QueuedEventsComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/QueuedEventsComponentAc.ref.cpp index 5c1fdb81d..d3bf44ee6 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/QueuedEventsComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/QueuedEventsComponentAc.ref.cpp @@ -94,21 +94,13 @@ void QueuedEventsComponentBase :: this->m_cmdIn_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdIn_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdIn_InputPort[port].setObjName(portName); + this->m_cmdIn_InputPort[port].setObjName(portName.toChar()); #endif } @@ -126,21 +118,13 @@ void QueuedEventsComponentBase :: this->m_noArgsAsync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsAsync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsAsync_InputPort[port].setObjName(portName); + this->m_noArgsAsync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -158,21 +142,13 @@ void QueuedEventsComponentBase :: this->m_noArgsGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsGuarded_InputPort[port].setObjName(portName); + this->m_noArgsGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -190,21 +166,13 @@ void QueuedEventsComponentBase :: this->m_noArgsReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName); + this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -222,21 +190,13 @@ void QueuedEventsComponentBase :: this->m_noArgsReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnSync_InputPort[port].setObjName(portName); + this->m_noArgsReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -254,21 +214,13 @@ void QueuedEventsComponentBase :: this->m_noArgsSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsSync_InputPort[port].setObjName(portName); + this->m_noArgsSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -286,21 +238,13 @@ void QueuedEventsComponentBase :: this->m_typedAsync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsync_InputPort[port].setObjName(portName); + this->m_typedAsync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -318,21 +262,13 @@ void QueuedEventsComponentBase :: this->m_typedAsyncAssert_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncAssert_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncAssert_InputPort[port].setObjName(portName); + this->m_typedAsyncAssert_InputPort[port].setObjName(portName.toChar()); #endif } @@ -350,21 +286,13 @@ void QueuedEventsComponentBase :: this->m_typedAsyncBlockPriority_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncBlockPriority_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncBlockPriority_InputPort[port].setObjName(portName); + this->m_typedAsyncBlockPriority_InputPort[port].setObjName(portName.toChar()); #endif } @@ -382,21 +310,13 @@ void QueuedEventsComponentBase :: this->m_typedAsyncDropPriority_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncDropPriority_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncDropPriority_InputPort[port].setObjName(portName); + this->m_typedAsyncDropPriority_InputPort[port].setObjName(portName.toChar()); #endif } @@ -414,21 +334,13 @@ void QueuedEventsComponentBase :: this->m_typedGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedGuarded_InputPort[port].setObjName(portName); + this->m_typedGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -446,21 +358,13 @@ void QueuedEventsComponentBase :: this->m_typedReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnGuarded_InputPort[port].setObjName(portName); + this->m_typedReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -478,21 +382,13 @@ void QueuedEventsComponentBase :: this->m_typedReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnSync_InputPort[port].setObjName(portName); + this->m_typedReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -510,21 +406,13 @@ void QueuedEventsComponentBase :: this->m_typedSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedSync_InputPort[port].setObjName(portName); + this->m_typedSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -537,21 +425,13 @@ void QueuedEventsComponentBase :: this->m_cmdRegOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdRegOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdRegOut_OutputPort[port].setObjName(portName); + this->m_cmdRegOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -564,21 +444,13 @@ void QueuedEventsComponentBase :: this->m_cmdResponseOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdResponseOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdResponseOut_OutputPort[port].setObjName(portName); + this->m_cmdResponseOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -591,21 +463,13 @@ void QueuedEventsComponentBase :: this->m_eventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_eventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_eventOut_OutputPort[port].setObjName(portName); + this->m_eventOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -618,21 +482,13 @@ void QueuedEventsComponentBase :: this->m_prmGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmGetOut_OutputPort[port].setObjName(portName); + this->m_prmGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -645,21 +501,13 @@ void QueuedEventsComponentBase :: this->m_prmSetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmSetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmSetOut_OutputPort[port].setObjName(portName); + this->m_prmSetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -673,21 +521,13 @@ void QueuedEventsComponentBase :: this->m_textEventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_textEventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_textEventOut_OutputPort[port].setObjName(portName); + this->m_textEventOut_OutputPort[port].setObjName(portName.toChar()); #endif } #endif @@ -701,21 +541,13 @@ void QueuedEventsComponentBase :: this->m_timeGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_timeGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_timeGetOut_OutputPort[port].setObjName(portName); + this->m_timeGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -728,21 +560,13 @@ void QueuedEventsComponentBase :: this->m_tlmOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_tlmOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_tlmOut_OutputPort[port].setObjName(portName); + this->m_tlmOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -755,21 +579,13 @@ void QueuedEventsComponentBase :: this->m_noArgsOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsOut_OutputPort[port].setObjName(portName); + this->m_noArgsOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -782,21 +598,13 @@ void QueuedEventsComponentBase :: this->m_noArgsReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnOut_OutputPort[port].setObjName(portName); + this->m_noArgsReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -809,21 +617,13 @@ void QueuedEventsComponentBase :: this->m_typedOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedOut_OutputPort[port].setObjName(portName); + this->m_typedOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -836,21 +636,13 @@ void QueuedEventsComponentBase :: this->m_typedReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnOut_OutputPort[port].setObjName(portName); + this->m_typedReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -2595,7 +2387,7 @@ void QueuedEventsComponentBase :: FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventActivityHigh " ); @@ -2726,7 +2518,7 @@ void QueuedEventsComponentBase :: FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventActivityLowThrottled ", u32, @@ -2815,7 +2607,7 @@ void QueuedEventsComponentBase :: FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventCommand ", str1.toChar(), @@ -2907,7 +2699,7 @@ void QueuedEventsComponentBase :: FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventDiagnostic ", eStr.toChar() @@ -3019,7 +2811,7 @@ void QueuedEventsComponentBase :: FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventFatalThrottled ", aStr.toChar() @@ -3110,7 +2902,7 @@ void QueuedEventsComponentBase :: FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventWarningHigh ", sStr.toChar() @@ -3190,7 +2982,7 @@ void QueuedEventsComponentBase :: FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventWarningLowThrottled " ); diff --git a/compiler/tools/fpp-to-cpp/test/component/base/QueuedGetProductsComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/QueuedGetProductsComponentAc.ref.cpp index 78cb5aa94..d71f5e6e1 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/QueuedGetProductsComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/QueuedGetProductsComponentAc.ref.cpp @@ -249,21 +249,13 @@ void QueuedGetProductsComponentBase :: this->m_cmdIn_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdIn_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdIn_InputPort[port].setObjName(portName); + this->m_cmdIn_InputPort[port].setObjName(portName.toChar()); #endif } @@ -281,21 +273,13 @@ void QueuedGetProductsComponentBase :: this->m_noArgsAsync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsAsync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsAsync_InputPort[port].setObjName(portName); + this->m_noArgsAsync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -313,21 +297,13 @@ void QueuedGetProductsComponentBase :: this->m_noArgsGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsGuarded_InputPort[port].setObjName(portName); + this->m_noArgsGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -345,21 +321,13 @@ void QueuedGetProductsComponentBase :: this->m_noArgsReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName); + this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -377,21 +345,13 @@ void QueuedGetProductsComponentBase :: this->m_noArgsReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnSync_InputPort[port].setObjName(portName); + this->m_noArgsReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -409,21 +369,13 @@ void QueuedGetProductsComponentBase :: this->m_noArgsSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsSync_InputPort[port].setObjName(portName); + this->m_noArgsSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -441,21 +393,13 @@ void QueuedGetProductsComponentBase :: this->m_typedAsync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsync_InputPort[port].setObjName(portName); + this->m_typedAsync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -473,21 +417,13 @@ void QueuedGetProductsComponentBase :: this->m_typedAsyncAssert_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncAssert_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncAssert_InputPort[port].setObjName(portName); + this->m_typedAsyncAssert_InputPort[port].setObjName(portName.toChar()); #endif } @@ -505,21 +441,13 @@ void QueuedGetProductsComponentBase :: this->m_typedAsyncBlockPriority_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncBlockPriority_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncBlockPriority_InputPort[port].setObjName(portName); + this->m_typedAsyncBlockPriority_InputPort[port].setObjName(portName.toChar()); #endif } @@ -537,21 +465,13 @@ void QueuedGetProductsComponentBase :: this->m_typedAsyncDropPriority_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncDropPriority_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncDropPriority_InputPort[port].setObjName(portName); + this->m_typedAsyncDropPriority_InputPort[port].setObjName(portName.toChar()); #endif } @@ -569,21 +489,13 @@ void QueuedGetProductsComponentBase :: this->m_typedGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedGuarded_InputPort[port].setObjName(portName); + this->m_typedGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -601,21 +513,13 @@ void QueuedGetProductsComponentBase :: this->m_typedReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnGuarded_InputPort[port].setObjName(portName); + this->m_typedReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -633,21 +537,13 @@ void QueuedGetProductsComponentBase :: this->m_typedReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnSync_InputPort[port].setObjName(portName); + this->m_typedReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -665,21 +561,13 @@ void QueuedGetProductsComponentBase :: this->m_typedSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedSync_InputPort[port].setObjName(portName); + this->m_typedSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -692,21 +580,13 @@ void QueuedGetProductsComponentBase :: this->m_cmdRegOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdRegOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdRegOut_OutputPort[port].setObjName(portName); + this->m_cmdRegOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -719,21 +599,13 @@ void QueuedGetProductsComponentBase :: this->m_cmdResponseOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdResponseOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdResponseOut_OutputPort[port].setObjName(portName); + this->m_cmdResponseOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -746,21 +618,13 @@ void QueuedGetProductsComponentBase :: this->m_eventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_eventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_eventOut_OutputPort[port].setObjName(portName); + this->m_eventOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -773,21 +637,13 @@ void QueuedGetProductsComponentBase :: this->m_prmGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmGetOut_OutputPort[port].setObjName(portName); + this->m_prmGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -800,21 +656,13 @@ void QueuedGetProductsComponentBase :: this->m_prmSetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmSetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmSetOut_OutputPort[port].setObjName(portName); + this->m_prmSetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -827,21 +675,13 @@ void QueuedGetProductsComponentBase :: this->m_productGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_productGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_productGetOut_OutputPort[port].setObjName(portName); + this->m_productGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -854,21 +694,13 @@ void QueuedGetProductsComponentBase :: this->m_productSendOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_productSendOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_productSendOut_OutputPort[port].setObjName(portName); + this->m_productSendOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -882,21 +714,13 @@ void QueuedGetProductsComponentBase :: this->m_textEventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_textEventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_textEventOut_OutputPort[port].setObjName(portName); + this->m_textEventOut_OutputPort[port].setObjName(portName.toChar()); #endif } #endif @@ -910,21 +734,13 @@ void QueuedGetProductsComponentBase :: this->m_timeGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_timeGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_timeGetOut_OutputPort[port].setObjName(portName); + this->m_timeGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -937,21 +753,13 @@ void QueuedGetProductsComponentBase :: this->m_tlmOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_tlmOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_tlmOut_OutputPort[port].setObjName(portName); + this->m_tlmOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -964,21 +772,13 @@ void QueuedGetProductsComponentBase :: this->m_noArgsOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsOut_OutputPort[port].setObjName(portName); + this->m_noArgsOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -991,21 +791,13 @@ void QueuedGetProductsComponentBase :: this->m_noArgsReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnOut_OutputPort[port].setObjName(portName); + this->m_noArgsReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -1018,21 +810,13 @@ void QueuedGetProductsComponentBase :: this->m_typedOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedOut_OutputPort[port].setObjName(portName); + this->m_typedOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -1045,21 +829,13 @@ void QueuedGetProductsComponentBase :: this->m_typedReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnOut_OutputPort[port].setObjName(portName); + this->m_typedReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } diff --git a/compiler/tools/fpp-to-cpp/test/component/base/QueuedGuardedProductsComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/QueuedGuardedProductsComponentAc.ref.cpp index 7c6a1f3ae..e82832d90 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/QueuedGuardedProductsComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/QueuedGuardedProductsComponentAc.ref.cpp @@ -249,21 +249,13 @@ void QueuedGuardedProductsComponentBase :: this->m_cmdIn_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdIn_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdIn_InputPort[port].setObjName(portName); + this->m_cmdIn_InputPort[port].setObjName(portName.toChar()); #endif } @@ -281,21 +273,13 @@ void QueuedGuardedProductsComponentBase :: this->m_productRecvIn_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_productRecvIn_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_productRecvIn_InputPort[port].setObjName(portName); + this->m_productRecvIn_InputPort[port].setObjName(portName.toChar()); #endif } @@ -313,21 +297,13 @@ void QueuedGuardedProductsComponentBase :: this->m_noArgsAsync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsAsync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsAsync_InputPort[port].setObjName(portName); + this->m_noArgsAsync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -345,21 +321,13 @@ void QueuedGuardedProductsComponentBase :: this->m_noArgsGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsGuarded_InputPort[port].setObjName(portName); + this->m_noArgsGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -377,21 +345,13 @@ void QueuedGuardedProductsComponentBase :: this->m_noArgsReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName); + this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -409,21 +369,13 @@ void QueuedGuardedProductsComponentBase :: this->m_noArgsReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnSync_InputPort[port].setObjName(portName); + this->m_noArgsReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -441,21 +393,13 @@ void QueuedGuardedProductsComponentBase :: this->m_noArgsSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsSync_InputPort[port].setObjName(portName); + this->m_noArgsSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -473,21 +417,13 @@ void QueuedGuardedProductsComponentBase :: this->m_typedAsync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsync_InputPort[port].setObjName(portName); + this->m_typedAsync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -505,21 +441,13 @@ void QueuedGuardedProductsComponentBase :: this->m_typedAsyncAssert_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncAssert_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncAssert_InputPort[port].setObjName(portName); + this->m_typedAsyncAssert_InputPort[port].setObjName(portName.toChar()); #endif } @@ -537,21 +465,13 @@ void QueuedGuardedProductsComponentBase :: this->m_typedAsyncBlockPriority_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncBlockPriority_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncBlockPriority_InputPort[port].setObjName(portName); + this->m_typedAsyncBlockPriority_InputPort[port].setObjName(portName.toChar()); #endif } @@ -569,21 +489,13 @@ void QueuedGuardedProductsComponentBase :: this->m_typedAsyncDropPriority_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncDropPriority_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncDropPriority_InputPort[port].setObjName(portName); + this->m_typedAsyncDropPriority_InputPort[port].setObjName(portName.toChar()); #endif } @@ -601,21 +513,13 @@ void QueuedGuardedProductsComponentBase :: this->m_typedGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedGuarded_InputPort[port].setObjName(portName); + this->m_typedGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -633,21 +537,13 @@ void QueuedGuardedProductsComponentBase :: this->m_typedReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnGuarded_InputPort[port].setObjName(portName); + this->m_typedReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -665,21 +561,13 @@ void QueuedGuardedProductsComponentBase :: this->m_typedReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnSync_InputPort[port].setObjName(portName); + this->m_typedReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -697,21 +585,13 @@ void QueuedGuardedProductsComponentBase :: this->m_typedSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedSync_InputPort[port].setObjName(portName); + this->m_typedSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -724,21 +604,13 @@ void QueuedGuardedProductsComponentBase :: this->m_cmdRegOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdRegOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdRegOut_OutputPort[port].setObjName(portName); + this->m_cmdRegOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -751,21 +623,13 @@ void QueuedGuardedProductsComponentBase :: this->m_cmdResponseOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdResponseOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdResponseOut_OutputPort[port].setObjName(portName); + this->m_cmdResponseOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -778,21 +642,13 @@ void QueuedGuardedProductsComponentBase :: this->m_eventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_eventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_eventOut_OutputPort[port].setObjName(portName); + this->m_eventOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -805,21 +661,13 @@ void QueuedGuardedProductsComponentBase :: this->m_prmGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmGetOut_OutputPort[port].setObjName(portName); + this->m_prmGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -832,21 +680,13 @@ void QueuedGuardedProductsComponentBase :: this->m_prmSetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmSetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmSetOut_OutputPort[port].setObjName(portName); + this->m_prmSetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -859,21 +699,13 @@ void QueuedGuardedProductsComponentBase :: this->m_productRequestOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_productRequestOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_productRequestOut_OutputPort[port].setObjName(portName); + this->m_productRequestOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -886,21 +718,13 @@ void QueuedGuardedProductsComponentBase :: this->m_productSendOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_productSendOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_productSendOut_OutputPort[port].setObjName(portName); + this->m_productSendOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -914,21 +738,13 @@ void QueuedGuardedProductsComponentBase :: this->m_textEventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_textEventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_textEventOut_OutputPort[port].setObjName(portName); + this->m_textEventOut_OutputPort[port].setObjName(portName.toChar()); #endif } #endif @@ -942,21 +758,13 @@ void QueuedGuardedProductsComponentBase :: this->m_timeGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_timeGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_timeGetOut_OutputPort[port].setObjName(portName); + this->m_timeGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -969,21 +777,13 @@ void QueuedGuardedProductsComponentBase :: this->m_tlmOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_tlmOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_tlmOut_OutputPort[port].setObjName(portName); + this->m_tlmOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -996,21 +796,13 @@ void QueuedGuardedProductsComponentBase :: this->m_noArgsOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsOut_OutputPort[port].setObjName(portName); + this->m_noArgsOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -1023,21 +815,13 @@ void QueuedGuardedProductsComponentBase :: this->m_noArgsReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnOut_OutputPort[port].setObjName(portName); + this->m_noArgsReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -1050,21 +834,13 @@ void QueuedGuardedProductsComponentBase :: this->m_typedOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedOut_OutputPort[port].setObjName(portName); + this->m_typedOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -1077,21 +853,13 @@ void QueuedGuardedProductsComponentBase :: this->m_typedReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnOut_OutputPort[port].setObjName(portName); + this->m_typedReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } diff --git a/compiler/tools/fpp-to-cpp/test/component/base/QueuedNoArgsPortsOnlyComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/QueuedNoArgsPortsOnlyComponentAc.ref.cpp index a3abc428a..6e7cdf846 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/QueuedNoArgsPortsOnlyComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/QueuedNoArgsPortsOnlyComponentAc.ref.cpp @@ -79,21 +79,13 @@ void QueuedNoArgsPortsOnlyComponentBase :: this->m_noArgsAsync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsAsync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsAsync_InputPort[port].setObjName(portName); + this->m_noArgsAsync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -111,21 +103,13 @@ void QueuedNoArgsPortsOnlyComponentBase :: this->m_noArgsGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsGuarded_InputPort[port].setObjName(portName); + this->m_noArgsGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -143,21 +127,13 @@ void QueuedNoArgsPortsOnlyComponentBase :: this->m_noArgsReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName); + this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -175,21 +151,13 @@ void QueuedNoArgsPortsOnlyComponentBase :: this->m_noArgsReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnSync_InputPort[port].setObjName(portName); + this->m_noArgsReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -202,21 +170,13 @@ void QueuedNoArgsPortsOnlyComponentBase :: this->m_noArgsOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsOut_OutputPort[port].setObjName(portName); + this->m_noArgsOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -229,21 +189,13 @@ void QueuedNoArgsPortsOnlyComponentBase :: this->m_noArgsReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnOut_OutputPort[port].setObjName(portName); + this->m_noArgsReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } diff --git a/compiler/tools/fpp-to-cpp/test/component/base/QueuedParamsComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/QueuedParamsComponentAc.ref.cpp index c46e9b0f2..315420973 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/QueuedParamsComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/QueuedParamsComponentAc.ref.cpp @@ -94,21 +94,13 @@ void QueuedParamsComponentBase :: this->m_cmdIn_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdIn_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdIn_InputPort[port].setObjName(portName); + this->m_cmdIn_InputPort[port].setObjName(portName.toChar()); #endif } @@ -126,21 +118,13 @@ void QueuedParamsComponentBase :: this->m_noArgsAsync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsAsync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsAsync_InputPort[port].setObjName(portName); + this->m_noArgsAsync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -158,21 +142,13 @@ void QueuedParamsComponentBase :: this->m_noArgsGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsGuarded_InputPort[port].setObjName(portName); + this->m_noArgsGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -190,21 +166,13 @@ void QueuedParamsComponentBase :: this->m_noArgsReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName); + this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -222,21 +190,13 @@ void QueuedParamsComponentBase :: this->m_noArgsReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnSync_InputPort[port].setObjName(portName); + this->m_noArgsReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -254,21 +214,13 @@ void QueuedParamsComponentBase :: this->m_noArgsSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsSync_InputPort[port].setObjName(portName); + this->m_noArgsSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -286,21 +238,13 @@ void QueuedParamsComponentBase :: this->m_typedAsync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsync_InputPort[port].setObjName(portName); + this->m_typedAsync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -318,21 +262,13 @@ void QueuedParamsComponentBase :: this->m_typedAsyncAssert_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncAssert_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncAssert_InputPort[port].setObjName(portName); + this->m_typedAsyncAssert_InputPort[port].setObjName(portName.toChar()); #endif } @@ -350,21 +286,13 @@ void QueuedParamsComponentBase :: this->m_typedAsyncBlockPriority_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncBlockPriority_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncBlockPriority_InputPort[port].setObjName(portName); + this->m_typedAsyncBlockPriority_InputPort[port].setObjName(portName.toChar()); #endif } @@ -382,21 +310,13 @@ void QueuedParamsComponentBase :: this->m_typedAsyncDropPriority_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncDropPriority_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncDropPriority_InputPort[port].setObjName(portName); + this->m_typedAsyncDropPriority_InputPort[port].setObjName(portName.toChar()); #endif } @@ -414,21 +334,13 @@ void QueuedParamsComponentBase :: this->m_typedGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedGuarded_InputPort[port].setObjName(portName); + this->m_typedGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -446,21 +358,13 @@ void QueuedParamsComponentBase :: this->m_typedReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnGuarded_InputPort[port].setObjName(portName); + this->m_typedReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -478,21 +382,13 @@ void QueuedParamsComponentBase :: this->m_typedReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnSync_InputPort[port].setObjName(portName); + this->m_typedReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -510,21 +406,13 @@ void QueuedParamsComponentBase :: this->m_typedSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedSync_InputPort[port].setObjName(portName); + this->m_typedSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -537,21 +425,13 @@ void QueuedParamsComponentBase :: this->m_cmdRegOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdRegOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdRegOut_OutputPort[port].setObjName(portName); + this->m_cmdRegOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -564,21 +444,13 @@ void QueuedParamsComponentBase :: this->m_cmdResponseOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdResponseOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdResponseOut_OutputPort[port].setObjName(portName); + this->m_cmdResponseOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -591,21 +463,13 @@ void QueuedParamsComponentBase :: this->m_eventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_eventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_eventOut_OutputPort[port].setObjName(portName); + this->m_eventOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -618,21 +482,13 @@ void QueuedParamsComponentBase :: this->m_prmGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmGetOut_OutputPort[port].setObjName(portName); + this->m_prmGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -645,21 +501,13 @@ void QueuedParamsComponentBase :: this->m_prmSetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmSetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmSetOut_OutputPort[port].setObjName(portName); + this->m_prmSetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -673,21 +521,13 @@ void QueuedParamsComponentBase :: this->m_textEventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_textEventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_textEventOut_OutputPort[port].setObjName(portName); + this->m_textEventOut_OutputPort[port].setObjName(portName.toChar()); #endif } #endif @@ -701,21 +541,13 @@ void QueuedParamsComponentBase :: this->m_timeGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_timeGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_timeGetOut_OutputPort[port].setObjName(portName); + this->m_timeGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -728,21 +560,13 @@ void QueuedParamsComponentBase :: this->m_tlmOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_tlmOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_tlmOut_OutputPort[port].setObjName(portName); + this->m_tlmOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -755,21 +579,13 @@ void QueuedParamsComponentBase :: this->m_noArgsOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsOut_OutputPort[port].setObjName(portName); + this->m_noArgsOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -782,21 +598,13 @@ void QueuedParamsComponentBase :: this->m_noArgsReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnOut_OutputPort[port].setObjName(portName); + this->m_noArgsReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -809,21 +617,13 @@ void QueuedParamsComponentBase :: this->m_typedOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedOut_OutputPort[port].setObjName(portName); + this->m_typedOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -836,21 +636,13 @@ void QueuedParamsComponentBase :: this->m_typedReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnOut_OutputPort[port].setObjName(portName); + this->m_typedReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } diff --git a/compiler/tools/fpp-to-cpp/test/component/base/QueuedSerialComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/QueuedSerialComponentAc.ref.cpp index 512fdf97d..e8c5f9f41 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/QueuedSerialComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/QueuedSerialComponentAc.ref.cpp @@ -133,21 +133,13 @@ void QueuedSerialComponentBase :: this->m_cmdIn_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdIn_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdIn_InputPort[port].setObjName(portName); + this->m_cmdIn_InputPort[port].setObjName(portName.toChar()); #endif } @@ -165,21 +157,13 @@ void QueuedSerialComponentBase :: this->m_noArgsAsync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsAsync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsAsync_InputPort[port].setObjName(portName); + this->m_noArgsAsync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -197,21 +181,13 @@ void QueuedSerialComponentBase :: this->m_noArgsGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsGuarded_InputPort[port].setObjName(portName); + this->m_noArgsGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -229,21 +205,13 @@ void QueuedSerialComponentBase :: this->m_noArgsReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName); + this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -261,21 +229,13 @@ void QueuedSerialComponentBase :: this->m_noArgsReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnSync_InputPort[port].setObjName(portName); + this->m_noArgsReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -293,21 +253,13 @@ void QueuedSerialComponentBase :: this->m_noArgsSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsSync_InputPort[port].setObjName(portName); + this->m_noArgsSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -325,21 +277,13 @@ void QueuedSerialComponentBase :: this->m_typedAsync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsync_InputPort[port].setObjName(portName); + this->m_typedAsync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -357,21 +301,13 @@ void QueuedSerialComponentBase :: this->m_typedAsyncAssert_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncAssert_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncAssert_InputPort[port].setObjName(portName); + this->m_typedAsyncAssert_InputPort[port].setObjName(portName.toChar()); #endif } @@ -389,21 +325,13 @@ void QueuedSerialComponentBase :: this->m_typedAsyncBlockPriority_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncBlockPriority_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncBlockPriority_InputPort[port].setObjName(portName); + this->m_typedAsyncBlockPriority_InputPort[port].setObjName(portName.toChar()); #endif } @@ -421,21 +349,13 @@ void QueuedSerialComponentBase :: this->m_typedAsyncDropPriority_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncDropPriority_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncDropPriority_InputPort[port].setObjName(portName); + this->m_typedAsyncDropPriority_InputPort[port].setObjName(portName.toChar()); #endif } @@ -453,21 +373,13 @@ void QueuedSerialComponentBase :: this->m_typedGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedGuarded_InputPort[port].setObjName(portName); + this->m_typedGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -485,21 +397,13 @@ void QueuedSerialComponentBase :: this->m_typedReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnGuarded_InputPort[port].setObjName(portName); + this->m_typedReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -517,21 +421,13 @@ void QueuedSerialComponentBase :: this->m_typedReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnSync_InputPort[port].setObjName(portName); + this->m_typedReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -549,21 +445,13 @@ void QueuedSerialComponentBase :: this->m_typedSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedSync_InputPort[port].setObjName(portName); + this->m_typedSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -581,21 +469,13 @@ void QueuedSerialComponentBase :: this->m_serialAsync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_serialAsync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_serialAsync_InputPort[port].setObjName(portName); + this->m_serialAsync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -613,21 +493,13 @@ void QueuedSerialComponentBase :: this->m_serialAsyncAssert_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_serialAsyncAssert_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_serialAsyncAssert_InputPort[port].setObjName(portName); + this->m_serialAsyncAssert_InputPort[port].setObjName(portName.toChar()); #endif } @@ -645,21 +517,13 @@ void QueuedSerialComponentBase :: this->m_serialAsyncBlockPriority_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_serialAsyncBlockPriority_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_serialAsyncBlockPriority_InputPort[port].setObjName(portName); + this->m_serialAsyncBlockPriority_InputPort[port].setObjName(portName.toChar()); #endif } @@ -677,21 +541,13 @@ void QueuedSerialComponentBase :: this->m_serialAsyncDropPriority_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_serialAsyncDropPriority_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_serialAsyncDropPriority_InputPort[port].setObjName(portName); + this->m_serialAsyncDropPriority_InputPort[port].setObjName(portName.toChar()); #endif } @@ -709,21 +565,13 @@ void QueuedSerialComponentBase :: this->m_serialGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_serialGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_serialGuarded_InputPort[port].setObjName(portName); + this->m_serialGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -741,21 +589,13 @@ void QueuedSerialComponentBase :: this->m_serialSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_serialSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_serialSync_InputPort[port].setObjName(portName); + this->m_serialSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -768,21 +608,13 @@ void QueuedSerialComponentBase :: this->m_cmdRegOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdRegOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdRegOut_OutputPort[port].setObjName(portName); + this->m_cmdRegOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -795,21 +627,13 @@ void QueuedSerialComponentBase :: this->m_cmdResponseOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdResponseOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdResponseOut_OutputPort[port].setObjName(portName); + this->m_cmdResponseOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -822,21 +646,13 @@ void QueuedSerialComponentBase :: this->m_eventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_eventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_eventOut_OutputPort[port].setObjName(portName); + this->m_eventOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -849,21 +665,13 @@ void QueuedSerialComponentBase :: this->m_prmGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmGetOut_OutputPort[port].setObjName(portName); + this->m_prmGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -876,21 +684,13 @@ void QueuedSerialComponentBase :: this->m_prmSetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmSetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmSetOut_OutputPort[port].setObjName(portName); + this->m_prmSetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -904,21 +704,13 @@ void QueuedSerialComponentBase :: this->m_textEventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_textEventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_textEventOut_OutputPort[port].setObjName(portName); + this->m_textEventOut_OutputPort[port].setObjName(portName.toChar()); #endif } #endif @@ -932,21 +724,13 @@ void QueuedSerialComponentBase :: this->m_timeGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_timeGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_timeGetOut_OutputPort[port].setObjName(portName); + this->m_timeGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -959,21 +743,13 @@ void QueuedSerialComponentBase :: this->m_tlmOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_tlmOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_tlmOut_OutputPort[port].setObjName(portName); + this->m_tlmOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -986,21 +762,13 @@ void QueuedSerialComponentBase :: this->m_noArgsOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsOut_OutputPort[port].setObjName(portName); + this->m_noArgsOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -1013,21 +781,13 @@ void QueuedSerialComponentBase :: this->m_noArgsReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnOut_OutputPort[port].setObjName(portName); + this->m_noArgsReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -1040,21 +800,13 @@ void QueuedSerialComponentBase :: this->m_typedOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedOut_OutputPort[port].setObjName(portName); + this->m_typedOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -1067,21 +819,13 @@ void QueuedSerialComponentBase :: this->m_typedReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnOut_OutputPort[port].setObjName(portName); + this->m_typedReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -1094,21 +838,13 @@ void QueuedSerialComponentBase :: this->m_serialOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_serialOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_serialOut_OutputPort[port].setObjName(portName); + this->m_serialOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -4915,7 +4651,7 @@ void QueuedSerialComponentBase :: FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventActivityHigh " ); @@ -5046,7 +4782,7 @@ void QueuedSerialComponentBase :: FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventActivityLowThrottled ", u32, @@ -5135,7 +4871,7 @@ void QueuedSerialComponentBase :: FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventCommand ", str1.toChar(), @@ -5227,7 +4963,7 @@ void QueuedSerialComponentBase :: FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventDiagnostic ", eStr.toChar() @@ -5339,7 +5075,7 @@ void QueuedSerialComponentBase :: FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventFatalThrottled ", aStr.toChar() @@ -5430,7 +5166,7 @@ void QueuedSerialComponentBase :: FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventWarningHigh ", sStr.toChar() @@ -5510,7 +5246,7 @@ void QueuedSerialComponentBase :: FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventWarningLowThrottled " ); diff --git a/compiler/tools/fpp-to-cpp/test/component/base/QueuedSyncProductsComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/QueuedSyncProductsComponentAc.ref.cpp index f1d30f2af..3373d2852 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/QueuedSyncProductsComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/QueuedSyncProductsComponentAc.ref.cpp @@ -249,21 +249,13 @@ void QueuedSyncProductsComponentBase :: this->m_cmdIn_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdIn_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdIn_InputPort[port].setObjName(portName); + this->m_cmdIn_InputPort[port].setObjName(portName.toChar()); #endif } @@ -281,21 +273,13 @@ void QueuedSyncProductsComponentBase :: this->m_productRecvIn_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_productRecvIn_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_productRecvIn_InputPort[port].setObjName(portName); + this->m_productRecvIn_InputPort[port].setObjName(portName.toChar()); #endif } @@ -313,21 +297,13 @@ void QueuedSyncProductsComponentBase :: this->m_noArgsAsync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsAsync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsAsync_InputPort[port].setObjName(portName); + this->m_noArgsAsync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -345,21 +321,13 @@ void QueuedSyncProductsComponentBase :: this->m_noArgsGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsGuarded_InputPort[port].setObjName(portName); + this->m_noArgsGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -377,21 +345,13 @@ void QueuedSyncProductsComponentBase :: this->m_noArgsReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName); + this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -409,21 +369,13 @@ void QueuedSyncProductsComponentBase :: this->m_noArgsReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnSync_InputPort[port].setObjName(portName); + this->m_noArgsReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -441,21 +393,13 @@ void QueuedSyncProductsComponentBase :: this->m_noArgsSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsSync_InputPort[port].setObjName(portName); + this->m_noArgsSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -473,21 +417,13 @@ void QueuedSyncProductsComponentBase :: this->m_typedAsync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsync_InputPort[port].setObjName(portName); + this->m_typedAsync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -505,21 +441,13 @@ void QueuedSyncProductsComponentBase :: this->m_typedAsyncAssert_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncAssert_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncAssert_InputPort[port].setObjName(portName); + this->m_typedAsyncAssert_InputPort[port].setObjName(portName.toChar()); #endif } @@ -537,21 +465,13 @@ void QueuedSyncProductsComponentBase :: this->m_typedAsyncBlockPriority_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncBlockPriority_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncBlockPriority_InputPort[port].setObjName(portName); + this->m_typedAsyncBlockPriority_InputPort[port].setObjName(portName.toChar()); #endif } @@ -569,21 +489,13 @@ void QueuedSyncProductsComponentBase :: this->m_typedAsyncDropPriority_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncDropPriority_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncDropPriority_InputPort[port].setObjName(portName); + this->m_typedAsyncDropPriority_InputPort[port].setObjName(portName.toChar()); #endif } @@ -601,21 +513,13 @@ void QueuedSyncProductsComponentBase :: this->m_typedGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedGuarded_InputPort[port].setObjName(portName); + this->m_typedGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -633,21 +537,13 @@ void QueuedSyncProductsComponentBase :: this->m_typedReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnGuarded_InputPort[port].setObjName(portName); + this->m_typedReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -665,21 +561,13 @@ void QueuedSyncProductsComponentBase :: this->m_typedReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnSync_InputPort[port].setObjName(portName); + this->m_typedReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -697,21 +585,13 @@ void QueuedSyncProductsComponentBase :: this->m_typedSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedSync_InputPort[port].setObjName(portName); + this->m_typedSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -724,21 +604,13 @@ void QueuedSyncProductsComponentBase :: this->m_cmdRegOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdRegOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdRegOut_OutputPort[port].setObjName(portName); + this->m_cmdRegOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -751,21 +623,13 @@ void QueuedSyncProductsComponentBase :: this->m_cmdResponseOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdResponseOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdResponseOut_OutputPort[port].setObjName(portName); + this->m_cmdResponseOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -778,21 +642,13 @@ void QueuedSyncProductsComponentBase :: this->m_eventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_eventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_eventOut_OutputPort[port].setObjName(portName); + this->m_eventOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -805,21 +661,13 @@ void QueuedSyncProductsComponentBase :: this->m_prmGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmGetOut_OutputPort[port].setObjName(portName); + this->m_prmGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -832,21 +680,13 @@ void QueuedSyncProductsComponentBase :: this->m_prmSetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmSetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmSetOut_OutputPort[port].setObjName(portName); + this->m_prmSetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -859,21 +699,13 @@ void QueuedSyncProductsComponentBase :: this->m_productRequestOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_productRequestOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_productRequestOut_OutputPort[port].setObjName(portName); + this->m_productRequestOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -886,21 +718,13 @@ void QueuedSyncProductsComponentBase :: this->m_productSendOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_productSendOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_productSendOut_OutputPort[port].setObjName(portName); + this->m_productSendOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -914,21 +738,13 @@ void QueuedSyncProductsComponentBase :: this->m_textEventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_textEventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_textEventOut_OutputPort[port].setObjName(portName); + this->m_textEventOut_OutputPort[port].setObjName(portName.toChar()); #endif } #endif @@ -942,21 +758,13 @@ void QueuedSyncProductsComponentBase :: this->m_timeGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_timeGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_timeGetOut_OutputPort[port].setObjName(portName); + this->m_timeGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -969,21 +777,13 @@ void QueuedSyncProductsComponentBase :: this->m_tlmOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_tlmOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_tlmOut_OutputPort[port].setObjName(portName); + this->m_tlmOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -996,21 +796,13 @@ void QueuedSyncProductsComponentBase :: this->m_noArgsOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsOut_OutputPort[port].setObjName(portName); + this->m_noArgsOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -1023,21 +815,13 @@ void QueuedSyncProductsComponentBase :: this->m_noArgsReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnOut_OutputPort[port].setObjName(portName); + this->m_noArgsReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -1050,21 +834,13 @@ void QueuedSyncProductsComponentBase :: this->m_typedOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedOut_OutputPort[port].setObjName(portName); + this->m_typedOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -1077,21 +853,13 @@ void QueuedSyncProductsComponentBase :: this->m_typedReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnOut_OutputPort[port].setObjName(portName); + this->m_typedReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } diff --git a/compiler/tools/fpp-to-cpp/test/component/base/QueuedTelemetryComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/QueuedTelemetryComponentAc.ref.cpp index ca20261ab..caa8c23e0 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/QueuedTelemetryComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/QueuedTelemetryComponentAc.ref.cpp @@ -94,21 +94,13 @@ void QueuedTelemetryComponentBase :: this->m_cmdIn_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdIn_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdIn_InputPort[port].setObjName(portName); + this->m_cmdIn_InputPort[port].setObjName(portName.toChar()); #endif } @@ -126,21 +118,13 @@ void QueuedTelemetryComponentBase :: this->m_noArgsAsync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsAsync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsAsync_InputPort[port].setObjName(portName); + this->m_noArgsAsync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -158,21 +142,13 @@ void QueuedTelemetryComponentBase :: this->m_noArgsGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsGuarded_InputPort[port].setObjName(portName); + this->m_noArgsGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -190,21 +166,13 @@ void QueuedTelemetryComponentBase :: this->m_noArgsReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName); + this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -222,21 +190,13 @@ void QueuedTelemetryComponentBase :: this->m_noArgsReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnSync_InputPort[port].setObjName(portName); + this->m_noArgsReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -254,21 +214,13 @@ void QueuedTelemetryComponentBase :: this->m_noArgsSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsSync_InputPort[port].setObjName(portName); + this->m_noArgsSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -286,21 +238,13 @@ void QueuedTelemetryComponentBase :: this->m_typedAsync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsync_InputPort[port].setObjName(portName); + this->m_typedAsync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -318,21 +262,13 @@ void QueuedTelemetryComponentBase :: this->m_typedAsyncAssert_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncAssert_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncAssert_InputPort[port].setObjName(portName); + this->m_typedAsyncAssert_InputPort[port].setObjName(portName.toChar()); #endif } @@ -350,21 +286,13 @@ void QueuedTelemetryComponentBase :: this->m_typedAsyncBlockPriority_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncBlockPriority_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncBlockPriority_InputPort[port].setObjName(portName); + this->m_typedAsyncBlockPriority_InputPort[port].setObjName(portName.toChar()); #endif } @@ -382,21 +310,13 @@ void QueuedTelemetryComponentBase :: this->m_typedAsyncDropPriority_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncDropPriority_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncDropPriority_InputPort[port].setObjName(portName); + this->m_typedAsyncDropPriority_InputPort[port].setObjName(portName.toChar()); #endif } @@ -414,21 +334,13 @@ void QueuedTelemetryComponentBase :: this->m_typedGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedGuarded_InputPort[port].setObjName(portName); + this->m_typedGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -446,21 +358,13 @@ void QueuedTelemetryComponentBase :: this->m_typedReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnGuarded_InputPort[port].setObjName(portName); + this->m_typedReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -478,21 +382,13 @@ void QueuedTelemetryComponentBase :: this->m_typedReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnSync_InputPort[port].setObjName(portName); + this->m_typedReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -510,21 +406,13 @@ void QueuedTelemetryComponentBase :: this->m_typedSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedSync_InputPort[port].setObjName(portName); + this->m_typedSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -537,21 +425,13 @@ void QueuedTelemetryComponentBase :: this->m_cmdRegOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdRegOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdRegOut_OutputPort[port].setObjName(portName); + this->m_cmdRegOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -564,21 +444,13 @@ void QueuedTelemetryComponentBase :: this->m_cmdResponseOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdResponseOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdResponseOut_OutputPort[port].setObjName(portName); + this->m_cmdResponseOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -591,21 +463,13 @@ void QueuedTelemetryComponentBase :: this->m_eventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_eventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_eventOut_OutputPort[port].setObjName(portName); + this->m_eventOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -618,21 +482,13 @@ void QueuedTelemetryComponentBase :: this->m_prmGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmGetOut_OutputPort[port].setObjName(portName); + this->m_prmGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -645,21 +501,13 @@ void QueuedTelemetryComponentBase :: this->m_prmSetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmSetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmSetOut_OutputPort[port].setObjName(portName); + this->m_prmSetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -673,21 +521,13 @@ void QueuedTelemetryComponentBase :: this->m_textEventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_textEventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_textEventOut_OutputPort[port].setObjName(portName); + this->m_textEventOut_OutputPort[port].setObjName(portName.toChar()); #endif } #endif @@ -701,21 +541,13 @@ void QueuedTelemetryComponentBase :: this->m_timeGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_timeGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_timeGetOut_OutputPort[port].setObjName(portName); + this->m_timeGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -728,21 +560,13 @@ void QueuedTelemetryComponentBase :: this->m_tlmOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_tlmOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_tlmOut_OutputPort[port].setObjName(portName); + this->m_tlmOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -755,21 +579,13 @@ void QueuedTelemetryComponentBase :: this->m_noArgsOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsOut_OutputPort[port].setObjName(portName); + this->m_noArgsOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -782,21 +598,13 @@ void QueuedTelemetryComponentBase :: this->m_noArgsReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnOut_OutputPort[port].setObjName(portName); + this->m_noArgsReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -809,21 +617,13 @@ void QueuedTelemetryComponentBase :: this->m_typedOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedOut_OutputPort[port].setObjName(portName); + this->m_typedOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -836,21 +636,13 @@ void QueuedTelemetryComponentBase :: this->m_typedReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnOut_OutputPort[port].setObjName(portName); + this->m_typedReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } diff --git a/compiler/tools/fpp-to-cpp/test/component/base/QueuedTestComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/QueuedTestComponentAc.ref.cpp index 4c05688df..0372ce4e0 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/QueuedTestComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/QueuedTestComponentAc.ref.cpp @@ -285,21 +285,13 @@ void QueuedTestComponentBase :: this->m_cmdIn_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdIn_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdIn_InputPort[port].setObjName(portName); + this->m_cmdIn_InputPort[port].setObjName(portName.toChar()); #endif } @@ -317,21 +309,13 @@ void QueuedTestComponentBase :: this->m_productRecvIn_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_productRecvIn_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_productRecvIn_InputPort[port].setObjName(portName); + this->m_productRecvIn_InputPort[port].setObjName(portName.toChar()); #endif } @@ -349,21 +333,13 @@ void QueuedTestComponentBase :: this->m_noArgsAsync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsAsync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsAsync_InputPort[port].setObjName(portName); + this->m_noArgsAsync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -381,21 +357,13 @@ void QueuedTestComponentBase :: this->m_noArgsGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsGuarded_InputPort[port].setObjName(portName); + this->m_noArgsGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -413,21 +381,13 @@ void QueuedTestComponentBase :: this->m_noArgsReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName); + this->m_noArgsReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -445,21 +405,13 @@ void QueuedTestComponentBase :: this->m_noArgsReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnSync_InputPort[port].setObjName(portName); + this->m_noArgsReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -477,21 +429,13 @@ void QueuedTestComponentBase :: this->m_noArgsSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsSync_InputPort[port].setObjName(portName); + this->m_noArgsSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -509,21 +453,13 @@ void QueuedTestComponentBase :: this->m_typedAsync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsync_InputPort[port].setObjName(portName); + this->m_typedAsync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -541,21 +477,13 @@ void QueuedTestComponentBase :: this->m_typedAsyncAssert_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncAssert_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncAssert_InputPort[port].setObjName(portName); + this->m_typedAsyncAssert_InputPort[port].setObjName(portName.toChar()); #endif } @@ -573,21 +501,13 @@ void QueuedTestComponentBase :: this->m_typedAsyncBlockPriority_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncBlockPriority_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncBlockPriority_InputPort[port].setObjName(portName); + this->m_typedAsyncBlockPriority_InputPort[port].setObjName(portName.toChar()); #endif } @@ -605,21 +525,13 @@ void QueuedTestComponentBase :: this->m_typedAsyncDropPriority_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedAsyncDropPriority_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedAsyncDropPriority_InputPort[port].setObjName(portName); + this->m_typedAsyncDropPriority_InputPort[port].setObjName(portName.toChar()); #endif } @@ -637,21 +549,13 @@ void QueuedTestComponentBase :: this->m_typedGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedGuarded_InputPort[port].setObjName(portName); + this->m_typedGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -669,21 +573,13 @@ void QueuedTestComponentBase :: this->m_typedReturnGuarded_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnGuarded_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnGuarded_InputPort[port].setObjName(portName); + this->m_typedReturnGuarded_InputPort[port].setObjName(portName.toChar()); #endif } @@ -701,21 +597,13 @@ void QueuedTestComponentBase :: this->m_typedReturnSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnSync_InputPort[port].setObjName(portName); + this->m_typedReturnSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -733,21 +621,13 @@ void QueuedTestComponentBase :: this->m_typedSync_InputPort[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedSync_InputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedSync_InputPort[port].setObjName(portName); + this->m_typedSync_InputPort[port].setObjName(portName.toChar()); #endif } @@ -760,21 +640,13 @@ void QueuedTestComponentBase :: this->m_cmdRegOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdRegOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdRegOut_OutputPort[port].setObjName(portName); + this->m_cmdRegOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -787,21 +659,13 @@ void QueuedTestComponentBase :: this->m_cmdResponseOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_cmdResponseOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_cmdResponseOut_OutputPort[port].setObjName(portName); + this->m_cmdResponseOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -814,21 +678,13 @@ void QueuedTestComponentBase :: this->m_eventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_eventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_eventOut_OutputPort[port].setObjName(portName); + this->m_eventOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -841,21 +697,13 @@ void QueuedTestComponentBase :: this->m_prmGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmGetOut_OutputPort[port].setObjName(portName); + this->m_prmGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -868,21 +716,13 @@ void QueuedTestComponentBase :: this->m_prmSetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_prmSetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_prmSetOut_OutputPort[port].setObjName(portName); + this->m_prmSetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -895,21 +735,13 @@ void QueuedTestComponentBase :: this->m_productRequestOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_productRequestOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_productRequestOut_OutputPort[port].setObjName(portName); + this->m_productRequestOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -922,21 +754,13 @@ void QueuedTestComponentBase :: this->m_productSendOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_productSendOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_productSendOut_OutputPort[port].setObjName(portName); + this->m_productSendOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -950,21 +774,13 @@ void QueuedTestComponentBase :: this->m_textEventOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_textEventOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_textEventOut_OutputPort[port].setObjName(portName); + this->m_textEventOut_OutputPort[port].setObjName(portName.toChar()); #endif } #endif @@ -978,21 +794,13 @@ void QueuedTestComponentBase :: this->m_timeGetOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_timeGetOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_timeGetOut_OutputPort[port].setObjName(portName); + this->m_timeGetOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -1005,21 +813,13 @@ void QueuedTestComponentBase :: this->m_tlmOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_tlmOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_tlmOut_OutputPort[port].setObjName(portName); + this->m_tlmOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -1032,21 +832,13 @@ void QueuedTestComponentBase :: this->m_noArgsOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsOut_OutputPort[port].setObjName(portName); + this->m_noArgsOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -1059,21 +851,13 @@ void QueuedTestComponentBase :: this->m_noArgsReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_noArgsReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_noArgsReturnOut_OutputPort[port].setObjName(portName); + this->m_noArgsReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -1086,21 +870,13 @@ void QueuedTestComponentBase :: this->m_typedOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedOut_OutputPort[port].setObjName(portName); + this->m_typedOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -1113,21 +889,13 @@ void QueuedTestComponentBase :: this->m_typedReturnOut_OutputPort[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_typedReturnOut_OutputPort[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_typedReturnOut_OutputPort[port].setObjName(portName); + this->m_typedReturnOut_OutputPort[port].setObjName(portName.toChar()); #endif } @@ -4694,7 +4462,7 @@ void QueuedTestComponentBase :: FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventActivityHigh " ); @@ -4825,7 +4593,7 @@ void QueuedTestComponentBase :: FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventActivityLowThrottled ", u32, @@ -4914,7 +4682,7 @@ void QueuedTestComponentBase :: FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventCommand ", str1.toChar(), @@ -5006,7 +4774,7 @@ void QueuedTestComponentBase :: FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventDiagnostic ", eStr.toChar() @@ -5118,7 +4886,7 @@ void QueuedTestComponentBase :: FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventFatalThrottled ", aStr.toChar() @@ -5209,7 +4977,7 @@ void QueuedTestComponentBase :: FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventWarningHigh ", sStr.toChar() @@ -5289,7 +5057,7 @@ void QueuedTestComponentBase :: FW_LOG_TEXT_BUFFER_SIZE, _formatString, #if FW_OBJECT_NAMES == 1 - this->m_objName, + this->m_objName.toChar(), #endif "EventWarningLowThrottled " ); diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveAsyncProductsTesterBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveAsyncProductsTesterBase.ref.cpp index 843f9ed4d..ab67977bf 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveAsyncProductsTesterBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveAsyncProductsTesterBase.ref.cpp @@ -33,21 +33,13 @@ void ActiveAsyncProductsTesterBase :: this->m_from_productRequestOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_productRequestOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_productRequestOut[port].setObjName(portName); + this->m_from_productRequestOut[port].setObjName(portName.toChar()); #endif } @@ -65,21 +57,13 @@ void ActiveAsyncProductsTesterBase :: this->m_from_productSendOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_productSendOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_productSendOut[port].setObjName(portName); + this->m_from_productSendOut[port].setObjName(portName.toChar()); #endif } @@ -97,21 +81,13 @@ void ActiveAsyncProductsTesterBase :: this->m_from_timeGetOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_timeGetOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_timeGetOut[port].setObjName(portName); + this->m_from_timeGetOut[port].setObjName(portName.toChar()); #endif } @@ -129,21 +105,13 @@ void ActiveAsyncProductsTesterBase :: this->m_from_noArgsOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsOut[port].setObjName(portName); + this->m_from_noArgsOut[port].setObjName(portName.toChar()); #endif } @@ -161,21 +129,13 @@ void ActiveAsyncProductsTesterBase :: this->m_from_noArgsReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsReturnOut[port].setObjName(portName); + this->m_from_noArgsReturnOut[port].setObjName(portName.toChar()); #endif } @@ -193,21 +153,13 @@ void ActiveAsyncProductsTesterBase :: this->m_from_typedOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedOut[port].setObjName(portName); + this->m_from_typedOut[port].setObjName(portName.toChar()); #endif } @@ -225,21 +177,13 @@ void ActiveAsyncProductsTesterBase :: this->m_from_typedReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedReturnOut[port].setObjName(portName); + this->m_from_typedReturnOut[port].setObjName(portName.toChar()); #endif } @@ -252,21 +196,13 @@ void ActiveAsyncProductsTesterBase :: this->m_to_productRecvIn[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_productRecvIn[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_productRecvIn[port].setObjName(portName); + this->m_to_productRecvIn[port].setObjName(portName.toChar()); #endif } @@ -279,21 +215,13 @@ void ActiveAsyncProductsTesterBase :: this->m_to_noArgsAsync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsAsync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsAsync[port].setObjName(portName); + this->m_to_noArgsAsync[port].setObjName(portName.toChar()); #endif } @@ -306,21 +234,13 @@ void ActiveAsyncProductsTesterBase :: this->m_to_noArgsGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsGuarded[port].setObjName(portName); + this->m_to_noArgsGuarded[port].setObjName(portName.toChar()); #endif } @@ -333,21 +253,13 @@ void ActiveAsyncProductsTesterBase :: this->m_to_noArgsReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnGuarded[port].setObjName(portName); + this->m_to_noArgsReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -360,21 +272,13 @@ void ActiveAsyncProductsTesterBase :: this->m_to_noArgsReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnSync[port].setObjName(portName); + this->m_to_noArgsReturnSync[port].setObjName(portName.toChar()); #endif } @@ -387,21 +291,13 @@ void ActiveAsyncProductsTesterBase :: this->m_to_noArgsSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsSync[port].setObjName(portName); + this->m_to_noArgsSync[port].setObjName(portName.toChar()); #endif } @@ -414,21 +310,13 @@ void ActiveAsyncProductsTesterBase :: this->m_to_typedAsync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsync[port].setObjName(portName); + this->m_to_typedAsync[port].setObjName(portName.toChar()); #endif } @@ -441,21 +329,13 @@ void ActiveAsyncProductsTesterBase :: this->m_to_typedAsyncAssert[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncAssert[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncAssert[port].setObjName(portName); + this->m_to_typedAsyncAssert[port].setObjName(portName.toChar()); #endif } @@ -468,21 +348,13 @@ void ActiveAsyncProductsTesterBase :: this->m_to_typedAsyncBlockPriority[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncBlockPriority[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncBlockPriority[port].setObjName(portName); + this->m_to_typedAsyncBlockPriority[port].setObjName(portName.toChar()); #endif } @@ -495,21 +367,13 @@ void ActiveAsyncProductsTesterBase :: this->m_to_typedAsyncDropPriority[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncDropPriority[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncDropPriority[port].setObjName(portName); + this->m_to_typedAsyncDropPriority[port].setObjName(portName.toChar()); #endif } @@ -522,21 +386,13 @@ void ActiveAsyncProductsTesterBase :: this->m_to_typedGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedGuarded[port].setObjName(portName); + this->m_to_typedGuarded[port].setObjName(portName.toChar()); #endif } @@ -549,21 +405,13 @@ void ActiveAsyncProductsTesterBase :: this->m_to_typedReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnGuarded[port].setObjName(portName); + this->m_to_typedReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -576,21 +424,13 @@ void ActiveAsyncProductsTesterBase :: this->m_to_typedReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnSync[port].setObjName(portName); + this->m_to_typedReturnSync[port].setObjName(portName.toChar()); #endif } @@ -603,21 +443,13 @@ void ActiveAsyncProductsTesterBase :: this->m_to_typedSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedSync[port].setObjName(portName); + this->m_to_typedSync[port].setObjName(portName.toChar()); #endif } } diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveCommandsTesterBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveCommandsTesterBase.ref.cpp index e3f25324a..cb01fa1bf 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveCommandsTesterBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveCommandsTesterBase.ref.cpp @@ -33,21 +33,13 @@ void ActiveCommandsTesterBase :: this->m_from_cmdRegOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_cmdRegOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_cmdRegOut[port].setObjName(portName); + this->m_from_cmdRegOut[port].setObjName(portName.toChar()); #endif } @@ -65,21 +57,13 @@ void ActiveCommandsTesterBase :: this->m_from_cmdResponseOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_cmdResponseOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_cmdResponseOut[port].setObjName(portName); + this->m_from_cmdResponseOut[port].setObjName(portName.toChar()); #endif } @@ -97,21 +81,13 @@ void ActiveCommandsTesterBase :: this->m_from_timeGetOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_timeGetOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_timeGetOut[port].setObjName(portName); + this->m_from_timeGetOut[port].setObjName(portName.toChar()); #endif } @@ -129,21 +105,13 @@ void ActiveCommandsTesterBase :: this->m_from_noArgsOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsOut[port].setObjName(portName); + this->m_from_noArgsOut[port].setObjName(portName.toChar()); #endif } @@ -161,21 +129,13 @@ void ActiveCommandsTesterBase :: this->m_from_noArgsReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsReturnOut[port].setObjName(portName); + this->m_from_noArgsReturnOut[port].setObjName(portName.toChar()); #endif } @@ -193,21 +153,13 @@ void ActiveCommandsTesterBase :: this->m_from_typedOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedOut[port].setObjName(portName); + this->m_from_typedOut[port].setObjName(portName.toChar()); #endif } @@ -225,21 +177,13 @@ void ActiveCommandsTesterBase :: this->m_from_typedReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedReturnOut[port].setObjName(portName); + this->m_from_typedReturnOut[port].setObjName(portName.toChar()); #endif } @@ -252,21 +196,13 @@ void ActiveCommandsTesterBase :: this->m_to_cmdIn[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_cmdIn[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_cmdIn[port].setObjName(portName); + this->m_to_cmdIn[port].setObjName(portName.toChar()); #endif } @@ -279,21 +215,13 @@ void ActiveCommandsTesterBase :: this->m_to_noArgsAsync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsAsync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsAsync[port].setObjName(portName); + this->m_to_noArgsAsync[port].setObjName(portName.toChar()); #endif } @@ -306,21 +234,13 @@ void ActiveCommandsTesterBase :: this->m_to_noArgsGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsGuarded[port].setObjName(portName); + this->m_to_noArgsGuarded[port].setObjName(portName.toChar()); #endif } @@ -333,21 +253,13 @@ void ActiveCommandsTesterBase :: this->m_to_noArgsReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnGuarded[port].setObjName(portName); + this->m_to_noArgsReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -360,21 +272,13 @@ void ActiveCommandsTesterBase :: this->m_to_noArgsReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnSync[port].setObjName(portName); + this->m_to_noArgsReturnSync[port].setObjName(portName.toChar()); #endif } @@ -387,21 +291,13 @@ void ActiveCommandsTesterBase :: this->m_to_noArgsSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsSync[port].setObjName(portName); + this->m_to_noArgsSync[port].setObjName(portName.toChar()); #endif } @@ -414,21 +310,13 @@ void ActiveCommandsTesterBase :: this->m_to_typedAsync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsync[port].setObjName(portName); + this->m_to_typedAsync[port].setObjName(portName.toChar()); #endif } @@ -441,21 +329,13 @@ void ActiveCommandsTesterBase :: this->m_to_typedAsyncAssert[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncAssert[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncAssert[port].setObjName(portName); + this->m_to_typedAsyncAssert[port].setObjName(portName.toChar()); #endif } @@ -468,21 +348,13 @@ void ActiveCommandsTesterBase :: this->m_to_typedAsyncBlockPriority[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncBlockPriority[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncBlockPriority[port].setObjName(portName); + this->m_to_typedAsyncBlockPriority[port].setObjName(portName.toChar()); #endif } @@ -495,21 +367,13 @@ void ActiveCommandsTesterBase :: this->m_to_typedAsyncDropPriority[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncDropPriority[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncDropPriority[port].setObjName(portName); + this->m_to_typedAsyncDropPriority[port].setObjName(portName.toChar()); #endif } @@ -522,21 +386,13 @@ void ActiveCommandsTesterBase :: this->m_to_typedGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedGuarded[port].setObjName(portName); + this->m_to_typedGuarded[port].setObjName(portName.toChar()); #endif } @@ -549,21 +405,13 @@ void ActiveCommandsTesterBase :: this->m_to_typedReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnGuarded[port].setObjName(portName); + this->m_to_typedReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -576,21 +424,13 @@ void ActiveCommandsTesterBase :: this->m_to_typedReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnSync[port].setObjName(portName); + this->m_to_typedReturnSync[port].setObjName(portName.toChar()); #endif } @@ -603,21 +443,13 @@ void ActiveCommandsTesterBase :: this->m_to_typedSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedSync[port].setObjName(portName); + this->m_to_typedSync[port].setObjName(portName.toChar()); #endif } } diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveEventsTesterBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveEventsTesterBase.ref.cpp index d9516eeff..f8084b07b 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveEventsTesterBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveEventsTesterBase.ref.cpp @@ -33,21 +33,13 @@ void ActiveEventsTesterBase :: this->m_from_eventOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_eventOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_eventOut[port].setObjName(portName); + this->m_from_eventOut[port].setObjName(portName.toChar()); #endif } @@ -66,21 +58,13 @@ void ActiveEventsTesterBase :: this->m_from_textEventOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_textEventOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_textEventOut[port].setObjName(portName); + this->m_from_textEventOut[port].setObjName(portName.toChar()); #endif } #endif @@ -99,21 +83,13 @@ void ActiveEventsTesterBase :: this->m_from_timeGetOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_timeGetOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_timeGetOut[port].setObjName(portName); + this->m_from_timeGetOut[port].setObjName(portName.toChar()); #endif } @@ -131,21 +107,13 @@ void ActiveEventsTesterBase :: this->m_from_noArgsOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsOut[port].setObjName(portName); + this->m_from_noArgsOut[port].setObjName(portName.toChar()); #endif } @@ -163,21 +131,13 @@ void ActiveEventsTesterBase :: this->m_from_noArgsReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsReturnOut[port].setObjName(portName); + this->m_from_noArgsReturnOut[port].setObjName(portName.toChar()); #endif } @@ -195,21 +155,13 @@ void ActiveEventsTesterBase :: this->m_from_typedOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedOut[port].setObjName(portName); + this->m_from_typedOut[port].setObjName(portName.toChar()); #endif } @@ -227,21 +179,13 @@ void ActiveEventsTesterBase :: this->m_from_typedReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedReturnOut[port].setObjName(portName); + this->m_from_typedReturnOut[port].setObjName(portName.toChar()); #endif } @@ -254,21 +198,13 @@ void ActiveEventsTesterBase :: this->m_to_noArgsAsync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsAsync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsAsync[port].setObjName(portName); + this->m_to_noArgsAsync[port].setObjName(portName.toChar()); #endif } @@ -281,21 +217,13 @@ void ActiveEventsTesterBase :: this->m_to_noArgsGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsGuarded[port].setObjName(portName); + this->m_to_noArgsGuarded[port].setObjName(portName.toChar()); #endif } @@ -308,21 +236,13 @@ void ActiveEventsTesterBase :: this->m_to_noArgsReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnGuarded[port].setObjName(portName); + this->m_to_noArgsReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -335,21 +255,13 @@ void ActiveEventsTesterBase :: this->m_to_noArgsReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnSync[port].setObjName(portName); + this->m_to_noArgsReturnSync[port].setObjName(portName.toChar()); #endif } @@ -362,21 +274,13 @@ void ActiveEventsTesterBase :: this->m_to_noArgsSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsSync[port].setObjName(portName); + this->m_to_noArgsSync[port].setObjName(portName.toChar()); #endif } @@ -389,21 +293,13 @@ void ActiveEventsTesterBase :: this->m_to_typedAsync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsync[port].setObjName(portName); + this->m_to_typedAsync[port].setObjName(portName.toChar()); #endif } @@ -416,21 +312,13 @@ void ActiveEventsTesterBase :: this->m_to_typedAsyncAssert[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncAssert[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncAssert[port].setObjName(portName); + this->m_to_typedAsyncAssert[port].setObjName(portName.toChar()); #endif } @@ -443,21 +331,13 @@ void ActiveEventsTesterBase :: this->m_to_typedAsyncBlockPriority[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncBlockPriority[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncBlockPriority[port].setObjName(portName); + this->m_to_typedAsyncBlockPriority[port].setObjName(portName.toChar()); #endif } @@ -470,21 +350,13 @@ void ActiveEventsTesterBase :: this->m_to_typedAsyncDropPriority[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncDropPriority[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncDropPriority[port].setObjName(portName); + this->m_to_typedAsyncDropPriority[port].setObjName(portName.toChar()); #endif } @@ -497,21 +369,13 @@ void ActiveEventsTesterBase :: this->m_to_typedGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedGuarded[port].setObjName(portName); + this->m_to_typedGuarded[port].setObjName(portName.toChar()); #endif } @@ -524,21 +388,13 @@ void ActiveEventsTesterBase :: this->m_to_typedReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnGuarded[port].setObjName(portName); + this->m_to_typedReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -551,21 +407,13 @@ void ActiveEventsTesterBase :: this->m_to_typedReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnSync[port].setObjName(portName); + this->m_to_typedReturnSync[port].setObjName(portName.toChar()); #endif } @@ -578,21 +426,13 @@ void ActiveEventsTesterBase :: this->m_to_typedSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedSync[port].setObjName(portName); + this->m_to_typedSync[port].setObjName(portName.toChar()); #endif } } diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveGetProductsTesterBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveGetProductsTesterBase.ref.cpp index e985338b5..1fea0756b 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveGetProductsTesterBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveGetProductsTesterBase.ref.cpp @@ -33,21 +33,13 @@ void ActiveGetProductsTesterBase :: this->m_from_productGetOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_productGetOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_productGetOut[port].setObjName(portName); + this->m_from_productGetOut[port].setObjName(portName.toChar()); #endif } @@ -65,21 +57,13 @@ void ActiveGetProductsTesterBase :: this->m_from_productSendOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_productSendOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_productSendOut[port].setObjName(portName); + this->m_from_productSendOut[port].setObjName(portName.toChar()); #endif } @@ -97,21 +81,13 @@ void ActiveGetProductsTesterBase :: this->m_from_timeGetOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_timeGetOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_timeGetOut[port].setObjName(portName); + this->m_from_timeGetOut[port].setObjName(portName.toChar()); #endif } @@ -129,21 +105,13 @@ void ActiveGetProductsTesterBase :: this->m_from_noArgsOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsOut[port].setObjName(portName); + this->m_from_noArgsOut[port].setObjName(portName.toChar()); #endif } @@ -161,21 +129,13 @@ void ActiveGetProductsTesterBase :: this->m_from_noArgsReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsReturnOut[port].setObjName(portName); + this->m_from_noArgsReturnOut[port].setObjName(portName.toChar()); #endif } @@ -193,21 +153,13 @@ void ActiveGetProductsTesterBase :: this->m_from_typedOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedOut[port].setObjName(portName); + this->m_from_typedOut[port].setObjName(portName.toChar()); #endif } @@ -225,21 +177,13 @@ void ActiveGetProductsTesterBase :: this->m_from_typedReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedReturnOut[port].setObjName(portName); + this->m_from_typedReturnOut[port].setObjName(portName.toChar()); #endif } @@ -252,21 +196,13 @@ void ActiveGetProductsTesterBase :: this->m_to_noArgsAsync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsAsync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsAsync[port].setObjName(portName); + this->m_to_noArgsAsync[port].setObjName(portName.toChar()); #endif } @@ -279,21 +215,13 @@ void ActiveGetProductsTesterBase :: this->m_to_noArgsGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsGuarded[port].setObjName(portName); + this->m_to_noArgsGuarded[port].setObjName(portName.toChar()); #endif } @@ -306,21 +234,13 @@ void ActiveGetProductsTesterBase :: this->m_to_noArgsReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnGuarded[port].setObjName(portName); + this->m_to_noArgsReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -333,21 +253,13 @@ void ActiveGetProductsTesterBase :: this->m_to_noArgsReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnSync[port].setObjName(portName); + this->m_to_noArgsReturnSync[port].setObjName(portName.toChar()); #endif } @@ -360,21 +272,13 @@ void ActiveGetProductsTesterBase :: this->m_to_noArgsSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsSync[port].setObjName(portName); + this->m_to_noArgsSync[port].setObjName(portName.toChar()); #endif } @@ -387,21 +291,13 @@ void ActiveGetProductsTesterBase :: this->m_to_typedAsync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsync[port].setObjName(portName); + this->m_to_typedAsync[port].setObjName(portName.toChar()); #endif } @@ -414,21 +310,13 @@ void ActiveGetProductsTesterBase :: this->m_to_typedAsyncAssert[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncAssert[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncAssert[port].setObjName(portName); + this->m_to_typedAsyncAssert[port].setObjName(portName.toChar()); #endif } @@ -441,21 +329,13 @@ void ActiveGetProductsTesterBase :: this->m_to_typedAsyncBlockPriority[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncBlockPriority[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncBlockPriority[port].setObjName(portName); + this->m_to_typedAsyncBlockPriority[port].setObjName(portName.toChar()); #endif } @@ -468,21 +348,13 @@ void ActiveGetProductsTesterBase :: this->m_to_typedAsyncDropPriority[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncDropPriority[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncDropPriority[port].setObjName(portName); + this->m_to_typedAsyncDropPriority[port].setObjName(portName.toChar()); #endif } @@ -495,21 +367,13 @@ void ActiveGetProductsTesterBase :: this->m_to_typedGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedGuarded[port].setObjName(portName); + this->m_to_typedGuarded[port].setObjName(portName.toChar()); #endif } @@ -522,21 +386,13 @@ void ActiveGetProductsTesterBase :: this->m_to_typedReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnGuarded[port].setObjName(portName); + this->m_to_typedReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -549,21 +405,13 @@ void ActiveGetProductsTesterBase :: this->m_to_typedReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnSync[port].setObjName(portName); + this->m_to_typedReturnSync[port].setObjName(portName.toChar()); #endif } @@ -576,21 +424,13 @@ void ActiveGetProductsTesterBase :: this->m_to_typedSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedSync[port].setObjName(portName); + this->m_to_typedSync[port].setObjName(portName.toChar()); #endif } } diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveGuardedProductsTesterBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveGuardedProductsTesterBase.ref.cpp index b3b3da9c4..71bdef31d 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveGuardedProductsTesterBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveGuardedProductsTesterBase.ref.cpp @@ -33,21 +33,13 @@ void ActiveGuardedProductsTesterBase :: this->m_from_productRequestOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_productRequestOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_productRequestOut[port].setObjName(portName); + this->m_from_productRequestOut[port].setObjName(portName.toChar()); #endif } @@ -65,21 +57,13 @@ void ActiveGuardedProductsTesterBase :: this->m_from_productSendOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_productSendOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_productSendOut[port].setObjName(portName); + this->m_from_productSendOut[port].setObjName(portName.toChar()); #endif } @@ -97,21 +81,13 @@ void ActiveGuardedProductsTesterBase :: this->m_from_timeGetOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_timeGetOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_timeGetOut[port].setObjName(portName); + this->m_from_timeGetOut[port].setObjName(portName.toChar()); #endif } @@ -129,21 +105,13 @@ void ActiveGuardedProductsTesterBase :: this->m_from_noArgsOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsOut[port].setObjName(portName); + this->m_from_noArgsOut[port].setObjName(portName.toChar()); #endif } @@ -161,21 +129,13 @@ void ActiveGuardedProductsTesterBase :: this->m_from_noArgsReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsReturnOut[port].setObjName(portName); + this->m_from_noArgsReturnOut[port].setObjName(portName.toChar()); #endif } @@ -193,21 +153,13 @@ void ActiveGuardedProductsTesterBase :: this->m_from_typedOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedOut[port].setObjName(portName); + this->m_from_typedOut[port].setObjName(portName.toChar()); #endif } @@ -225,21 +177,13 @@ void ActiveGuardedProductsTesterBase :: this->m_from_typedReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedReturnOut[port].setObjName(portName); + this->m_from_typedReturnOut[port].setObjName(portName.toChar()); #endif } @@ -252,21 +196,13 @@ void ActiveGuardedProductsTesterBase :: this->m_to_productRecvIn[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_productRecvIn[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_productRecvIn[port].setObjName(portName); + this->m_to_productRecvIn[port].setObjName(portName.toChar()); #endif } @@ -279,21 +215,13 @@ void ActiveGuardedProductsTesterBase :: this->m_to_noArgsAsync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsAsync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsAsync[port].setObjName(portName); + this->m_to_noArgsAsync[port].setObjName(portName.toChar()); #endif } @@ -306,21 +234,13 @@ void ActiveGuardedProductsTesterBase :: this->m_to_noArgsGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsGuarded[port].setObjName(portName); + this->m_to_noArgsGuarded[port].setObjName(portName.toChar()); #endif } @@ -333,21 +253,13 @@ void ActiveGuardedProductsTesterBase :: this->m_to_noArgsReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnGuarded[port].setObjName(portName); + this->m_to_noArgsReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -360,21 +272,13 @@ void ActiveGuardedProductsTesterBase :: this->m_to_noArgsReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnSync[port].setObjName(portName); + this->m_to_noArgsReturnSync[port].setObjName(portName.toChar()); #endif } @@ -387,21 +291,13 @@ void ActiveGuardedProductsTesterBase :: this->m_to_noArgsSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsSync[port].setObjName(portName); + this->m_to_noArgsSync[port].setObjName(portName.toChar()); #endif } @@ -414,21 +310,13 @@ void ActiveGuardedProductsTesterBase :: this->m_to_typedAsync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsync[port].setObjName(portName); + this->m_to_typedAsync[port].setObjName(portName.toChar()); #endif } @@ -441,21 +329,13 @@ void ActiveGuardedProductsTesterBase :: this->m_to_typedAsyncAssert[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncAssert[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncAssert[port].setObjName(portName); + this->m_to_typedAsyncAssert[port].setObjName(portName.toChar()); #endif } @@ -468,21 +348,13 @@ void ActiveGuardedProductsTesterBase :: this->m_to_typedAsyncBlockPriority[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncBlockPriority[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncBlockPriority[port].setObjName(portName); + this->m_to_typedAsyncBlockPriority[port].setObjName(portName.toChar()); #endif } @@ -495,21 +367,13 @@ void ActiveGuardedProductsTesterBase :: this->m_to_typedAsyncDropPriority[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncDropPriority[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncDropPriority[port].setObjName(portName); + this->m_to_typedAsyncDropPriority[port].setObjName(portName.toChar()); #endif } @@ -522,21 +386,13 @@ void ActiveGuardedProductsTesterBase :: this->m_to_typedGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedGuarded[port].setObjName(portName); + this->m_to_typedGuarded[port].setObjName(portName.toChar()); #endif } @@ -549,21 +405,13 @@ void ActiveGuardedProductsTesterBase :: this->m_to_typedReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnGuarded[port].setObjName(portName); + this->m_to_typedReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -576,21 +424,13 @@ void ActiveGuardedProductsTesterBase :: this->m_to_typedReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnSync[port].setObjName(portName); + this->m_to_typedReturnSync[port].setObjName(portName.toChar()); #endif } @@ -603,21 +443,13 @@ void ActiveGuardedProductsTesterBase :: this->m_to_typedSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedSync[port].setObjName(portName); + this->m_to_typedSync[port].setObjName(portName.toChar()); #endif } } diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveNoArgsPortsOnlyTesterBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveNoArgsPortsOnlyTesterBase.ref.cpp index 4a445563d..b41a26fea 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveNoArgsPortsOnlyTesterBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveNoArgsPortsOnlyTesterBase.ref.cpp @@ -33,21 +33,13 @@ void ActiveNoArgsPortsOnlyTesterBase :: this->m_from_noArgsOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsOut[port].setObjName(portName); + this->m_from_noArgsOut[port].setObjName(portName.toChar()); #endif } @@ -65,21 +57,13 @@ void ActiveNoArgsPortsOnlyTesterBase :: this->m_from_noArgsReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsReturnOut[port].setObjName(portName); + this->m_from_noArgsReturnOut[port].setObjName(portName.toChar()); #endif } @@ -92,21 +76,13 @@ void ActiveNoArgsPortsOnlyTesterBase :: this->m_to_noArgsAsync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsAsync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsAsync[port].setObjName(portName); + this->m_to_noArgsAsync[port].setObjName(portName.toChar()); #endif } @@ -119,21 +95,13 @@ void ActiveNoArgsPortsOnlyTesterBase :: this->m_to_noArgsGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsGuarded[port].setObjName(portName); + this->m_to_noArgsGuarded[port].setObjName(portName.toChar()); #endif } @@ -146,21 +114,13 @@ void ActiveNoArgsPortsOnlyTesterBase :: this->m_to_noArgsReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnGuarded[port].setObjName(portName); + this->m_to_noArgsReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -173,21 +133,13 @@ void ActiveNoArgsPortsOnlyTesterBase :: this->m_to_noArgsReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnSync[port].setObjName(portName); + this->m_to_noArgsReturnSync[port].setObjName(portName.toChar()); #endif } } diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveParamsTesterBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveParamsTesterBase.ref.cpp index bffbe7c28..30b1c4e4a 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveParamsTesterBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveParamsTesterBase.ref.cpp @@ -33,21 +33,13 @@ void ActiveParamsTesterBase :: this->m_from_cmdRegOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_cmdRegOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_cmdRegOut[port].setObjName(portName); + this->m_from_cmdRegOut[port].setObjName(portName.toChar()); #endif } @@ -65,21 +57,13 @@ void ActiveParamsTesterBase :: this->m_from_cmdResponseOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_cmdResponseOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_cmdResponseOut[port].setObjName(portName); + this->m_from_cmdResponseOut[port].setObjName(portName.toChar()); #endif } @@ -97,21 +81,13 @@ void ActiveParamsTesterBase :: this->m_from_prmGetOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_prmGetOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_prmGetOut[port].setObjName(portName); + this->m_from_prmGetOut[port].setObjName(portName.toChar()); #endif } @@ -129,21 +105,13 @@ void ActiveParamsTesterBase :: this->m_from_prmSetOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_prmSetOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_prmSetOut[port].setObjName(portName); + this->m_from_prmSetOut[port].setObjName(portName.toChar()); #endif } @@ -161,21 +129,13 @@ void ActiveParamsTesterBase :: this->m_from_timeGetOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_timeGetOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_timeGetOut[port].setObjName(portName); + this->m_from_timeGetOut[port].setObjName(portName.toChar()); #endif } @@ -193,21 +153,13 @@ void ActiveParamsTesterBase :: this->m_from_noArgsOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsOut[port].setObjName(portName); + this->m_from_noArgsOut[port].setObjName(portName.toChar()); #endif } @@ -225,21 +177,13 @@ void ActiveParamsTesterBase :: this->m_from_noArgsReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsReturnOut[port].setObjName(portName); + this->m_from_noArgsReturnOut[port].setObjName(portName.toChar()); #endif } @@ -257,21 +201,13 @@ void ActiveParamsTesterBase :: this->m_from_typedOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedOut[port].setObjName(portName); + this->m_from_typedOut[port].setObjName(portName.toChar()); #endif } @@ -289,21 +225,13 @@ void ActiveParamsTesterBase :: this->m_from_typedReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedReturnOut[port].setObjName(portName); + this->m_from_typedReturnOut[port].setObjName(portName.toChar()); #endif } @@ -316,21 +244,13 @@ void ActiveParamsTesterBase :: this->m_to_cmdIn[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_cmdIn[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_cmdIn[port].setObjName(portName); + this->m_to_cmdIn[port].setObjName(portName.toChar()); #endif } @@ -343,21 +263,13 @@ void ActiveParamsTesterBase :: this->m_to_noArgsAsync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsAsync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsAsync[port].setObjName(portName); + this->m_to_noArgsAsync[port].setObjName(portName.toChar()); #endif } @@ -370,21 +282,13 @@ void ActiveParamsTesterBase :: this->m_to_noArgsGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsGuarded[port].setObjName(portName); + this->m_to_noArgsGuarded[port].setObjName(portName.toChar()); #endif } @@ -397,21 +301,13 @@ void ActiveParamsTesterBase :: this->m_to_noArgsReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnGuarded[port].setObjName(portName); + this->m_to_noArgsReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -424,21 +320,13 @@ void ActiveParamsTesterBase :: this->m_to_noArgsReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnSync[port].setObjName(portName); + this->m_to_noArgsReturnSync[port].setObjName(portName.toChar()); #endif } @@ -451,21 +339,13 @@ void ActiveParamsTesterBase :: this->m_to_noArgsSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsSync[port].setObjName(portName); + this->m_to_noArgsSync[port].setObjName(portName.toChar()); #endif } @@ -478,21 +358,13 @@ void ActiveParamsTesterBase :: this->m_to_typedAsync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsync[port].setObjName(portName); + this->m_to_typedAsync[port].setObjName(portName.toChar()); #endif } @@ -505,21 +377,13 @@ void ActiveParamsTesterBase :: this->m_to_typedAsyncAssert[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncAssert[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncAssert[port].setObjName(portName); + this->m_to_typedAsyncAssert[port].setObjName(portName.toChar()); #endif } @@ -532,21 +396,13 @@ void ActiveParamsTesterBase :: this->m_to_typedAsyncBlockPriority[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncBlockPriority[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncBlockPriority[port].setObjName(portName); + this->m_to_typedAsyncBlockPriority[port].setObjName(portName.toChar()); #endif } @@ -559,21 +415,13 @@ void ActiveParamsTesterBase :: this->m_to_typedAsyncDropPriority[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncDropPriority[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncDropPriority[port].setObjName(portName); + this->m_to_typedAsyncDropPriority[port].setObjName(portName.toChar()); #endif } @@ -586,21 +434,13 @@ void ActiveParamsTesterBase :: this->m_to_typedGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedGuarded[port].setObjName(portName); + this->m_to_typedGuarded[port].setObjName(portName.toChar()); #endif } @@ -613,21 +453,13 @@ void ActiveParamsTesterBase :: this->m_to_typedReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnGuarded[port].setObjName(portName); + this->m_to_typedReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -640,21 +472,13 @@ void ActiveParamsTesterBase :: this->m_to_typedReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnSync[port].setObjName(portName); + this->m_to_typedReturnSync[port].setObjName(portName.toChar()); #endif } @@ -667,21 +491,13 @@ void ActiveParamsTesterBase :: this->m_to_typedSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedSync[port].setObjName(portName); + this->m_to_typedSync[port].setObjName(portName.toChar()); #endif } } diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveSerialTesterBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveSerialTesterBase.ref.cpp index 65883a7fe..dcce59d2a 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveSerialTesterBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveSerialTesterBase.ref.cpp @@ -33,21 +33,13 @@ void ActiveSerialTesterBase :: this->m_from_cmdRegOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_cmdRegOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_cmdRegOut[port].setObjName(portName); + this->m_from_cmdRegOut[port].setObjName(portName.toChar()); #endif } @@ -65,21 +57,13 @@ void ActiveSerialTesterBase :: this->m_from_cmdResponseOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_cmdResponseOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_cmdResponseOut[port].setObjName(portName); + this->m_from_cmdResponseOut[port].setObjName(portName.toChar()); #endif } @@ -97,21 +81,13 @@ void ActiveSerialTesterBase :: this->m_from_eventOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_eventOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_eventOut[port].setObjName(portName); + this->m_from_eventOut[port].setObjName(portName.toChar()); #endif } @@ -129,21 +105,13 @@ void ActiveSerialTesterBase :: this->m_from_prmGetOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_prmGetOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_prmGetOut[port].setObjName(portName); + this->m_from_prmGetOut[port].setObjName(portName.toChar()); #endif } @@ -161,21 +129,13 @@ void ActiveSerialTesterBase :: this->m_from_prmSetOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_prmSetOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_prmSetOut[port].setObjName(portName); + this->m_from_prmSetOut[port].setObjName(portName.toChar()); #endif } @@ -194,21 +154,13 @@ void ActiveSerialTesterBase :: this->m_from_textEventOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_textEventOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_textEventOut[port].setObjName(portName); + this->m_from_textEventOut[port].setObjName(portName.toChar()); #endif } #endif @@ -227,21 +179,13 @@ void ActiveSerialTesterBase :: this->m_from_timeGetOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_timeGetOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_timeGetOut[port].setObjName(portName); + this->m_from_timeGetOut[port].setObjName(portName.toChar()); #endif } @@ -259,21 +203,13 @@ void ActiveSerialTesterBase :: this->m_from_tlmOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_tlmOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_tlmOut[port].setObjName(portName); + this->m_from_tlmOut[port].setObjName(portName.toChar()); #endif } @@ -291,21 +227,13 @@ void ActiveSerialTesterBase :: this->m_from_noArgsOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsOut[port].setObjName(portName); + this->m_from_noArgsOut[port].setObjName(portName.toChar()); #endif } @@ -323,21 +251,13 @@ void ActiveSerialTesterBase :: this->m_from_noArgsReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsReturnOut[port].setObjName(portName); + this->m_from_noArgsReturnOut[port].setObjName(portName.toChar()); #endif } @@ -355,21 +275,13 @@ void ActiveSerialTesterBase :: this->m_from_typedOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedOut[port].setObjName(portName); + this->m_from_typedOut[port].setObjName(portName.toChar()); #endif } @@ -387,21 +299,13 @@ void ActiveSerialTesterBase :: this->m_from_typedReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedReturnOut[port].setObjName(portName); + this->m_from_typedReturnOut[port].setObjName(portName.toChar()); #endif } @@ -419,21 +323,13 @@ void ActiveSerialTesterBase :: this->m_from_serialOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_serialOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_serialOut[port].setObjName(portName); + this->m_from_serialOut[port].setObjName(portName.toChar()); #endif } @@ -446,21 +342,13 @@ void ActiveSerialTesterBase :: this->m_to_cmdIn[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_cmdIn[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_cmdIn[port].setObjName(portName); + this->m_to_cmdIn[port].setObjName(portName.toChar()); #endif } @@ -473,21 +361,13 @@ void ActiveSerialTesterBase :: this->m_to_noArgsAsync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsAsync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsAsync[port].setObjName(portName); + this->m_to_noArgsAsync[port].setObjName(portName.toChar()); #endif } @@ -500,21 +380,13 @@ void ActiveSerialTesterBase :: this->m_to_noArgsGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsGuarded[port].setObjName(portName); + this->m_to_noArgsGuarded[port].setObjName(portName.toChar()); #endif } @@ -527,21 +399,13 @@ void ActiveSerialTesterBase :: this->m_to_noArgsReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnGuarded[port].setObjName(portName); + this->m_to_noArgsReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -554,21 +418,13 @@ void ActiveSerialTesterBase :: this->m_to_noArgsReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnSync[port].setObjName(portName); + this->m_to_noArgsReturnSync[port].setObjName(portName.toChar()); #endif } @@ -581,21 +437,13 @@ void ActiveSerialTesterBase :: this->m_to_noArgsSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsSync[port].setObjName(portName); + this->m_to_noArgsSync[port].setObjName(portName.toChar()); #endif } @@ -608,21 +456,13 @@ void ActiveSerialTesterBase :: this->m_to_typedAsync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsync[port].setObjName(portName); + this->m_to_typedAsync[port].setObjName(portName.toChar()); #endif } @@ -635,21 +475,13 @@ void ActiveSerialTesterBase :: this->m_to_typedAsyncAssert[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncAssert[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncAssert[port].setObjName(portName); + this->m_to_typedAsyncAssert[port].setObjName(portName.toChar()); #endif } @@ -662,21 +494,13 @@ void ActiveSerialTesterBase :: this->m_to_typedAsyncBlockPriority[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncBlockPriority[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncBlockPriority[port].setObjName(portName); + this->m_to_typedAsyncBlockPriority[port].setObjName(portName.toChar()); #endif } @@ -689,21 +513,13 @@ void ActiveSerialTesterBase :: this->m_to_typedAsyncDropPriority[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncDropPriority[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncDropPriority[port].setObjName(portName); + this->m_to_typedAsyncDropPriority[port].setObjName(portName.toChar()); #endif } @@ -716,21 +532,13 @@ void ActiveSerialTesterBase :: this->m_to_typedGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedGuarded[port].setObjName(portName); + this->m_to_typedGuarded[port].setObjName(portName.toChar()); #endif } @@ -743,21 +551,13 @@ void ActiveSerialTesterBase :: this->m_to_typedReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnGuarded[port].setObjName(portName); + this->m_to_typedReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -770,21 +570,13 @@ void ActiveSerialTesterBase :: this->m_to_typedReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnSync[port].setObjName(portName); + this->m_to_typedReturnSync[port].setObjName(portName.toChar()); #endif } @@ -797,21 +589,13 @@ void ActiveSerialTesterBase :: this->m_to_typedSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedSync[port].setObjName(portName); + this->m_to_typedSync[port].setObjName(portName.toChar()); #endif } @@ -824,21 +608,13 @@ void ActiveSerialTesterBase :: this->m_to_serialAsync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_serialAsync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_serialAsync[port].setObjName(portName); + this->m_to_serialAsync[port].setObjName(portName.toChar()); #endif } @@ -851,21 +627,13 @@ void ActiveSerialTesterBase :: this->m_to_serialAsyncAssert[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_serialAsyncAssert[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_serialAsyncAssert[port].setObjName(portName); + this->m_to_serialAsyncAssert[port].setObjName(portName.toChar()); #endif } @@ -878,21 +646,13 @@ void ActiveSerialTesterBase :: this->m_to_serialAsyncBlockPriority[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_serialAsyncBlockPriority[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_serialAsyncBlockPriority[port].setObjName(portName); + this->m_to_serialAsyncBlockPriority[port].setObjName(portName.toChar()); #endif } @@ -905,21 +665,13 @@ void ActiveSerialTesterBase :: this->m_to_serialAsyncDropPriority[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_serialAsyncDropPriority[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_serialAsyncDropPriority[port].setObjName(portName); + this->m_to_serialAsyncDropPriority[port].setObjName(portName.toChar()); #endif } @@ -932,21 +684,13 @@ void ActiveSerialTesterBase :: this->m_to_serialGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_serialGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_serialGuarded[port].setObjName(portName); + this->m_to_serialGuarded[port].setObjName(portName.toChar()); #endif } @@ -959,21 +703,13 @@ void ActiveSerialTesterBase :: this->m_to_serialSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_serialSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_serialSync[port].setObjName(portName); + this->m_to_serialSync[port].setObjName(portName.toChar()); #endif } } diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveSyncProductsTesterBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveSyncProductsTesterBase.ref.cpp index 56265100c..f3f5a0df6 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveSyncProductsTesterBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveSyncProductsTesterBase.ref.cpp @@ -33,21 +33,13 @@ void ActiveSyncProductsTesterBase :: this->m_from_productRequestOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_productRequestOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_productRequestOut[port].setObjName(portName); + this->m_from_productRequestOut[port].setObjName(portName.toChar()); #endif } @@ -65,21 +57,13 @@ void ActiveSyncProductsTesterBase :: this->m_from_productSendOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_productSendOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_productSendOut[port].setObjName(portName); + this->m_from_productSendOut[port].setObjName(portName.toChar()); #endif } @@ -97,21 +81,13 @@ void ActiveSyncProductsTesterBase :: this->m_from_timeGetOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_timeGetOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_timeGetOut[port].setObjName(portName); + this->m_from_timeGetOut[port].setObjName(portName.toChar()); #endif } @@ -129,21 +105,13 @@ void ActiveSyncProductsTesterBase :: this->m_from_noArgsOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsOut[port].setObjName(portName); + this->m_from_noArgsOut[port].setObjName(portName.toChar()); #endif } @@ -161,21 +129,13 @@ void ActiveSyncProductsTesterBase :: this->m_from_noArgsReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsReturnOut[port].setObjName(portName); + this->m_from_noArgsReturnOut[port].setObjName(portName.toChar()); #endif } @@ -193,21 +153,13 @@ void ActiveSyncProductsTesterBase :: this->m_from_typedOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedOut[port].setObjName(portName); + this->m_from_typedOut[port].setObjName(portName.toChar()); #endif } @@ -225,21 +177,13 @@ void ActiveSyncProductsTesterBase :: this->m_from_typedReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedReturnOut[port].setObjName(portName); + this->m_from_typedReturnOut[port].setObjName(portName.toChar()); #endif } @@ -252,21 +196,13 @@ void ActiveSyncProductsTesterBase :: this->m_to_productRecvIn[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_productRecvIn[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_productRecvIn[port].setObjName(portName); + this->m_to_productRecvIn[port].setObjName(portName.toChar()); #endif } @@ -279,21 +215,13 @@ void ActiveSyncProductsTesterBase :: this->m_to_noArgsAsync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsAsync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsAsync[port].setObjName(portName); + this->m_to_noArgsAsync[port].setObjName(portName.toChar()); #endif } @@ -306,21 +234,13 @@ void ActiveSyncProductsTesterBase :: this->m_to_noArgsGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsGuarded[port].setObjName(portName); + this->m_to_noArgsGuarded[port].setObjName(portName.toChar()); #endif } @@ -333,21 +253,13 @@ void ActiveSyncProductsTesterBase :: this->m_to_noArgsReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnGuarded[port].setObjName(portName); + this->m_to_noArgsReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -360,21 +272,13 @@ void ActiveSyncProductsTesterBase :: this->m_to_noArgsReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnSync[port].setObjName(portName); + this->m_to_noArgsReturnSync[port].setObjName(portName.toChar()); #endif } @@ -387,21 +291,13 @@ void ActiveSyncProductsTesterBase :: this->m_to_noArgsSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsSync[port].setObjName(portName); + this->m_to_noArgsSync[port].setObjName(portName.toChar()); #endif } @@ -414,21 +310,13 @@ void ActiveSyncProductsTesterBase :: this->m_to_typedAsync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsync[port].setObjName(portName); + this->m_to_typedAsync[port].setObjName(portName.toChar()); #endif } @@ -441,21 +329,13 @@ void ActiveSyncProductsTesterBase :: this->m_to_typedAsyncAssert[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncAssert[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncAssert[port].setObjName(portName); + this->m_to_typedAsyncAssert[port].setObjName(portName.toChar()); #endif } @@ -468,21 +348,13 @@ void ActiveSyncProductsTesterBase :: this->m_to_typedAsyncBlockPriority[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncBlockPriority[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncBlockPriority[port].setObjName(portName); + this->m_to_typedAsyncBlockPriority[port].setObjName(portName.toChar()); #endif } @@ -495,21 +367,13 @@ void ActiveSyncProductsTesterBase :: this->m_to_typedAsyncDropPriority[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncDropPriority[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncDropPriority[port].setObjName(portName); + this->m_to_typedAsyncDropPriority[port].setObjName(portName.toChar()); #endif } @@ -522,21 +386,13 @@ void ActiveSyncProductsTesterBase :: this->m_to_typedGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedGuarded[port].setObjName(portName); + this->m_to_typedGuarded[port].setObjName(portName.toChar()); #endif } @@ -549,21 +405,13 @@ void ActiveSyncProductsTesterBase :: this->m_to_typedReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnGuarded[port].setObjName(portName); + this->m_to_typedReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -576,21 +424,13 @@ void ActiveSyncProductsTesterBase :: this->m_to_typedReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnSync[port].setObjName(portName); + this->m_to_typedReturnSync[port].setObjName(portName.toChar()); #endif } @@ -603,21 +443,13 @@ void ActiveSyncProductsTesterBase :: this->m_to_typedSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedSync[port].setObjName(portName); + this->m_to_typedSync[port].setObjName(portName.toChar()); #endif } } diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveTelemetryTesterBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveTelemetryTesterBase.ref.cpp index bd943ae88..fcb7d177d 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveTelemetryTesterBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveTelemetryTesterBase.ref.cpp @@ -33,21 +33,13 @@ void ActiveTelemetryTesterBase :: this->m_from_timeGetOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_timeGetOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_timeGetOut[port].setObjName(portName); + this->m_from_timeGetOut[port].setObjName(portName.toChar()); #endif } @@ -65,21 +57,13 @@ void ActiveTelemetryTesterBase :: this->m_from_tlmOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_tlmOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_tlmOut[port].setObjName(portName); + this->m_from_tlmOut[port].setObjName(portName.toChar()); #endif } @@ -97,21 +81,13 @@ void ActiveTelemetryTesterBase :: this->m_from_noArgsOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsOut[port].setObjName(portName); + this->m_from_noArgsOut[port].setObjName(portName.toChar()); #endif } @@ -129,21 +105,13 @@ void ActiveTelemetryTesterBase :: this->m_from_noArgsReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsReturnOut[port].setObjName(portName); + this->m_from_noArgsReturnOut[port].setObjName(portName.toChar()); #endif } @@ -161,21 +129,13 @@ void ActiveTelemetryTesterBase :: this->m_from_typedOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedOut[port].setObjName(portName); + this->m_from_typedOut[port].setObjName(portName.toChar()); #endif } @@ -193,21 +153,13 @@ void ActiveTelemetryTesterBase :: this->m_from_typedReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedReturnOut[port].setObjName(portName); + this->m_from_typedReturnOut[port].setObjName(portName.toChar()); #endif } @@ -220,21 +172,13 @@ void ActiveTelemetryTesterBase :: this->m_to_noArgsAsync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsAsync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsAsync[port].setObjName(portName); + this->m_to_noArgsAsync[port].setObjName(portName.toChar()); #endif } @@ -247,21 +191,13 @@ void ActiveTelemetryTesterBase :: this->m_to_noArgsGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsGuarded[port].setObjName(portName); + this->m_to_noArgsGuarded[port].setObjName(portName.toChar()); #endif } @@ -274,21 +210,13 @@ void ActiveTelemetryTesterBase :: this->m_to_noArgsReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnGuarded[port].setObjName(portName); + this->m_to_noArgsReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -301,21 +229,13 @@ void ActiveTelemetryTesterBase :: this->m_to_noArgsReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnSync[port].setObjName(portName); + this->m_to_noArgsReturnSync[port].setObjName(portName.toChar()); #endif } @@ -328,21 +248,13 @@ void ActiveTelemetryTesterBase :: this->m_to_noArgsSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsSync[port].setObjName(portName); + this->m_to_noArgsSync[port].setObjName(portName.toChar()); #endif } @@ -355,21 +267,13 @@ void ActiveTelemetryTesterBase :: this->m_to_typedAsync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsync[port].setObjName(portName); + this->m_to_typedAsync[port].setObjName(portName.toChar()); #endif } @@ -382,21 +286,13 @@ void ActiveTelemetryTesterBase :: this->m_to_typedAsyncAssert[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncAssert[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncAssert[port].setObjName(portName); + this->m_to_typedAsyncAssert[port].setObjName(portName.toChar()); #endif } @@ -409,21 +305,13 @@ void ActiveTelemetryTesterBase :: this->m_to_typedAsyncBlockPriority[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncBlockPriority[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncBlockPriority[port].setObjName(portName); + this->m_to_typedAsyncBlockPriority[port].setObjName(portName.toChar()); #endif } @@ -436,21 +324,13 @@ void ActiveTelemetryTesterBase :: this->m_to_typedAsyncDropPriority[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncDropPriority[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncDropPriority[port].setObjName(portName); + this->m_to_typedAsyncDropPriority[port].setObjName(portName.toChar()); #endif } @@ -463,21 +343,13 @@ void ActiveTelemetryTesterBase :: this->m_to_typedGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedGuarded[port].setObjName(portName); + this->m_to_typedGuarded[port].setObjName(portName.toChar()); #endif } @@ -490,21 +362,13 @@ void ActiveTelemetryTesterBase :: this->m_to_typedReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnGuarded[port].setObjName(portName); + this->m_to_typedReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -517,21 +381,13 @@ void ActiveTelemetryTesterBase :: this->m_to_typedReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnSync[port].setObjName(portName); + this->m_to_typedReturnSync[port].setObjName(portName.toChar()); #endif } @@ -544,21 +400,13 @@ void ActiveTelemetryTesterBase :: this->m_to_typedSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedSync[port].setObjName(portName); + this->m_to_typedSync[port].setObjName(portName.toChar()); #endif } } diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveTestTesterBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveTestTesterBase.ref.cpp index c6dc3e054..2132e262c 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveTestTesterBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/ActiveTestTesterBase.ref.cpp @@ -35,21 +35,13 @@ namespace M { this->m_from_cmdRegOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_cmdRegOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_cmdRegOut[port].setObjName(portName); + this->m_from_cmdRegOut[port].setObjName(portName.toChar()); #endif } @@ -67,21 +59,13 @@ namespace M { this->m_from_cmdResponseOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_cmdResponseOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_cmdResponseOut[port].setObjName(portName); + this->m_from_cmdResponseOut[port].setObjName(portName.toChar()); #endif } @@ -99,21 +83,13 @@ namespace M { this->m_from_eventOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_eventOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_eventOut[port].setObjName(portName); + this->m_from_eventOut[port].setObjName(portName.toChar()); #endif } @@ -131,21 +107,13 @@ namespace M { this->m_from_prmGetOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_prmGetOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_prmGetOut[port].setObjName(portName); + this->m_from_prmGetOut[port].setObjName(portName.toChar()); #endif } @@ -163,21 +131,13 @@ namespace M { this->m_from_prmSetOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_prmSetOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_prmSetOut[port].setObjName(portName); + this->m_from_prmSetOut[port].setObjName(portName.toChar()); #endif } @@ -195,21 +155,13 @@ namespace M { this->m_from_productRequestOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_productRequestOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_productRequestOut[port].setObjName(portName); + this->m_from_productRequestOut[port].setObjName(portName.toChar()); #endif } @@ -227,21 +179,13 @@ namespace M { this->m_from_productSendOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_productSendOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_productSendOut[port].setObjName(portName); + this->m_from_productSendOut[port].setObjName(portName.toChar()); #endif } @@ -260,21 +204,13 @@ namespace M { this->m_from_textEventOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_textEventOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_textEventOut[port].setObjName(portName); + this->m_from_textEventOut[port].setObjName(portName.toChar()); #endif } #endif @@ -293,21 +229,13 @@ namespace M { this->m_from_timeGetOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_timeGetOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_timeGetOut[port].setObjName(portName); + this->m_from_timeGetOut[port].setObjName(portName.toChar()); #endif } @@ -325,21 +253,13 @@ namespace M { this->m_from_tlmOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_tlmOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_tlmOut[port].setObjName(portName); + this->m_from_tlmOut[port].setObjName(portName.toChar()); #endif } @@ -357,21 +277,13 @@ namespace M { this->m_from_noArgsOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsOut[port].setObjName(portName); + this->m_from_noArgsOut[port].setObjName(portName.toChar()); #endif } @@ -389,21 +301,13 @@ namespace M { this->m_from_noArgsReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsReturnOut[port].setObjName(portName); + this->m_from_noArgsReturnOut[port].setObjName(portName.toChar()); #endif } @@ -421,21 +325,13 @@ namespace M { this->m_from_typedOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedOut[port].setObjName(portName); + this->m_from_typedOut[port].setObjName(portName.toChar()); #endif } @@ -453,21 +349,13 @@ namespace M { this->m_from_typedReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedReturnOut[port].setObjName(portName); + this->m_from_typedReturnOut[port].setObjName(portName.toChar()); #endif } @@ -480,21 +368,13 @@ namespace M { this->m_to_cmdIn[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_cmdIn[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_cmdIn[port].setObjName(portName); + this->m_to_cmdIn[port].setObjName(portName.toChar()); #endif } @@ -507,21 +387,13 @@ namespace M { this->m_to_productRecvIn[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_productRecvIn[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_productRecvIn[port].setObjName(portName); + this->m_to_productRecvIn[port].setObjName(portName.toChar()); #endif } @@ -534,21 +406,13 @@ namespace M { this->m_to_noArgsAsync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsAsync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsAsync[port].setObjName(portName); + this->m_to_noArgsAsync[port].setObjName(portName.toChar()); #endif } @@ -561,21 +425,13 @@ namespace M { this->m_to_noArgsGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsGuarded[port].setObjName(portName); + this->m_to_noArgsGuarded[port].setObjName(portName.toChar()); #endif } @@ -588,21 +444,13 @@ namespace M { this->m_to_noArgsReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnGuarded[port].setObjName(portName); + this->m_to_noArgsReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -615,21 +463,13 @@ namespace M { this->m_to_noArgsReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnSync[port].setObjName(portName); + this->m_to_noArgsReturnSync[port].setObjName(portName.toChar()); #endif } @@ -642,21 +482,13 @@ namespace M { this->m_to_noArgsSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsSync[port].setObjName(portName); + this->m_to_noArgsSync[port].setObjName(portName.toChar()); #endif } @@ -669,21 +501,13 @@ namespace M { this->m_to_typedAsync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsync[port].setObjName(portName); + this->m_to_typedAsync[port].setObjName(portName.toChar()); #endif } @@ -696,21 +520,13 @@ namespace M { this->m_to_typedAsyncAssert[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncAssert[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncAssert[port].setObjName(portName); + this->m_to_typedAsyncAssert[port].setObjName(portName.toChar()); #endif } @@ -723,21 +539,13 @@ namespace M { this->m_to_typedAsyncBlockPriority[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncBlockPriority[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncBlockPriority[port].setObjName(portName); + this->m_to_typedAsyncBlockPriority[port].setObjName(portName.toChar()); #endif } @@ -750,21 +558,13 @@ namespace M { this->m_to_typedAsyncDropPriority[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncDropPriority[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncDropPriority[port].setObjName(portName); + this->m_to_typedAsyncDropPriority[port].setObjName(portName.toChar()); #endif } @@ -777,21 +577,13 @@ namespace M { this->m_to_typedGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedGuarded[port].setObjName(portName); + this->m_to_typedGuarded[port].setObjName(portName.toChar()); #endif } @@ -804,21 +596,13 @@ namespace M { this->m_to_typedReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnGuarded[port].setObjName(portName); + this->m_to_typedReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -831,21 +615,13 @@ namespace M { this->m_to_typedReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnSync[port].setObjName(portName); + this->m_to_typedReturnSync[port].setObjName(portName.toChar()); #endif } @@ -858,21 +634,13 @@ namespace M { this->m_to_typedSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedSync[port].setObjName(portName); + this->m_to_typedSync[port].setObjName(portName.toChar()); #endif } } diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveCommandsTesterBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveCommandsTesterBase.ref.cpp index 10e350910..caad054e4 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveCommandsTesterBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveCommandsTesterBase.ref.cpp @@ -33,21 +33,13 @@ void PassiveCommandsTesterBase :: this->m_from_cmdRegOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_cmdRegOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_cmdRegOut[port].setObjName(portName); + this->m_from_cmdRegOut[port].setObjName(portName.toChar()); #endif } @@ -65,21 +57,13 @@ void PassiveCommandsTesterBase :: this->m_from_cmdResponseOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_cmdResponseOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_cmdResponseOut[port].setObjName(portName); + this->m_from_cmdResponseOut[port].setObjName(portName.toChar()); #endif } @@ -97,21 +81,13 @@ void PassiveCommandsTesterBase :: this->m_from_timeGetOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_timeGetOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_timeGetOut[port].setObjName(portName); + this->m_from_timeGetOut[port].setObjName(portName.toChar()); #endif } @@ -129,21 +105,13 @@ void PassiveCommandsTesterBase :: this->m_from_noArgsOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsOut[port].setObjName(portName); + this->m_from_noArgsOut[port].setObjName(portName.toChar()); #endif } @@ -161,21 +129,13 @@ void PassiveCommandsTesterBase :: this->m_from_noArgsReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsReturnOut[port].setObjName(portName); + this->m_from_noArgsReturnOut[port].setObjName(portName.toChar()); #endif } @@ -193,21 +153,13 @@ void PassiveCommandsTesterBase :: this->m_from_typedOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedOut[port].setObjName(portName); + this->m_from_typedOut[port].setObjName(portName.toChar()); #endif } @@ -225,21 +177,13 @@ void PassiveCommandsTesterBase :: this->m_from_typedReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedReturnOut[port].setObjName(portName); + this->m_from_typedReturnOut[port].setObjName(portName.toChar()); #endif } @@ -252,21 +196,13 @@ void PassiveCommandsTesterBase :: this->m_to_cmdIn[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_cmdIn[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_cmdIn[port].setObjName(portName); + this->m_to_cmdIn[port].setObjName(portName.toChar()); #endif } @@ -279,21 +215,13 @@ void PassiveCommandsTesterBase :: this->m_to_noArgsGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsGuarded[port].setObjName(portName); + this->m_to_noArgsGuarded[port].setObjName(portName.toChar()); #endif } @@ -306,21 +234,13 @@ void PassiveCommandsTesterBase :: this->m_to_noArgsReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnGuarded[port].setObjName(portName); + this->m_to_noArgsReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -333,21 +253,13 @@ void PassiveCommandsTesterBase :: this->m_to_noArgsReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnSync[port].setObjName(portName); + this->m_to_noArgsReturnSync[port].setObjName(portName.toChar()); #endif } @@ -360,21 +272,13 @@ void PassiveCommandsTesterBase :: this->m_to_noArgsSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsSync[port].setObjName(portName); + this->m_to_noArgsSync[port].setObjName(portName.toChar()); #endif } @@ -387,21 +291,13 @@ void PassiveCommandsTesterBase :: this->m_to_typedGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedGuarded[port].setObjName(portName); + this->m_to_typedGuarded[port].setObjName(portName.toChar()); #endif } @@ -414,21 +310,13 @@ void PassiveCommandsTesterBase :: this->m_to_typedReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnGuarded[port].setObjName(portName); + this->m_to_typedReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -441,21 +329,13 @@ void PassiveCommandsTesterBase :: this->m_to_typedReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnSync[port].setObjName(portName); + this->m_to_typedReturnSync[port].setObjName(portName.toChar()); #endif } @@ -468,21 +348,13 @@ void PassiveCommandsTesterBase :: this->m_to_typedSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedSync[port].setObjName(portName); + this->m_to_typedSync[port].setObjName(portName.toChar()); #endif } } diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveEventsTesterBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveEventsTesterBase.ref.cpp index 40cc70c74..c5d4ccc1c 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveEventsTesterBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveEventsTesterBase.ref.cpp @@ -33,21 +33,13 @@ void PassiveEventsTesterBase :: this->m_from_eventOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_eventOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_eventOut[port].setObjName(portName); + this->m_from_eventOut[port].setObjName(portName.toChar()); #endif } @@ -66,21 +58,13 @@ void PassiveEventsTesterBase :: this->m_from_textEventOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_textEventOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_textEventOut[port].setObjName(portName); + this->m_from_textEventOut[port].setObjName(portName.toChar()); #endif } #endif @@ -99,21 +83,13 @@ void PassiveEventsTesterBase :: this->m_from_timeGetOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_timeGetOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_timeGetOut[port].setObjName(portName); + this->m_from_timeGetOut[port].setObjName(portName.toChar()); #endif } @@ -131,21 +107,13 @@ void PassiveEventsTesterBase :: this->m_from_noArgsOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsOut[port].setObjName(portName); + this->m_from_noArgsOut[port].setObjName(portName.toChar()); #endif } @@ -163,21 +131,13 @@ void PassiveEventsTesterBase :: this->m_from_noArgsReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsReturnOut[port].setObjName(portName); + this->m_from_noArgsReturnOut[port].setObjName(portName.toChar()); #endif } @@ -195,21 +155,13 @@ void PassiveEventsTesterBase :: this->m_from_typedOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedOut[port].setObjName(portName); + this->m_from_typedOut[port].setObjName(portName.toChar()); #endif } @@ -227,21 +179,13 @@ void PassiveEventsTesterBase :: this->m_from_typedReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedReturnOut[port].setObjName(portName); + this->m_from_typedReturnOut[port].setObjName(portName.toChar()); #endif } @@ -254,21 +198,13 @@ void PassiveEventsTesterBase :: this->m_to_noArgsGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsGuarded[port].setObjName(portName); + this->m_to_noArgsGuarded[port].setObjName(portName.toChar()); #endif } @@ -281,21 +217,13 @@ void PassiveEventsTesterBase :: this->m_to_noArgsReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnGuarded[port].setObjName(portName); + this->m_to_noArgsReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -308,21 +236,13 @@ void PassiveEventsTesterBase :: this->m_to_noArgsReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnSync[port].setObjName(portName); + this->m_to_noArgsReturnSync[port].setObjName(portName.toChar()); #endif } @@ -335,21 +255,13 @@ void PassiveEventsTesterBase :: this->m_to_noArgsSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsSync[port].setObjName(portName); + this->m_to_noArgsSync[port].setObjName(portName.toChar()); #endif } @@ -362,21 +274,13 @@ void PassiveEventsTesterBase :: this->m_to_typedGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedGuarded[port].setObjName(portName); + this->m_to_typedGuarded[port].setObjName(portName.toChar()); #endif } @@ -389,21 +293,13 @@ void PassiveEventsTesterBase :: this->m_to_typedReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnGuarded[port].setObjName(portName); + this->m_to_typedReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -416,21 +312,13 @@ void PassiveEventsTesterBase :: this->m_to_typedReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnSync[port].setObjName(portName); + this->m_to_typedReturnSync[port].setObjName(portName.toChar()); #endif } @@ -443,21 +331,13 @@ void PassiveEventsTesterBase :: this->m_to_typedSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedSync[port].setObjName(portName); + this->m_to_typedSync[port].setObjName(portName.toChar()); #endif } } diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveGetProductsTesterBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveGetProductsTesterBase.ref.cpp index a5d247e0d..05fa204c0 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveGetProductsTesterBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveGetProductsTesterBase.ref.cpp @@ -33,21 +33,13 @@ void PassiveGetProductsTesterBase :: this->m_from_productGetOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_productGetOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_productGetOut[port].setObjName(portName); + this->m_from_productGetOut[port].setObjName(portName.toChar()); #endif } @@ -65,21 +57,13 @@ void PassiveGetProductsTesterBase :: this->m_from_productSendOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_productSendOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_productSendOut[port].setObjName(portName); + this->m_from_productSendOut[port].setObjName(portName.toChar()); #endif } @@ -97,21 +81,13 @@ void PassiveGetProductsTesterBase :: this->m_from_timeGetOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_timeGetOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_timeGetOut[port].setObjName(portName); + this->m_from_timeGetOut[port].setObjName(portName.toChar()); #endif } @@ -129,21 +105,13 @@ void PassiveGetProductsTesterBase :: this->m_from_noArgsOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsOut[port].setObjName(portName); + this->m_from_noArgsOut[port].setObjName(portName.toChar()); #endif } @@ -161,21 +129,13 @@ void PassiveGetProductsTesterBase :: this->m_from_noArgsReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsReturnOut[port].setObjName(portName); + this->m_from_noArgsReturnOut[port].setObjName(portName.toChar()); #endif } @@ -193,21 +153,13 @@ void PassiveGetProductsTesterBase :: this->m_from_typedOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedOut[port].setObjName(portName); + this->m_from_typedOut[port].setObjName(portName.toChar()); #endif } @@ -225,21 +177,13 @@ void PassiveGetProductsTesterBase :: this->m_from_typedReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedReturnOut[port].setObjName(portName); + this->m_from_typedReturnOut[port].setObjName(portName.toChar()); #endif } @@ -252,21 +196,13 @@ void PassiveGetProductsTesterBase :: this->m_to_noArgsGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsGuarded[port].setObjName(portName); + this->m_to_noArgsGuarded[port].setObjName(portName.toChar()); #endif } @@ -279,21 +215,13 @@ void PassiveGetProductsTesterBase :: this->m_to_noArgsReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnGuarded[port].setObjName(portName); + this->m_to_noArgsReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -306,21 +234,13 @@ void PassiveGetProductsTesterBase :: this->m_to_noArgsReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnSync[port].setObjName(portName); + this->m_to_noArgsReturnSync[port].setObjName(portName.toChar()); #endif } @@ -333,21 +253,13 @@ void PassiveGetProductsTesterBase :: this->m_to_noArgsSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsSync[port].setObjName(portName); + this->m_to_noArgsSync[port].setObjName(portName.toChar()); #endif } @@ -360,21 +272,13 @@ void PassiveGetProductsTesterBase :: this->m_to_typedGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedGuarded[port].setObjName(portName); + this->m_to_typedGuarded[port].setObjName(portName.toChar()); #endif } @@ -387,21 +291,13 @@ void PassiveGetProductsTesterBase :: this->m_to_typedReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnGuarded[port].setObjName(portName); + this->m_to_typedReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -414,21 +310,13 @@ void PassiveGetProductsTesterBase :: this->m_to_typedReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnSync[port].setObjName(portName); + this->m_to_typedReturnSync[port].setObjName(portName.toChar()); #endif } @@ -441,21 +329,13 @@ void PassiveGetProductsTesterBase :: this->m_to_typedSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedSync[port].setObjName(portName); + this->m_to_typedSync[port].setObjName(portName.toChar()); #endif } } diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveGuardedProductsTesterBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveGuardedProductsTesterBase.ref.cpp index 36b832515..844056ccc 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveGuardedProductsTesterBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveGuardedProductsTesterBase.ref.cpp @@ -33,21 +33,13 @@ void PassiveGuardedProductsTesterBase :: this->m_from_productRequestOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_productRequestOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_productRequestOut[port].setObjName(portName); + this->m_from_productRequestOut[port].setObjName(portName.toChar()); #endif } @@ -65,21 +57,13 @@ void PassiveGuardedProductsTesterBase :: this->m_from_productSendOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_productSendOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_productSendOut[port].setObjName(portName); + this->m_from_productSendOut[port].setObjName(portName.toChar()); #endif } @@ -97,21 +81,13 @@ void PassiveGuardedProductsTesterBase :: this->m_from_timeGetOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_timeGetOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_timeGetOut[port].setObjName(portName); + this->m_from_timeGetOut[port].setObjName(portName.toChar()); #endif } @@ -129,21 +105,13 @@ void PassiveGuardedProductsTesterBase :: this->m_from_noArgsOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsOut[port].setObjName(portName); + this->m_from_noArgsOut[port].setObjName(portName.toChar()); #endif } @@ -161,21 +129,13 @@ void PassiveGuardedProductsTesterBase :: this->m_from_noArgsReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsReturnOut[port].setObjName(portName); + this->m_from_noArgsReturnOut[port].setObjName(portName.toChar()); #endif } @@ -193,21 +153,13 @@ void PassiveGuardedProductsTesterBase :: this->m_from_typedOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedOut[port].setObjName(portName); + this->m_from_typedOut[port].setObjName(portName.toChar()); #endif } @@ -225,21 +177,13 @@ void PassiveGuardedProductsTesterBase :: this->m_from_typedReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedReturnOut[port].setObjName(portName); + this->m_from_typedReturnOut[port].setObjName(portName.toChar()); #endif } @@ -252,21 +196,13 @@ void PassiveGuardedProductsTesterBase :: this->m_to_productRecvIn[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_productRecvIn[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_productRecvIn[port].setObjName(portName); + this->m_to_productRecvIn[port].setObjName(portName.toChar()); #endif } @@ -279,21 +215,13 @@ void PassiveGuardedProductsTesterBase :: this->m_to_noArgsGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsGuarded[port].setObjName(portName); + this->m_to_noArgsGuarded[port].setObjName(portName.toChar()); #endif } @@ -306,21 +234,13 @@ void PassiveGuardedProductsTesterBase :: this->m_to_noArgsReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnGuarded[port].setObjName(portName); + this->m_to_noArgsReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -333,21 +253,13 @@ void PassiveGuardedProductsTesterBase :: this->m_to_noArgsReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnSync[port].setObjName(portName); + this->m_to_noArgsReturnSync[port].setObjName(portName.toChar()); #endif } @@ -360,21 +272,13 @@ void PassiveGuardedProductsTesterBase :: this->m_to_noArgsSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsSync[port].setObjName(portName); + this->m_to_noArgsSync[port].setObjName(portName.toChar()); #endif } @@ -387,21 +291,13 @@ void PassiveGuardedProductsTesterBase :: this->m_to_typedGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedGuarded[port].setObjName(portName); + this->m_to_typedGuarded[port].setObjName(portName.toChar()); #endif } @@ -414,21 +310,13 @@ void PassiveGuardedProductsTesterBase :: this->m_to_typedReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnGuarded[port].setObjName(portName); + this->m_to_typedReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -441,21 +329,13 @@ void PassiveGuardedProductsTesterBase :: this->m_to_typedReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnSync[port].setObjName(portName); + this->m_to_typedReturnSync[port].setObjName(portName.toChar()); #endif } @@ -468,21 +348,13 @@ void PassiveGuardedProductsTesterBase :: this->m_to_typedSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedSync[port].setObjName(portName); + this->m_to_typedSync[port].setObjName(portName.toChar()); #endif } } diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveParamsTesterBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveParamsTesterBase.ref.cpp index fe7a0b896..b35ea82f0 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveParamsTesterBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveParamsTesterBase.ref.cpp @@ -33,21 +33,13 @@ void PassiveParamsTesterBase :: this->m_from_cmdRegOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_cmdRegOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_cmdRegOut[port].setObjName(portName); + this->m_from_cmdRegOut[port].setObjName(portName.toChar()); #endif } @@ -65,21 +57,13 @@ void PassiveParamsTesterBase :: this->m_from_cmdResponseOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_cmdResponseOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_cmdResponseOut[port].setObjName(portName); + this->m_from_cmdResponseOut[port].setObjName(portName.toChar()); #endif } @@ -97,21 +81,13 @@ void PassiveParamsTesterBase :: this->m_from_prmGetOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_prmGetOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_prmGetOut[port].setObjName(portName); + this->m_from_prmGetOut[port].setObjName(portName.toChar()); #endif } @@ -129,21 +105,13 @@ void PassiveParamsTesterBase :: this->m_from_prmSetOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_prmSetOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_prmSetOut[port].setObjName(portName); + this->m_from_prmSetOut[port].setObjName(portName.toChar()); #endif } @@ -161,21 +129,13 @@ void PassiveParamsTesterBase :: this->m_from_timeGetOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_timeGetOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_timeGetOut[port].setObjName(portName); + this->m_from_timeGetOut[port].setObjName(portName.toChar()); #endif } @@ -193,21 +153,13 @@ void PassiveParamsTesterBase :: this->m_from_noArgsOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsOut[port].setObjName(portName); + this->m_from_noArgsOut[port].setObjName(portName.toChar()); #endif } @@ -225,21 +177,13 @@ void PassiveParamsTesterBase :: this->m_from_noArgsReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsReturnOut[port].setObjName(portName); + this->m_from_noArgsReturnOut[port].setObjName(portName.toChar()); #endif } @@ -257,21 +201,13 @@ void PassiveParamsTesterBase :: this->m_from_typedOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedOut[port].setObjName(portName); + this->m_from_typedOut[port].setObjName(portName.toChar()); #endif } @@ -289,21 +225,13 @@ void PassiveParamsTesterBase :: this->m_from_typedReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedReturnOut[port].setObjName(portName); + this->m_from_typedReturnOut[port].setObjName(portName.toChar()); #endif } @@ -316,21 +244,13 @@ void PassiveParamsTesterBase :: this->m_to_cmdIn[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_cmdIn[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_cmdIn[port].setObjName(portName); + this->m_to_cmdIn[port].setObjName(portName.toChar()); #endif } @@ -343,21 +263,13 @@ void PassiveParamsTesterBase :: this->m_to_noArgsGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsGuarded[port].setObjName(portName); + this->m_to_noArgsGuarded[port].setObjName(portName.toChar()); #endif } @@ -370,21 +282,13 @@ void PassiveParamsTesterBase :: this->m_to_noArgsReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnGuarded[port].setObjName(portName); + this->m_to_noArgsReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -397,21 +301,13 @@ void PassiveParamsTesterBase :: this->m_to_noArgsReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnSync[port].setObjName(portName); + this->m_to_noArgsReturnSync[port].setObjName(portName.toChar()); #endif } @@ -424,21 +320,13 @@ void PassiveParamsTesterBase :: this->m_to_noArgsSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsSync[port].setObjName(portName); + this->m_to_noArgsSync[port].setObjName(portName.toChar()); #endif } @@ -451,21 +339,13 @@ void PassiveParamsTesterBase :: this->m_to_typedGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedGuarded[port].setObjName(portName); + this->m_to_typedGuarded[port].setObjName(portName.toChar()); #endif } @@ -478,21 +358,13 @@ void PassiveParamsTesterBase :: this->m_to_typedReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnGuarded[port].setObjName(portName); + this->m_to_typedReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -505,21 +377,13 @@ void PassiveParamsTesterBase :: this->m_to_typedReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnSync[port].setObjName(portName); + this->m_to_typedReturnSync[port].setObjName(portName.toChar()); #endif } @@ -532,21 +396,13 @@ void PassiveParamsTesterBase :: this->m_to_typedSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedSync[port].setObjName(portName); + this->m_to_typedSync[port].setObjName(portName.toChar()); #endif } } diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveSerialTesterBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveSerialTesterBase.ref.cpp index 7c913084d..451e1908b 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveSerialTesterBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveSerialTesterBase.ref.cpp @@ -33,21 +33,13 @@ void PassiveSerialTesterBase :: this->m_from_cmdRegOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_cmdRegOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_cmdRegOut[port].setObjName(portName); + this->m_from_cmdRegOut[port].setObjName(portName.toChar()); #endif } @@ -65,21 +57,13 @@ void PassiveSerialTesterBase :: this->m_from_cmdResponseOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_cmdResponseOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_cmdResponseOut[port].setObjName(portName); + this->m_from_cmdResponseOut[port].setObjName(portName.toChar()); #endif } @@ -97,21 +81,13 @@ void PassiveSerialTesterBase :: this->m_from_eventOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_eventOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_eventOut[port].setObjName(portName); + this->m_from_eventOut[port].setObjName(portName.toChar()); #endif } @@ -129,21 +105,13 @@ void PassiveSerialTesterBase :: this->m_from_prmGetOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_prmGetOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_prmGetOut[port].setObjName(portName); + this->m_from_prmGetOut[port].setObjName(portName.toChar()); #endif } @@ -161,21 +129,13 @@ void PassiveSerialTesterBase :: this->m_from_prmSetOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_prmSetOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_prmSetOut[port].setObjName(portName); + this->m_from_prmSetOut[port].setObjName(portName.toChar()); #endif } @@ -194,21 +154,13 @@ void PassiveSerialTesterBase :: this->m_from_textEventOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_textEventOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_textEventOut[port].setObjName(portName); + this->m_from_textEventOut[port].setObjName(portName.toChar()); #endif } #endif @@ -227,21 +179,13 @@ void PassiveSerialTesterBase :: this->m_from_timeGetOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_timeGetOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_timeGetOut[port].setObjName(portName); + this->m_from_timeGetOut[port].setObjName(portName.toChar()); #endif } @@ -259,21 +203,13 @@ void PassiveSerialTesterBase :: this->m_from_tlmOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_tlmOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_tlmOut[port].setObjName(portName); + this->m_from_tlmOut[port].setObjName(portName.toChar()); #endif } @@ -291,21 +227,13 @@ void PassiveSerialTesterBase :: this->m_from_noArgsOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsOut[port].setObjName(portName); + this->m_from_noArgsOut[port].setObjName(portName.toChar()); #endif } @@ -323,21 +251,13 @@ void PassiveSerialTesterBase :: this->m_from_noArgsReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsReturnOut[port].setObjName(portName); + this->m_from_noArgsReturnOut[port].setObjName(portName.toChar()); #endif } @@ -355,21 +275,13 @@ void PassiveSerialTesterBase :: this->m_from_typedOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedOut[port].setObjName(portName); + this->m_from_typedOut[port].setObjName(portName.toChar()); #endif } @@ -387,21 +299,13 @@ void PassiveSerialTesterBase :: this->m_from_typedReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedReturnOut[port].setObjName(portName); + this->m_from_typedReturnOut[port].setObjName(portName.toChar()); #endif } @@ -419,21 +323,13 @@ void PassiveSerialTesterBase :: this->m_from_serialOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_serialOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_serialOut[port].setObjName(portName); + this->m_from_serialOut[port].setObjName(portName.toChar()); #endif } @@ -446,21 +342,13 @@ void PassiveSerialTesterBase :: this->m_to_cmdIn[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_cmdIn[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_cmdIn[port].setObjName(portName); + this->m_to_cmdIn[port].setObjName(portName.toChar()); #endif } @@ -473,21 +361,13 @@ void PassiveSerialTesterBase :: this->m_to_noArgsGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsGuarded[port].setObjName(portName); + this->m_to_noArgsGuarded[port].setObjName(portName.toChar()); #endif } @@ -500,21 +380,13 @@ void PassiveSerialTesterBase :: this->m_to_noArgsReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnGuarded[port].setObjName(portName); + this->m_to_noArgsReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -527,21 +399,13 @@ void PassiveSerialTesterBase :: this->m_to_noArgsReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnSync[port].setObjName(portName); + this->m_to_noArgsReturnSync[port].setObjName(portName.toChar()); #endif } @@ -554,21 +418,13 @@ void PassiveSerialTesterBase :: this->m_to_noArgsSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsSync[port].setObjName(portName); + this->m_to_noArgsSync[port].setObjName(portName.toChar()); #endif } @@ -581,21 +437,13 @@ void PassiveSerialTesterBase :: this->m_to_typedGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedGuarded[port].setObjName(portName); + this->m_to_typedGuarded[port].setObjName(portName.toChar()); #endif } @@ -608,21 +456,13 @@ void PassiveSerialTesterBase :: this->m_to_typedReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnGuarded[port].setObjName(portName); + this->m_to_typedReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -635,21 +475,13 @@ void PassiveSerialTesterBase :: this->m_to_typedReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnSync[port].setObjName(portName); + this->m_to_typedReturnSync[port].setObjName(portName.toChar()); #endif } @@ -662,21 +494,13 @@ void PassiveSerialTesterBase :: this->m_to_typedSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedSync[port].setObjName(portName); + this->m_to_typedSync[port].setObjName(portName.toChar()); #endif } @@ -689,21 +513,13 @@ void PassiveSerialTesterBase :: this->m_to_serialGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_serialGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_serialGuarded[port].setObjName(portName); + this->m_to_serialGuarded[port].setObjName(portName.toChar()); #endif } @@ -716,21 +532,13 @@ void PassiveSerialTesterBase :: this->m_to_serialSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_serialSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_serialSync[port].setObjName(portName); + this->m_to_serialSync[port].setObjName(portName.toChar()); #endif } } diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveSyncProductsTesterBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveSyncProductsTesterBase.ref.cpp index e87f96258..edc110d7d 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveSyncProductsTesterBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveSyncProductsTesterBase.ref.cpp @@ -33,21 +33,13 @@ void PassiveSyncProductsTesterBase :: this->m_from_productRequestOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_productRequestOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_productRequestOut[port].setObjName(portName); + this->m_from_productRequestOut[port].setObjName(portName.toChar()); #endif } @@ -65,21 +57,13 @@ void PassiveSyncProductsTesterBase :: this->m_from_productSendOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_productSendOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_productSendOut[port].setObjName(portName); + this->m_from_productSendOut[port].setObjName(portName.toChar()); #endif } @@ -97,21 +81,13 @@ void PassiveSyncProductsTesterBase :: this->m_from_timeGetOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_timeGetOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_timeGetOut[port].setObjName(portName); + this->m_from_timeGetOut[port].setObjName(portName.toChar()); #endif } @@ -129,21 +105,13 @@ void PassiveSyncProductsTesterBase :: this->m_from_noArgsOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsOut[port].setObjName(portName); + this->m_from_noArgsOut[port].setObjName(portName.toChar()); #endif } @@ -161,21 +129,13 @@ void PassiveSyncProductsTesterBase :: this->m_from_noArgsReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsReturnOut[port].setObjName(portName); + this->m_from_noArgsReturnOut[port].setObjName(portName.toChar()); #endif } @@ -193,21 +153,13 @@ void PassiveSyncProductsTesterBase :: this->m_from_typedOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedOut[port].setObjName(portName); + this->m_from_typedOut[port].setObjName(portName.toChar()); #endif } @@ -225,21 +177,13 @@ void PassiveSyncProductsTesterBase :: this->m_from_typedReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedReturnOut[port].setObjName(portName); + this->m_from_typedReturnOut[port].setObjName(portName.toChar()); #endif } @@ -252,21 +196,13 @@ void PassiveSyncProductsTesterBase :: this->m_to_productRecvIn[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_productRecvIn[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_productRecvIn[port].setObjName(portName); + this->m_to_productRecvIn[port].setObjName(portName.toChar()); #endif } @@ -279,21 +215,13 @@ void PassiveSyncProductsTesterBase :: this->m_to_noArgsGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsGuarded[port].setObjName(portName); + this->m_to_noArgsGuarded[port].setObjName(portName.toChar()); #endif } @@ -306,21 +234,13 @@ void PassiveSyncProductsTesterBase :: this->m_to_noArgsReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnGuarded[port].setObjName(portName); + this->m_to_noArgsReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -333,21 +253,13 @@ void PassiveSyncProductsTesterBase :: this->m_to_noArgsReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnSync[port].setObjName(portName); + this->m_to_noArgsReturnSync[port].setObjName(portName.toChar()); #endif } @@ -360,21 +272,13 @@ void PassiveSyncProductsTesterBase :: this->m_to_noArgsSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsSync[port].setObjName(portName); + this->m_to_noArgsSync[port].setObjName(portName.toChar()); #endif } @@ -387,21 +291,13 @@ void PassiveSyncProductsTesterBase :: this->m_to_typedGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedGuarded[port].setObjName(portName); + this->m_to_typedGuarded[port].setObjName(portName.toChar()); #endif } @@ -414,21 +310,13 @@ void PassiveSyncProductsTesterBase :: this->m_to_typedReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnGuarded[port].setObjName(portName); + this->m_to_typedReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -441,21 +329,13 @@ void PassiveSyncProductsTesterBase :: this->m_to_typedReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnSync[port].setObjName(portName); + this->m_to_typedReturnSync[port].setObjName(portName.toChar()); #endif } @@ -468,21 +348,13 @@ void PassiveSyncProductsTesterBase :: this->m_to_typedSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedSync[port].setObjName(portName); + this->m_to_typedSync[port].setObjName(portName.toChar()); #endif } } diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveTelemetryTesterBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveTelemetryTesterBase.ref.cpp index bf065db0a..e90afb370 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveTelemetryTesterBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveTelemetryTesterBase.ref.cpp @@ -33,21 +33,13 @@ void PassiveTelemetryTesterBase :: this->m_from_timeGetOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_timeGetOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_timeGetOut[port].setObjName(portName); + this->m_from_timeGetOut[port].setObjName(portName.toChar()); #endif } @@ -65,21 +57,13 @@ void PassiveTelemetryTesterBase :: this->m_from_tlmOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_tlmOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_tlmOut[port].setObjName(portName); + this->m_from_tlmOut[port].setObjName(portName.toChar()); #endif } @@ -97,21 +81,13 @@ void PassiveTelemetryTesterBase :: this->m_from_noArgsOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsOut[port].setObjName(portName); + this->m_from_noArgsOut[port].setObjName(portName.toChar()); #endif } @@ -129,21 +105,13 @@ void PassiveTelemetryTesterBase :: this->m_from_noArgsReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsReturnOut[port].setObjName(portName); + this->m_from_noArgsReturnOut[port].setObjName(portName.toChar()); #endif } @@ -161,21 +129,13 @@ void PassiveTelemetryTesterBase :: this->m_from_typedOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedOut[port].setObjName(portName); + this->m_from_typedOut[port].setObjName(portName.toChar()); #endif } @@ -193,21 +153,13 @@ void PassiveTelemetryTesterBase :: this->m_from_typedReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedReturnOut[port].setObjName(portName); + this->m_from_typedReturnOut[port].setObjName(portName.toChar()); #endif } @@ -220,21 +172,13 @@ void PassiveTelemetryTesterBase :: this->m_to_noArgsGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsGuarded[port].setObjName(portName); + this->m_to_noArgsGuarded[port].setObjName(portName.toChar()); #endif } @@ -247,21 +191,13 @@ void PassiveTelemetryTesterBase :: this->m_to_noArgsReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnGuarded[port].setObjName(portName); + this->m_to_noArgsReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -274,21 +210,13 @@ void PassiveTelemetryTesterBase :: this->m_to_noArgsReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnSync[port].setObjName(portName); + this->m_to_noArgsReturnSync[port].setObjName(portName.toChar()); #endif } @@ -301,21 +229,13 @@ void PassiveTelemetryTesterBase :: this->m_to_noArgsSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsSync[port].setObjName(portName); + this->m_to_noArgsSync[port].setObjName(portName.toChar()); #endif } @@ -328,21 +248,13 @@ void PassiveTelemetryTesterBase :: this->m_to_typedGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedGuarded[port].setObjName(portName); + this->m_to_typedGuarded[port].setObjName(portName.toChar()); #endif } @@ -355,21 +267,13 @@ void PassiveTelemetryTesterBase :: this->m_to_typedReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnGuarded[port].setObjName(portName); + this->m_to_typedReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -382,21 +286,13 @@ void PassiveTelemetryTesterBase :: this->m_to_typedReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnSync[port].setObjName(portName); + this->m_to_typedReturnSync[port].setObjName(portName.toChar()); #endif } @@ -409,21 +305,13 @@ void PassiveTelemetryTesterBase :: this->m_to_typedSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedSync[port].setObjName(portName); + this->m_to_typedSync[port].setObjName(portName.toChar()); #endif } } diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveTestTesterBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveTestTesterBase.ref.cpp index 88fc61022..5c50511f7 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveTestTesterBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/PassiveTestTesterBase.ref.cpp @@ -33,21 +33,13 @@ void PassiveTestTesterBase :: this->m_from_cmdRegOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_cmdRegOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_cmdRegOut[port].setObjName(portName); + this->m_from_cmdRegOut[port].setObjName(portName.toChar()); #endif } @@ -65,21 +57,13 @@ void PassiveTestTesterBase :: this->m_from_cmdResponseOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_cmdResponseOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_cmdResponseOut[port].setObjName(portName); + this->m_from_cmdResponseOut[port].setObjName(portName.toChar()); #endif } @@ -97,21 +81,13 @@ void PassiveTestTesterBase :: this->m_from_eventOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_eventOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_eventOut[port].setObjName(portName); + this->m_from_eventOut[port].setObjName(portName.toChar()); #endif } @@ -129,21 +105,13 @@ void PassiveTestTesterBase :: this->m_from_prmGetOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_prmGetOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_prmGetOut[port].setObjName(portName); + this->m_from_prmGetOut[port].setObjName(portName.toChar()); #endif } @@ -161,21 +129,13 @@ void PassiveTestTesterBase :: this->m_from_prmSetOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_prmSetOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_prmSetOut[port].setObjName(portName); + this->m_from_prmSetOut[port].setObjName(portName.toChar()); #endif } @@ -193,21 +153,13 @@ void PassiveTestTesterBase :: this->m_from_productRequestOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_productRequestOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_productRequestOut[port].setObjName(portName); + this->m_from_productRequestOut[port].setObjName(portName.toChar()); #endif } @@ -225,21 +177,13 @@ void PassiveTestTesterBase :: this->m_from_productSendOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_productSendOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_productSendOut[port].setObjName(portName); + this->m_from_productSendOut[port].setObjName(portName.toChar()); #endif } @@ -258,21 +202,13 @@ void PassiveTestTesterBase :: this->m_from_textEventOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_textEventOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_textEventOut[port].setObjName(portName); + this->m_from_textEventOut[port].setObjName(portName.toChar()); #endif } #endif @@ -291,21 +227,13 @@ void PassiveTestTesterBase :: this->m_from_timeGetOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_timeGetOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_timeGetOut[port].setObjName(portName); + this->m_from_timeGetOut[port].setObjName(portName.toChar()); #endif } @@ -323,21 +251,13 @@ void PassiveTestTesterBase :: this->m_from_tlmOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_tlmOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_tlmOut[port].setObjName(portName); + this->m_from_tlmOut[port].setObjName(portName.toChar()); #endif } @@ -355,21 +275,13 @@ void PassiveTestTesterBase :: this->m_from_noArgsOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsOut[port].setObjName(portName); + this->m_from_noArgsOut[port].setObjName(portName.toChar()); #endif } @@ -387,21 +299,13 @@ void PassiveTestTesterBase :: this->m_from_noArgsReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsReturnOut[port].setObjName(portName); + this->m_from_noArgsReturnOut[port].setObjName(portName.toChar()); #endif } @@ -419,21 +323,13 @@ void PassiveTestTesterBase :: this->m_from_typedOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedOut[port].setObjName(portName); + this->m_from_typedOut[port].setObjName(portName.toChar()); #endif } @@ -451,21 +347,13 @@ void PassiveTestTesterBase :: this->m_from_typedReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedReturnOut[port].setObjName(portName); + this->m_from_typedReturnOut[port].setObjName(portName.toChar()); #endif } @@ -478,21 +366,13 @@ void PassiveTestTesterBase :: this->m_to_cmdIn[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_cmdIn[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_cmdIn[port].setObjName(portName); + this->m_to_cmdIn[port].setObjName(portName.toChar()); #endif } @@ -505,21 +385,13 @@ void PassiveTestTesterBase :: this->m_to_productRecvIn[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_productRecvIn[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_productRecvIn[port].setObjName(portName); + this->m_to_productRecvIn[port].setObjName(portName.toChar()); #endif } @@ -532,21 +404,13 @@ void PassiveTestTesterBase :: this->m_to_noArgsGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsGuarded[port].setObjName(portName); + this->m_to_noArgsGuarded[port].setObjName(portName.toChar()); #endif } @@ -559,21 +423,13 @@ void PassiveTestTesterBase :: this->m_to_noArgsReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnGuarded[port].setObjName(portName); + this->m_to_noArgsReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -586,21 +442,13 @@ void PassiveTestTesterBase :: this->m_to_noArgsReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnSync[port].setObjName(portName); + this->m_to_noArgsReturnSync[port].setObjName(portName.toChar()); #endif } @@ -613,21 +461,13 @@ void PassiveTestTesterBase :: this->m_to_noArgsSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsSync[port].setObjName(portName); + this->m_to_noArgsSync[port].setObjName(portName.toChar()); #endif } @@ -640,21 +480,13 @@ void PassiveTestTesterBase :: this->m_to_typedGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedGuarded[port].setObjName(portName); + this->m_to_typedGuarded[port].setObjName(portName.toChar()); #endif } @@ -667,21 +499,13 @@ void PassiveTestTesterBase :: this->m_to_typedReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnGuarded[port].setObjName(portName); + this->m_to_typedReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -694,21 +518,13 @@ void PassiveTestTesterBase :: this->m_to_typedReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnSync[port].setObjName(portName); + this->m_to_typedReturnSync[port].setObjName(portName.toChar()); #endif } @@ -721,21 +537,13 @@ void PassiveTestTesterBase :: this->m_to_typedSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedSync[port].setObjName(portName); + this->m_to_typedSync[port].setObjName(portName.toChar()); #endif } } diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedAsyncProductsTesterBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedAsyncProductsTesterBase.ref.cpp index 9deac4099..5afb480c6 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedAsyncProductsTesterBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedAsyncProductsTesterBase.ref.cpp @@ -33,21 +33,13 @@ void QueuedAsyncProductsTesterBase :: this->m_from_productRequestOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_productRequestOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_productRequestOut[port].setObjName(portName); + this->m_from_productRequestOut[port].setObjName(portName.toChar()); #endif } @@ -65,21 +57,13 @@ void QueuedAsyncProductsTesterBase :: this->m_from_productSendOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_productSendOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_productSendOut[port].setObjName(portName); + this->m_from_productSendOut[port].setObjName(portName.toChar()); #endif } @@ -97,21 +81,13 @@ void QueuedAsyncProductsTesterBase :: this->m_from_timeGetOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_timeGetOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_timeGetOut[port].setObjName(portName); + this->m_from_timeGetOut[port].setObjName(portName.toChar()); #endif } @@ -129,21 +105,13 @@ void QueuedAsyncProductsTesterBase :: this->m_from_noArgsOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsOut[port].setObjName(portName); + this->m_from_noArgsOut[port].setObjName(portName.toChar()); #endif } @@ -161,21 +129,13 @@ void QueuedAsyncProductsTesterBase :: this->m_from_noArgsReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsReturnOut[port].setObjName(portName); + this->m_from_noArgsReturnOut[port].setObjName(portName.toChar()); #endif } @@ -193,21 +153,13 @@ void QueuedAsyncProductsTesterBase :: this->m_from_typedOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedOut[port].setObjName(portName); + this->m_from_typedOut[port].setObjName(portName.toChar()); #endif } @@ -225,21 +177,13 @@ void QueuedAsyncProductsTesterBase :: this->m_from_typedReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedReturnOut[port].setObjName(portName); + this->m_from_typedReturnOut[port].setObjName(portName.toChar()); #endif } @@ -252,21 +196,13 @@ void QueuedAsyncProductsTesterBase :: this->m_to_productRecvIn[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_productRecvIn[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_productRecvIn[port].setObjName(portName); + this->m_to_productRecvIn[port].setObjName(portName.toChar()); #endif } @@ -279,21 +215,13 @@ void QueuedAsyncProductsTesterBase :: this->m_to_noArgsAsync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsAsync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsAsync[port].setObjName(portName); + this->m_to_noArgsAsync[port].setObjName(portName.toChar()); #endif } @@ -306,21 +234,13 @@ void QueuedAsyncProductsTesterBase :: this->m_to_noArgsGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsGuarded[port].setObjName(portName); + this->m_to_noArgsGuarded[port].setObjName(portName.toChar()); #endif } @@ -333,21 +253,13 @@ void QueuedAsyncProductsTesterBase :: this->m_to_noArgsReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnGuarded[port].setObjName(portName); + this->m_to_noArgsReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -360,21 +272,13 @@ void QueuedAsyncProductsTesterBase :: this->m_to_noArgsReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnSync[port].setObjName(portName); + this->m_to_noArgsReturnSync[port].setObjName(portName.toChar()); #endif } @@ -387,21 +291,13 @@ void QueuedAsyncProductsTesterBase :: this->m_to_noArgsSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsSync[port].setObjName(portName); + this->m_to_noArgsSync[port].setObjName(portName.toChar()); #endif } @@ -414,21 +310,13 @@ void QueuedAsyncProductsTesterBase :: this->m_to_typedAsync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsync[port].setObjName(portName); + this->m_to_typedAsync[port].setObjName(portName.toChar()); #endif } @@ -441,21 +329,13 @@ void QueuedAsyncProductsTesterBase :: this->m_to_typedAsyncAssert[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncAssert[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncAssert[port].setObjName(portName); + this->m_to_typedAsyncAssert[port].setObjName(portName.toChar()); #endif } @@ -468,21 +348,13 @@ void QueuedAsyncProductsTesterBase :: this->m_to_typedAsyncBlockPriority[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncBlockPriority[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncBlockPriority[port].setObjName(portName); + this->m_to_typedAsyncBlockPriority[port].setObjName(portName.toChar()); #endif } @@ -495,21 +367,13 @@ void QueuedAsyncProductsTesterBase :: this->m_to_typedAsyncDropPriority[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncDropPriority[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncDropPriority[port].setObjName(portName); + this->m_to_typedAsyncDropPriority[port].setObjName(portName.toChar()); #endif } @@ -522,21 +386,13 @@ void QueuedAsyncProductsTesterBase :: this->m_to_typedGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedGuarded[port].setObjName(portName); + this->m_to_typedGuarded[port].setObjName(portName.toChar()); #endif } @@ -549,21 +405,13 @@ void QueuedAsyncProductsTesterBase :: this->m_to_typedReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnGuarded[port].setObjName(portName); + this->m_to_typedReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -576,21 +424,13 @@ void QueuedAsyncProductsTesterBase :: this->m_to_typedReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnSync[port].setObjName(portName); + this->m_to_typedReturnSync[port].setObjName(portName.toChar()); #endif } @@ -603,21 +443,13 @@ void QueuedAsyncProductsTesterBase :: this->m_to_typedSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedSync[port].setObjName(portName); + this->m_to_typedSync[port].setObjName(portName.toChar()); #endif } } diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedCommandsTesterBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedCommandsTesterBase.ref.cpp index f9b0e4aa2..16e5b33b3 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedCommandsTesterBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedCommandsTesterBase.ref.cpp @@ -33,21 +33,13 @@ void QueuedCommandsTesterBase :: this->m_from_cmdRegOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_cmdRegOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_cmdRegOut[port].setObjName(portName); + this->m_from_cmdRegOut[port].setObjName(portName.toChar()); #endif } @@ -65,21 +57,13 @@ void QueuedCommandsTesterBase :: this->m_from_cmdResponseOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_cmdResponseOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_cmdResponseOut[port].setObjName(portName); + this->m_from_cmdResponseOut[port].setObjName(portName.toChar()); #endif } @@ -97,21 +81,13 @@ void QueuedCommandsTesterBase :: this->m_from_timeGetOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_timeGetOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_timeGetOut[port].setObjName(portName); + this->m_from_timeGetOut[port].setObjName(portName.toChar()); #endif } @@ -129,21 +105,13 @@ void QueuedCommandsTesterBase :: this->m_from_noArgsOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsOut[port].setObjName(portName); + this->m_from_noArgsOut[port].setObjName(portName.toChar()); #endif } @@ -161,21 +129,13 @@ void QueuedCommandsTesterBase :: this->m_from_noArgsReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsReturnOut[port].setObjName(portName); + this->m_from_noArgsReturnOut[port].setObjName(portName.toChar()); #endif } @@ -193,21 +153,13 @@ void QueuedCommandsTesterBase :: this->m_from_typedOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedOut[port].setObjName(portName); + this->m_from_typedOut[port].setObjName(portName.toChar()); #endif } @@ -225,21 +177,13 @@ void QueuedCommandsTesterBase :: this->m_from_typedReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedReturnOut[port].setObjName(portName); + this->m_from_typedReturnOut[port].setObjName(portName.toChar()); #endif } @@ -252,21 +196,13 @@ void QueuedCommandsTesterBase :: this->m_to_cmdIn[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_cmdIn[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_cmdIn[port].setObjName(portName); + this->m_to_cmdIn[port].setObjName(portName.toChar()); #endif } @@ -279,21 +215,13 @@ void QueuedCommandsTesterBase :: this->m_to_noArgsAsync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsAsync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsAsync[port].setObjName(portName); + this->m_to_noArgsAsync[port].setObjName(portName.toChar()); #endif } @@ -306,21 +234,13 @@ void QueuedCommandsTesterBase :: this->m_to_noArgsGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsGuarded[port].setObjName(portName); + this->m_to_noArgsGuarded[port].setObjName(portName.toChar()); #endif } @@ -333,21 +253,13 @@ void QueuedCommandsTesterBase :: this->m_to_noArgsReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnGuarded[port].setObjName(portName); + this->m_to_noArgsReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -360,21 +272,13 @@ void QueuedCommandsTesterBase :: this->m_to_noArgsReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnSync[port].setObjName(portName); + this->m_to_noArgsReturnSync[port].setObjName(portName.toChar()); #endif } @@ -387,21 +291,13 @@ void QueuedCommandsTesterBase :: this->m_to_noArgsSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsSync[port].setObjName(portName); + this->m_to_noArgsSync[port].setObjName(portName.toChar()); #endif } @@ -414,21 +310,13 @@ void QueuedCommandsTesterBase :: this->m_to_typedAsync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsync[port].setObjName(portName); + this->m_to_typedAsync[port].setObjName(portName.toChar()); #endif } @@ -441,21 +329,13 @@ void QueuedCommandsTesterBase :: this->m_to_typedAsyncAssert[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncAssert[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncAssert[port].setObjName(portName); + this->m_to_typedAsyncAssert[port].setObjName(portName.toChar()); #endif } @@ -468,21 +348,13 @@ void QueuedCommandsTesterBase :: this->m_to_typedAsyncBlockPriority[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncBlockPriority[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncBlockPriority[port].setObjName(portName); + this->m_to_typedAsyncBlockPriority[port].setObjName(portName.toChar()); #endif } @@ -495,21 +367,13 @@ void QueuedCommandsTesterBase :: this->m_to_typedAsyncDropPriority[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncDropPriority[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncDropPriority[port].setObjName(portName); + this->m_to_typedAsyncDropPriority[port].setObjName(portName.toChar()); #endif } @@ -522,21 +386,13 @@ void QueuedCommandsTesterBase :: this->m_to_typedGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedGuarded[port].setObjName(portName); + this->m_to_typedGuarded[port].setObjName(portName.toChar()); #endif } @@ -549,21 +405,13 @@ void QueuedCommandsTesterBase :: this->m_to_typedReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnGuarded[port].setObjName(portName); + this->m_to_typedReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -576,21 +424,13 @@ void QueuedCommandsTesterBase :: this->m_to_typedReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnSync[port].setObjName(portName); + this->m_to_typedReturnSync[port].setObjName(portName.toChar()); #endif } @@ -603,21 +443,13 @@ void QueuedCommandsTesterBase :: this->m_to_typedSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedSync[port].setObjName(portName); + this->m_to_typedSync[port].setObjName(portName.toChar()); #endif } } diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedEventsTesterBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedEventsTesterBase.ref.cpp index 5c4309f68..6ddbc8d0a 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedEventsTesterBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedEventsTesterBase.ref.cpp @@ -33,21 +33,13 @@ void QueuedEventsTesterBase :: this->m_from_eventOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_eventOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_eventOut[port].setObjName(portName); + this->m_from_eventOut[port].setObjName(portName.toChar()); #endif } @@ -66,21 +58,13 @@ void QueuedEventsTesterBase :: this->m_from_textEventOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_textEventOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_textEventOut[port].setObjName(portName); + this->m_from_textEventOut[port].setObjName(portName.toChar()); #endif } #endif @@ -99,21 +83,13 @@ void QueuedEventsTesterBase :: this->m_from_timeGetOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_timeGetOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_timeGetOut[port].setObjName(portName); + this->m_from_timeGetOut[port].setObjName(portName.toChar()); #endif } @@ -131,21 +107,13 @@ void QueuedEventsTesterBase :: this->m_from_noArgsOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsOut[port].setObjName(portName); + this->m_from_noArgsOut[port].setObjName(portName.toChar()); #endif } @@ -163,21 +131,13 @@ void QueuedEventsTesterBase :: this->m_from_noArgsReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsReturnOut[port].setObjName(portName); + this->m_from_noArgsReturnOut[port].setObjName(portName.toChar()); #endif } @@ -195,21 +155,13 @@ void QueuedEventsTesterBase :: this->m_from_typedOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedOut[port].setObjName(portName); + this->m_from_typedOut[port].setObjName(portName.toChar()); #endif } @@ -227,21 +179,13 @@ void QueuedEventsTesterBase :: this->m_from_typedReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedReturnOut[port].setObjName(portName); + this->m_from_typedReturnOut[port].setObjName(portName.toChar()); #endif } @@ -254,21 +198,13 @@ void QueuedEventsTesterBase :: this->m_to_noArgsAsync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsAsync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsAsync[port].setObjName(portName); + this->m_to_noArgsAsync[port].setObjName(portName.toChar()); #endif } @@ -281,21 +217,13 @@ void QueuedEventsTesterBase :: this->m_to_noArgsGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsGuarded[port].setObjName(portName); + this->m_to_noArgsGuarded[port].setObjName(portName.toChar()); #endif } @@ -308,21 +236,13 @@ void QueuedEventsTesterBase :: this->m_to_noArgsReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnGuarded[port].setObjName(portName); + this->m_to_noArgsReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -335,21 +255,13 @@ void QueuedEventsTesterBase :: this->m_to_noArgsReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnSync[port].setObjName(portName); + this->m_to_noArgsReturnSync[port].setObjName(portName.toChar()); #endif } @@ -362,21 +274,13 @@ void QueuedEventsTesterBase :: this->m_to_noArgsSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsSync[port].setObjName(portName); + this->m_to_noArgsSync[port].setObjName(portName.toChar()); #endif } @@ -389,21 +293,13 @@ void QueuedEventsTesterBase :: this->m_to_typedAsync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsync[port].setObjName(portName); + this->m_to_typedAsync[port].setObjName(portName.toChar()); #endif } @@ -416,21 +312,13 @@ void QueuedEventsTesterBase :: this->m_to_typedAsyncAssert[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncAssert[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncAssert[port].setObjName(portName); + this->m_to_typedAsyncAssert[port].setObjName(portName.toChar()); #endif } @@ -443,21 +331,13 @@ void QueuedEventsTesterBase :: this->m_to_typedAsyncBlockPriority[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncBlockPriority[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncBlockPriority[port].setObjName(portName); + this->m_to_typedAsyncBlockPriority[port].setObjName(portName.toChar()); #endif } @@ -470,21 +350,13 @@ void QueuedEventsTesterBase :: this->m_to_typedAsyncDropPriority[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncDropPriority[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncDropPriority[port].setObjName(portName); + this->m_to_typedAsyncDropPriority[port].setObjName(portName.toChar()); #endif } @@ -497,21 +369,13 @@ void QueuedEventsTesterBase :: this->m_to_typedGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedGuarded[port].setObjName(portName); + this->m_to_typedGuarded[port].setObjName(portName.toChar()); #endif } @@ -524,21 +388,13 @@ void QueuedEventsTesterBase :: this->m_to_typedReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnGuarded[port].setObjName(portName); + this->m_to_typedReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -551,21 +407,13 @@ void QueuedEventsTesterBase :: this->m_to_typedReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnSync[port].setObjName(portName); + this->m_to_typedReturnSync[port].setObjName(portName.toChar()); #endif } @@ -578,21 +426,13 @@ void QueuedEventsTesterBase :: this->m_to_typedSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedSync[port].setObjName(portName); + this->m_to_typedSync[port].setObjName(portName.toChar()); #endif } } diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedGetProductsTesterBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedGetProductsTesterBase.ref.cpp index 063e79ddb..e6b1289e1 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedGetProductsTesterBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedGetProductsTesterBase.ref.cpp @@ -33,21 +33,13 @@ void QueuedGetProductsTesterBase :: this->m_from_productGetOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_productGetOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_productGetOut[port].setObjName(portName); + this->m_from_productGetOut[port].setObjName(portName.toChar()); #endif } @@ -65,21 +57,13 @@ void QueuedGetProductsTesterBase :: this->m_from_productSendOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_productSendOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_productSendOut[port].setObjName(portName); + this->m_from_productSendOut[port].setObjName(portName.toChar()); #endif } @@ -97,21 +81,13 @@ void QueuedGetProductsTesterBase :: this->m_from_timeGetOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_timeGetOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_timeGetOut[port].setObjName(portName); + this->m_from_timeGetOut[port].setObjName(portName.toChar()); #endif } @@ -129,21 +105,13 @@ void QueuedGetProductsTesterBase :: this->m_from_noArgsOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsOut[port].setObjName(portName); + this->m_from_noArgsOut[port].setObjName(portName.toChar()); #endif } @@ -161,21 +129,13 @@ void QueuedGetProductsTesterBase :: this->m_from_noArgsReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsReturnOut[port].setObjName(portName); + this->m_from_noArgsReturnOut[port].setObjName(portName.toChar()); #endif } @@ -193,21 +153,13 @@ void QueuedGetProductsTesterBase :: this->m_from_typedOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedOut[port].setObjName(portName); + this->m_from_typedOut[port].setObjName(portName.toChar()); #endif } @@ -225,21 +177,13 @@ void QueuedGetProductsTesterBase :: this->m_from_typedReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedReturnOut[port].setObjName(portName); + this->m_from_typedReturnOut[port].setObjName(portName.toChar()); #endif } @@ -252,21 +196,13 @@ void QueuedGetProductsTesterBase :: this->m_to_noArgsAsync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsAsync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsAsync[port].setObjName(portName); + this->m_to_noArgsAsync[port].setObjName(portName.toChar()); #endif } @@ -279,21 +215,13 @@ void QueuedGetProductsTesterBase :: this->m_to_noArgsGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsGuarded[port].setObjName(portName); + this->m_to_noArgsGuarded[port].setObjName(portName.toChar()); #endif } @@ -306,21 +234,13 @@ void QueuedGetProductsTesterBase :: this->m_to_noArgsReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnGuarded[port].setObjName(portName); + this->m_to_noArgsReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -333,21 +253,13 @@ void QueuedGetProductsTesterBase :: this->m_to_noArgsReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnSync[port].setObjName(portName); + this->m_to_noArgsReturnSync[port].setObjName(portName.toChar()); #endif } @@ -360,21 +272,13 @@ void QueuedGetProductsTesterBase :: this->m_to_noArgsSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsSync[port].setObjName(portName); + this->m_to_noArgsSync[port].setObjName(portName.toChar()); #endif } @@ -387,21 +291,13 @@ void QueuedGetProductsTesterBase :: this->m_to_typedAsync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsync[port].setObjName(portName); + this->m_to_typedAsync[port].setObjName(portName.toChar()); #endif } @@ -414,21 +310,13 @@ void QueuedGetProductsTesterBase :: this->m_to_typedAsyncAssert[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncAssert[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncAssert[port].setObjName(portName); + this->m_to_typedAsyncAssert[port].setObjName(portName.toChar()); #endif } @@ -441,21 +329,13 @@ void QueuedGetProductsTesterBase :: this->m_to_typedAsyncBlockPriority[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncBlockPriority[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncBlockPriority[port].setObjName(portName); + this->m_to_typedAsyncBlockPriority[port].setObjName(portName.toChar()); #endif } @@ -468,21 +348,13 @@ void QueuedGetProductsTesterBase :: this->m_to_typedAsyncDropPriority[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncDropPriority[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncDropPriority[port].setObjName(portName); + this->m_to_typedAsyncDropPriority[port].setObjName(portName.toChar()); #endif } @@ -495,21 +367,13 @@ void QueuedGetProductsTesterBase :: this->m_to_typedGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedGuarded[port].setObjName(portName); + this->m_to_typedGuarded[port].setObjName(portName.toChar()); #endif } @@ -522,21 +386,13 @@ void QueuedGetProductsTesterBase :: this->m_to_typedReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnGuarded[port].setObjName(portName); + this->m_to_typedReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -549,21 +405,13 @@ void QueuedGetProductsTesterBase :: this->m_to_typedReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnSync[port].setObjName(portName); + this->m_to_typedReturnSync[port].setObjName(portName.toChar()); #endif } @@ -576,21 +424,13 @@ void QueuedGetProductsTesterBase :: this->m_to_typedSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedSync[port].setObjName(portName); + this->m_to_typedSync[port].setObjName(portName.toChar()); #endif } } diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedGuardedProductsTesterBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedGuardedProductsTesterBase.ref.cpp index 96aeaec5d..51b23d7ef 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedGuardedProductsTesterBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedGuardedProductsTesterBase.ref.cpp @@ -33,21 +33,13 @@ void QueuedGuardedProductsTesterBase :: this->m_from_productRequestOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_productRequestOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_productRequestOut[port].setObjName(portName); + this->m_from_productRequestOut[port].setObjName(portName.toChar()); #endif } @@ -65,21 +57,13 @@ void QueuedGuardedProductsTesterBase :: this->m_from_productSendOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_productSendOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_productSendOut[port].setObjName(portName); + this->m_from_productSendOut[port].setObjName(portName.toChar()); #endif } @@ -97,21 +81,13 @@ void QueuedGuardedProductsTesterBase :: this->m_from_timeGetOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_timeGetOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_timeGetOut[port].setObjName(portName); + this->m_from_timeGetOut[port].setObjName(portName.toChar()); #endif } @@ -129,21 +105,13 @@ void QueuedGuardedProductsTesterBase :: this->m_from_noArgsOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsOut[port].setObjName(portName); + this->m_from_noArgsOut[port].setObjName(portName.toChar()); #endif } @@ -161,21 +129,13 @@ void QueuedGuardedProductsTesterBase :: this->m_from_noArgsReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsReturnOut[port].setObjName(portName); + this->m_from_noArgsReturnOut[port].setObjName(portName.toChar()); #endif } @@ -193,21 +153,13 @@ void QueuedGuardedProductsTesterBase :: this->m_from_typedOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedOut[port].setObjName(portName); + this->m_from_typedOut[port].setObjName(portName.toChar()); #endif } @@ -225,21 +177,13 @@ void QueuedGuardedProductsTesterBase :: this->m_from_typedReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedReturnOut[port].setObjName(portName); + this->m_from_typedReturnOut[port].setObjName(portName.toChar()); #endif } @@ -252,21 +196,13 @@ void QueuedGuardedProductsTesterBase :: this->m_to_productRecvIn[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_productRecvIn[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_productRecvIn[port].setObjName(portName); + this->m_to_productRecvIn[port].setObjName(portName.toChar()); #endif } @@ -279,21 +215,13 @@ void QueuedGuardedProductsTesterBase :: this->m_to_noArgsAsync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsAsync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsAsync[port].setObjName(portName); + this->m_to_noArgsAsync[port].setObjName(portName.toChar()); #endif } @@ -306,21 +234,13 @@ void QueuedGuardedProductsTesterBase :: this->m_to_noArgsGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsGuarded[port].setObjName(portName); + this->m_to_noArgsGuarded[port].setObjName(portName.toChar()); #endif } @@ -333,21 +253,13 @@ void QueuedGuardedProductsTesterBase :: this->m_to_noArgsReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnGuarded[port].setObjName(portName); + this->m_to_noArgsReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -360,21 +272,13 @@ void QueuedGuardedProductsTesterBase :: this->m_to_noArgsReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnSync[port].setObjName(portName); + this->m_to_noArgsReturnSync[port].setObjName(portName.toChar()); #endif } @@ -387,21 +291,13 @@ void QueuedGuardedProductsTesterBase :: this->m_to_noArgsSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsSync[port].setObjName(portName); + this->m_to_noArgsSync[port].setObjName(portName.toChar()); #endif } @@ -414,21 +310,13 @@ void QueuedGuardedProductsTesterBase :: this->m_to_typedAsync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsync[port].setObjName(portName); + this->m_to_typedAsync[port].setObjName(portName.toChar()); #endif } @@ -441,21 +329,13 @@ void QueuedGuardedProductsTesterBase :: this->m_to_typedAsyncAssert[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncAssert[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncAssert[port].setObjName(portName); + this->m_to_typedAsyncAssert[port].setObjName(portName.toChar()); #endif } @@ -468,21 +348,13 @@ void QueuedGuardedProductsTesterBase :: this->m_to_typedAsyncBlockPriority[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncBlockPriority[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncBlockPriority[port].setObjName(portName); + this->m_to_typedAsyncBlockPriority[port].setObjName(portName.toChar()); #endif } @@ -495,21 +367,13 @@ void QueuedGuardedProductsTesterBase :: this->m_to_typedAsyncDropPriority[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncDropPriority[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncDropPriority[port].setObjName(portName); + this->m_to_typedAsyncDropPriority[port].setObjName(portName.toChar()); #endif } @@ -522,21 +386,13 @@ void QueuedGuardedProductsTesterBase :: this->m_to_typedGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedGuarded[port].setObjName(portName); + this->m_to_typedGuarded[port].setObjName(portName.toChar()); #endif } @@ -549,21 +405,13 @@ void QueuedGuardedProductsTesterBase :: this->m_to_typedReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnGuarded[port].setObjName(portName); + this->m_to_typedReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -576,21 +424,13 @@ void QueuedGuardedProductsTesterBase :: this->m_to_typedReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnSync[port].setObjName(portName); + this->m_to_typedReturnSync[port].setObjName(portName.toChar()); #endif } @@ -603,21 +443,13 @@ void QueuedGuardedProductsTesterBase :: this->m_to_typedSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedSync[port].setObjName(portName); + this->m_to_typedSync[port].setObjName(portName.toChar()); #endif } } diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedNoArgsPortsOnlyTesterBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedNoArgsPortsOnlyTesterBase.ref.cpp index b2a33aa2a..48b38a1a6 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedNoArgsPortsOnlyTesterBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedNoArgsPortsOnlyTesterBase.ref.cpp @@ -33,21 +33,13 @@ void QueuedNoArgsPortsOnlyTesterBase :: this->m_from_noArgsOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsOut[port].setObjName(portName); + this->m_from_noArgsOut[port].setObjName(portName.toChar()); #endif } @@ -65,21 +57,13 @@ void QueuedNoArgsPortsOnlyTesterBase :: this->m_from_noArgsReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsReturnOut[port].setObjName(portName); + this->m_from_noArgsReturnOut[port].setObjName(portName.toChar()); #endif } @@ -92,21 +76,13 @@ void QueuedNoArgsPortsOnlyTesterBase :: this->m_to_noArgsAsync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsAsync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsAsync[port].setObjName(portName); + this->m_to_noArgsAsync[port].setObjName(portName.toChar()); #endif } @@ -119,21 +95,13 @@ void QueuedNoArgsPortsOnlyTesterBase :: this->m_to_noArgsGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsGuarded[port].setObjName(portName); + this->m_to_noArgsGuarded[port].setObjName(portName.toChar()); #endif } @@ -146,21 +114,13 @@ void QueuedNoArgsPortsOnlyTesterBase :: this->m_to_noArgsReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnGuarded[port].setObjName(portName); + this->m_to_noArgsReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -173,21 +133,13 @@ void QueuedNoArgsPortsOnlyTesterBase :: this->m_to_noArgsReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnSync[port].setObjName(portName); + this->m_to_noArgsReturnSync[port].setObjName(portName.toChar()); #endif } } diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedParamsTesterBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedParamsTesterBase.ref.cpp index dffa889cf..272311993 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedParamsTesterBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedParamsTesterBase.ref.cpp @@ -33,21 +33,13 @@ void QueuedParamsTesterBase :: this->m_from_cmdRegOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_cmdRegOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_cmdRegOut[port].setObjName(portName); + this->m_from_cmdRegOut[port].setObjName(portName.toChar()); #endif } @@ -65,21 +57,13 @@ void QueuedParamsTesterBase :: this->m_from_cmdResponseOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_cmdResponseOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_cmdResponseOut[port].setObjName(portName); + this->m_from_cmdResponseOut[port].setObjName(portName.toChar()); #endif } @@ -97,21 +81,13 @@ void QueuedParamsTesterBase :: this->m_from_prmGetOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_prmGetOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_prmGetOut[port].setObjName(portName); + this->m_from_prmGetOut[port].setObjName(portName.toChar()); #endif } @@ -129,21 +105,13 @@ void QueuedParamsTesterBase :: this->m_from_prmSetOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_prmSetOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_prmSetOut[port].setObjName(portName); + this->m_from_prmSetOut[port].setObjName(portName.toChar()); #endif } @@ -161,21 +129,13 @@ void QueuedParamsTesterBase :: this->m_from_timeGetOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_timeGetOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_timeGetOut[port].setObjName(portName); + this->m_from_timeGetOut[port].setObjName(portName.toChar()); #endif } @@ -193,21 +153,13 @@ void QueuedParamsTesterBase :: this->m_from_noArgsOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsOut[port].setObjName(portName); + this->m_from_noArgsOut[port].setObjName(portName.toChar()); #endif } @@ -225,21 +177,13 @@ void QueuedParamsTesterBase :: this->m_from_noArgsReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsReturnOut[port].setObjName(portName); + this->m_from_noArgsReturnOut[port].setObjName(portName.toChar()); #endif } @@ -257,21 +201,13 @@ void QueuedParamsTesterBase :: this->m_from_typedOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedOut[port].setObjName(portName); + this->m_from_typedOut[port].setObjName(portName.toChar()); #endif } @@ -289,21 +225,13 @@ void QueuedParamsTesterBase :: this->m_from_typedReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedReturnOut[port].setObjName(portName); + this->m_from_typedReturnOut[port].setObjName(portName.toChar()); #endif } @@ -316,21 +244,13 @@ void QueuedParamsTesterBase :: this->m_to_cmdIn[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_cmdIn[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_cmdIn[port].setObjName(portName); + this->m_to_cmdIn[port].setObjName(portName.toChar()); #endif } @@ -343,21 +263,13 @@ void QueuedParamsTesterBase :: this->m_to_noArgsAsync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsAsync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsAsync[port].setObjName(portName); + this->m_to_noArgsAsync[port].setObjName(portName.toChar()); #endif } @@ -370,21 +282,13 @@ void QueuedParamsTesterBase :: this->m_to_noArgsGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsGuarded[port].setObjName(portName); + this->m_to_noArgsGuarded[port].setObjName(portName.toChar()); #endif } @@ -397,21 +301,13 @@ void QueuedParamsTesterBase :: this->m_to_noArgsReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnGuarded[port].setObjName(portName); + this->m_to_noArgsReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -424,21 +320,13 @@ void QueuedParamsTesterBase :: this->m_to_noArgsReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnSync[port].setObjName(portName); + this->m_to_noArgsReturnSync[port].setObjName(portName.toChar()); #endif } @@ -451,21 +339,13 @@ void QueuedParamsTesterBase :: this->m_to_noArgsSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsSync[port].setObjName(portName); + this->m_to_noArgsSync[port].setObjName(portName.toChar()); #endif } @@ -478,21 +358,13 @@ void QueuedParamsTesterBase :: this->m_to_typedAsync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsync[port].setObjName(portName); + this->m_to_typedAsync[port].setObjName(portName.toChar()); #endif } @@ -505,21 +377,13 @@ void QueuedParamsTesterBase :: this->m_to_typedAsyncAssert[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncAssert[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncAssert[port].setObjName(portName); + this->m_to_typedAsyncAssert[port].setObjName(portName.toChar()); #endif } @@ -532,21 +396,13 @@ void QueuedParamsTesterBase :: this->m_to_typedAsyncBlockPriority[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncBlockPriority[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncBlockPriority[port].setObjName(portName); + this->m_to_typedAsyncBlockPriority[port].setObjName(portName.toChar()); #endif } @@ -559,21 +415,13 @@ void QueuedParamsTesterBase :: this->m_to_typedAsyncDropPriority[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncDropPriority[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncDropPriority[port].setObjName(portName); + this->m_to_typedAsyncDropPriority[port].setObjName(portName.toChar()); #endif } @@ -586,21 +434,13 @@ void QueuedParamsTesterBase :: this->m_to_typedGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedGuarded[port].setObjName(portName); + this->m_to_typedGuarded[port].setObjName(portName.toChar()); #endif } @@ -613,21 +453,13 @@ void QueuedParamsTesterBase :: this->m_to_typedReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnGuarded[port].setObjName(portName); + this->m_to_typedReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -640,21 +472,13 @@ void QueuedParamsTesterBase :: this->m_to_typedReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnSync[port].setObjName(portName); + this->m_to_typedReturnSync[port].setObjName(portName.toChar()); #endif } @@ -667,21 +491,13 @@ void QueuedParamsTesterBase :: this->m_to_typedSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedSync[port].setObjName(portName); + this->m_to_typedSync[port].setObjName(portName.toChar()); #endif } } diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedSerialTesterBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedSerialTesterBase.ref.cpp index f06134e2e..0fb478c99 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedSerialTesterBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedSerialTesterBase.ref.cpp @@ -33,21 +33,13 @@ void QueuedSerialTesterBase :: this->m_from_cmdRegOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_cmdRegOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_cmdRegOut[port].setObjName(portName); + this->m_from_cmdRegOut[port].setObjName(portName.toChar()); #endif } @@ -65,21 +57,13 @@ void QueuedSerialTesterBase :: this->m_from_cmdResponseOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_cmdResponseOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_cmdResponseOut[port].setObjName(portName); + this->m_from_cmdResponseOut[port].setObjName(portName.toChar()); #endif } @@ -97,21 +81,13 @@ void QueuedSerialTesterBase :: this->m_from_eventOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_eventOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_eventOut[port].setObjName(portName); + this->m_from_eventOut[port].setObjName(portName.toChar()); #endif } @@ -129,21 +105,13 @@ void QueuedSerialTesterBase :: this->m_from_prmGetOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_prmGetOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_prmGetOut[port].setObjName(portName); + this->m_from_prmGetOut[port].setObjName(portName.toChar()); #endif } @@ -161,21 +129,13 @@ void QueuedSerialTesterBase :: this->m_from_prmSetOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_prmSetOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_prmSetOut[port].setObjName(portName); + this->m_from_prmSetOut[port].setObjName(portName.toChar()); #endif } @@ -194,21 +154,13 @@ void QueuedSerialTesterBase :: this->m_from_textEventOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_textEventOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_textEventOut[port].setObjName(portName); + this->m_from_textEventOut[port].setObjName(portName.toChar()); #endif } #endif @@ -227,21 +179,13 @@ void QueuedSerialTesterBase :: this->m_from_timeGetOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_timeGetOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_timeGetOut[port].setObjName(portName); + this->m_from_timeGetOut[port].setObjName(portName.toChar()); #endif } @@ -259,21 +203,13 @@ void QueuedSerialTesterBase :: this->m_from_tlmOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_tlmOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_tlmOut[port].setObjName(portName); + this->m_from_tlmOut[port].setObjName(portName.toChar()); #endif } @@ -291,21 +227,13 @@ void QueuedSerialTesterBase :: this->m_from_noArgsOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsOut[port].setObjName(portName); + this->m_from_noArgsOut[port].setObjName(portName.toChar()); #endif } @@ -323,21 +251,13 @@ void QueuedSerialTesterBase :: this->m_from_noArgsReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsReturnOut[port].setObjName(portName); + this->m_from_noArgsReturnOut[port].setObjName(portName.toChar()); #endif } @@ -355,21 +275,13 @@ void QueuedSerialTesterBase :: this->m_from_typedOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedOut[port].setObjName(portName); + this->m_from_typedOut[port].setObjName(portName.toChar()); #endif } @@ -387,21 +299,13 @@ void QueuedSerialTesterBase :: this->m_from_typedReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedReturnOut[port].setObjName(portName); + this->m_from_typedReturnOut[port].setObjName(portName.toChar()); #endif } @@ -419,21 +323,13 @@ void QueuedSerialTesterBase :: this->m_from_serialOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_serialOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_serialOut[port].setObjName(portName); + this->m_from_serialOut[port].setObjName(portName.toChar()); #endif } @@ -446,21 +342,13 @@ void QueuedSerialTesterBase :: this->m_to_cmdIn[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_cmdIn[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_cmdIn[port].setObjName(portName); + this->m_to_cmdIn[port].setObjName(portName.toChar()); #endif } @@ -473,21 +361,13 @@ void QueuedSerialTesterBase :: this->m_to_noArgsAsync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsAsync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsAsync[port].setObjName(portName); + this->m_to_noArgsAsync[port].setObjName(portName.toChar()); #endif } @@ -500,21 +380,13 @@ void QueuedSerialTesterBase :: this->m_to_noArgsGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsGuarded[port].setObjName(portName); + this->m_to_noArgsGuarded[port].setObjName(portName.toChar()); #endif } @@ -527,21 +399,13 @@ void QueuedSerialTesterBase :: this->m_to_noArgsReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnGuarded[port].setObjName(portName); + this->m_to_noArgsReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -554,21 +418,13 @@ void QueuedSerialTesterBase :: this->m_to_noArgsReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnSync[port].setObjName(portName); + this->m_to_noArgsReturnSync[port].setObjName(portName.toChar()); #endif } @@ -581,21 +437,13 @@ void QueuedSerialTesterBase :: this->m_to_noArgsSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsSync[port].setObjName(portName); + this->m_to_noArgsSync[port].setObjName(portName.toChar()); #endif } @@ -608,21 +456,13 @@ void QueuedSerialTesterBase :: this->m_to_typedAsync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsync[port].setObjName(portName); + this->m_to_typedAsync[port].setObjName(portName.toChar()); #endif } @@ -635,21 +475,13 @@ void QueuedSerialTesterBase :: this->m_to_typedAsyncAssert[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncAssert[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncAssert[port].setObjName(portName); + this->m_to_typedAsyncAssert[port].setObjName(portName.toChar()); #endif } @@ -662,21 +494,13 @@ void QueuedSerialTesterBase :: this->m_to_typedAsyncBlockPriority[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncBlockPriority[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncBlockPriority[port].setObjName(portName); + this->m_to_typedAsyncBlockPriority[port].setObjName(portName.toChar()); #endif } @@ -689,21 +513,13 @@ void QueuedSerialTesterBase :: this->m_to_typedAsyncDropPriority[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncDropPriority[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncDropPriority[port].setObjName(portName); + this->m_to_typedAsyncDropPriority[port].setObjName(portName.toChar()); #endif } @@ -716,21 +532,13 @@ void QueuedSerialTesterBase :: this->m_to_typedGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedGuarded[port].setObjName(portName); + this->m_to_typedGuarded[port].setObjName(portName.toChar()); #endif } @@ -743,21 +551,13 @@ void QueuedSerialTesterBase :: this->m_to_typedReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnGuarded[port].setObjName(portName); + this->m_to_typedReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -770,21 +570,13 @@ void QueuedSerialTesterBase :: this->m_to_typedReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnSync[port].setObjName(portName); + this->m_to_typedReturnSync[port].setObjName(portName.toChar()); #endif } @@ -797,21 +589,13 @@ void QueuedSerialTesterBase :: this->m_to_typedSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedSync[port].setObjName(portName); + this->m_to_typedSync[port].setObjName(portName.toChar()); #endif } @@ -824,21 +608,13 @@ void QueuedSerialTesterBase :: this->m_to_serialAsync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_serialAsync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_serialAsync[port].setObjName(portName); + this->m_to_serialAsync[port].setObjName(portName.toChar()); #endif } @@ -851,21 +627,13 @@ void QueuedSerialTesterBase :: this->m_to_serialAsyncAssert[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_serialAsyncAssert[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_serialAsyncAssert[port].setObjName(portName); + this->m_to_serialAsyncAssert[port].setObjName(portName.toChar()); #endif } @@ -878,21 +646,13 @@ void QueuedSerialTesterBase :: this->m_to_serialAsyncBlockPriority[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_serialAsyncBlockPriority[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_serialAsyncBlockPriority[port].setObjName(portName); + this->m_to_serialAsyncBlockPriority[port].setObjName(portName.toChar()); #endif } @@ -905,21 +665,13 @@ void QueuedSerialTesterBase :: this->m_to_serialAsyncDropPriority[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_serialAsyncDropPriority[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_serialAsyncDropPriority[port].setObjName(portName); + this->m_to_serialAsyncDropPriority[port].setObjName(portName.toChar()); #endif } @@ -932,21 +684,13 @@ void QueuedSerialTesterBase :: this->m_to_serialGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_serialGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_serialGuarded[port].setObjName(portName); + this->m_to_serialGuarded[port].setObjName(portName.toChar()); #endif } @@ -959,21 +703,13 @@ void QueuedSerialTesterBase :: this->m_to_serialSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_serialSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_serialSync[port].setObjName(portName); + this->m_to_serialSync[port].setObjName(portName.toChar()); #endif } } diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedSyncProductsTesterBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedSyncProductsTesterBase.ref.cpp index d6bad13b7..c10ce7f65 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedSyncProductsTesterBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedSyncProductsTesterBase.ref.cpp @@ -33,21 +33,13 @@ void QueuedSyncProductsTesterBase :: this->m_from_productRequestOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_productRequestOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_productRequestOut[port].setObjName(portName); + this->m_from_productRequestOut[port].setObjName(portName.toChar()); #endif } @@ -65,21 +57,13 @@ void QueuedSyncProductsTesterBase :: this->m_from_productSendOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_productSendOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_productSendOut[port].setObjName(portName); + this->m_from_productSendOut[port].setObjName(portName.toChar()); #endif } @@ -97,21 +81,13 @@ void QueuedSyncProductsTesterBase :: this->m_from_timeGetOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_timeGetOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_timeGetOut[port].setObjName(portName); + this->m_from_timeGetOut[port].setObjName(portName.toChar()); #endif } @@ -129,21 +105,13 @@ void QueuedSyncProductsTesterBase :: this->m_from_noArgsOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsOut[port].setObjName(portName); + this->m_from_noArgsOut[port].setObjName(portName.toChar()); #endif } @@ -161,21 +129,13 @@ void QueuedSyncProductsTesterBase :: this->m_from_noArgsReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsReturnOut[port].setObjName(portName); + this->m_from_noArgsReturnOut[port].setObjName(portName.toChar()); #endif } @@ -193,21 +153,13 @@ void QueuedSyncProductsTesterBase :: this->m_from_typedOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedOut[port].setObjName(portName); + this->m_from_typedOut[port].setObjName(portName.toChar()); #endif } @@ -225,21 +177,13 @@ void QueuedSyncProductsTesterBase :: this->m_from_typedReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedReturnOut[port].setObjName(portName); + this->m_from_typedReturnOut[port].setObjName(portName.toChar()); #endif } @@ -252,21 +196,13 @@ void QueuedSyncProductsTesterBase :: this->m_to_productRecvIn[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_productRecvIn[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_productRecvIn[port].setObjName(portName); + this->m_to_productRecvIn[port].setObjName(portName.toChar()); #endif } @@ -279,21 +215,13 @@ void QueuedSyncProductsTesterBase :: this->m_to_noArgsAsync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsAsync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsAsync[port].setObjName(portName); + this->m_to_noArgsAsync[port].setObjName(portName.toChar()); #endif } @@ -306,21 +234,13 @@ void QueuedSyncProductsTesterBase :: this->m_to_noArgsGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsGuarded[port].setObjName(portName); + this->m_to_noArgsGuarded[port].setObjName(portName.toChar()); #endif } @@ -333,21 +253,13 @@ void QueuedSyncProductsTesterBase :: this->m_to_noArgsReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnGuarded[port].setObjName(portName); + this->m_to_noArgsReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -360,21 +272,13 @@ void QueuedSyncProductsTesterBase :: this->m_to_noArgsReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnSync[port].setObjName(portName); + this->m_to_noArgsReturnSync[port].setObjName(portName.toChar()); #endif } @@ -387,21 +291,13 @@ void QueuedSyncProductsTesterBase :: this->m_to_noArgsSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsSync[port].setObjName(portName); + this->m_to_noArgsSync[port].setObjName(portName.toChar()); #endif } @@ -414,21 +310,13 @@ void QueuedSyncProductsTesterBase :: this->m_to_typedAsync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsync[port].setObjName(portName); + this->m_to_typedAsync[port].setObjName(portName.toChar()); #endif } @@ -441,21 +329,13 @@ void QueuedSyncProductsTesterBase :: this->m_to_typedAsyncAssert[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncAssert[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncAssert[port].setObjName(portName); + this->m_to_typedAsyncAssert[port].setObjName(portName.toChar()); #endif } @@ -468,21 +348,13 @@ void QueuedSyncProductsTesterBase :: this->m_to_typedAsyncBlockPriority[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncBlockPriority[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncBlockPriority[port].setObjName(portName); + this->m_to_typedAsyncBlockPriority[port].setObjName(portName.toChar()); #endif } @@ -495,21 +367,13 @@ void QueuedSyncProductsTesterBase :: this->m_to_typedAsyncDropPriority[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncDropPriority[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncDropPriority[port].setObjName(portName); + this->m_to_typedAsyncDropPriority[port].setObjName(portName.toChar()); #endif } @@ -522,21 +386,13 @@ void QueuedSyncProductsTesterBase :: this->m_to_typedGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedGuarded[port].setObjName(portName); + this->m_to_typedGuarded[port].setObjName(portName.toChar()); #endif } @@ -549,21 +405,13 @@ void QueuedSyncProductsTesterBase :: this->m_to_typedReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnGuarded[port].setObjName(portName); + this->m_to_typedReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -576,21 +424,13 @@ void QueuedSyncProductsTesterBase :: this->m_to_typedReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnSync[port].setObjName(portName); + this->m_to_typedReturnSync[port].setObjName(portName.toChar()); #endif } @@ -603,21 +443,13 @@ void QueuedSyncProductsTesterBase :: this->m_to_typedSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedSync[port].setObjName(portName); + this->m_to_typedSync[port].setObjName(portName.toChar()); #endif } } diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedTelemetryTesterBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedTelemetryTesterBase.ref.cpp index 90a55183e..04ee1e982 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedTelemetryTesterBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedTelemetryTesterBase.ref.cpp @@ -33,21 +33,13 @@ void QueuedTelemetryTesterBase :: this->m_from_timeGetOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_timeGetOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_timeGetOut[port].setObjName(portName); + this->m_from_timeGetOut[port].setObjName(portName.toChar()); #endif } @@ -65,21 +57,13 @@ void QueuedTelemetryTesterBase :: this->m_from_tlmOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_tlmOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_tlmOut[port].setObjName(portName); + this->m_from_tlmOut[port].setObjName(portName.toChar()); #endif } @@ -97,21 +81,13 @@ void QueuedTelemetryTesterBase :: this->m_from_noArgsOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsOut[port].setObjName(portName); + this->m_from_noArgsOut[port].setObjName(portName.toChar()); #endif } @@ -129,21 +105,13 @@ void QueuedTelemetryTesterBase :: this->m_from_noArgsReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsReturnOut[port].setObjName(portName); + this->m_from_noArgsReturnOut[port].setObjName(portName.toChar()); #endif } @@ -161,21 +129,13 @@ void QueuedTelemetryTesterBase :: this->m_from_typedOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedOut[port].setObjName(portName); + this->m_from_typedOut[port].setObjName(portName.toChar()); #endif } @@ -193,21 +153,13 @@ void QueuedTelemetryTesterBase :: this->m_from_typedReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedReturnOut[port].setObjName(portName); + this->m_from_typedReturnOut[port].setObjName(portName.toChar()); #endif } @@ -220,21 +172,13 @@ void QueuedTelemetryTesterBase :: this->m_to_noArgsAsync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsAsync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsAsync[port].setObjName(portName); + this->m_to_noArgsAsync[port].setObjName(portName.toChar()); #endif } @@ -247,21 +191,13 @@ void QueuedTelemetryTesterBase :: this->m_to_noArgsGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsGuarded[port].setObjName(portName); + this->m_to_noArgsGuarded[port].setObjName(portName.toChar()); #endif } @@ -274,21 +210,13 @@ void QueuedTelemetryTesterBase :: this->m_to_noArgsReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnGuarded[port].setObjName(portName); + this->m_to_noArgsReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -301,21 +229,13 @@ void QueuedTelemetryTesterBase :: this->m_to_noArgsReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnSync[port].setObjName(portName); + this->m_to_noArgsReturnSync[port].setObjName(portName.toChar()); #endif } @@ -328,21 +248,13 @@ void QueuedTelemetryTesterBase :: this->m_to_noArgsSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsSync[port].setObjName(portName); + this->m_to_noArgsSync[port].setObjName(portName.toChar()); #endif } @@ -355,21 +267,13 @@ void QueuedTelemetryTesterBase :: this->m_to_typedAsync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsync[port].setObjName(portName); + this->m_to_typedAsync[port].setObjName(portName.toChar()); #endif } @@ -382,21 +286,13 @@ void QueuedTelemetryTesterBase :: this->m_to_typedAsyncAssert[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncAssert[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncAssert[port].setObjName(portName); + this->m_to_typedAsyncAssert[port].setObjName(portName.toChar()); #endif } @@ -409,21 +305,13 @@ void QueuedTelemetryTesterBase :: this->m_to_typedAsyncBlockPriority[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncBlockPriority[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncBlockPriority[port].setObjName(portName); + this->m_to_typedAsyncBlockPriority[port].setObjName(portName.toChar()); #endif } @@ -436,21 +324,13 @@ void QueuedTelemetryTesterBase :: this->m_to_typedAsyncDropPriority[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncDropPriority[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncDropPriority[port].setObjName(portName); + this->m_to_typedAsyncDropPriority[port].setObjName(portName.toChar()); #endif } @@ -463,21 +343,13 @@ void QueuedTelemetryTesterBase :: this->m_to_typedGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedGuarded[port].setObjName(portName); + this->m_to_typedGuarded[port].setObjName(portName.toChar()); #endif } @@ -490,21 +362,13 @@ void QueuedTelemetryTesterBase :: this->m_to_typedReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnGuarded[port].setObjName(portName); + this->m_to_typedReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -517,21 +381,13 @@ void QueuedTelemetryTesterBase :: this->m_to_typedReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnSync[port].setObjName(portName); + this->m_to_typedReturnSync[port].setObjName(portName.toChar()); #endif } @@ -544,21 +400,13 @@ void QueuedTelemetryTesterBase :: this->m_to_typedSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedSync[port].setObjName(portName); + this->m_to_typedSync[port].setObjName(portName.toChar()); #endif } } diff --git a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedTestTesterBase.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedTestTesterBase.ref.cpp index 2b78fdf5b..735734a52 100644 --- a/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedTestTesterBase.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/test-base/QueuedTestTesterBase.ref.cpp @@ -33,21 +33,13 @@ void QueuedTestTesterBase :: this->m_from_cmdRegOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_cmdRegOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_cmdRegOut[port].setObjName(portName); + this->m_from_cmdRegOut[port].setObjName(portName.toChar()); #endif } @@ -65,21 +57,13 @@ void QueuedTestTesterBase :: this->m_from_cmdResponseOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_cmdResponseOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_cmdResponseOut[port].setObjName(portName); + this->m_from_cmdResponseOut[port].setObjName(portName.toChar()); #endif } @@ -97,21 +81,13 @@ void QueuedTestTesterBase :: this->m_from_eventOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_eventOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_eventOut[port].setObjName(portName); + this->m_from_eventOut[port].setObjName(portName.toChar()); #endif } @@ -129,21 +105,13 @@ void QueuedTestTesterBase :: this->m_from_prmGetOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_prmGetOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_prmGetOut[port].setObjName(portName); + this->m_from_prmGetOut[port].setObjName(portName.toChar()); #endif } @@ -161,21 +129,13 @@ void QueuedTestTesterBase :: this->m_from_prmSetOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_prmSetOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_prmSetOut[port].setObjName(portName); + this->m_from_prmSetOut[port].setObjName(portName.toChar()); #endif } @@ -193,21 +153,13 @@ void QueuedTestTesterBase :: this->m_from_productRequestOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_productRequestOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_productRequestOut[port].setObjName(portName); + this->m_from_productRequestOut[port].setObjName(portName.toChar()); #endif } @@ -225,21 +177,13 @@ void QueuedTestTesterBase :: this->m_from_productSendOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_productSendOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_productSendOut[port].setObjName(portName); + this->m_from_productSendOut[port].setObjName(portName.toChar()); #endif } @@ -258,21 +202,13 @@ void QueuedTestTesterBase :: this->m_from_textEventOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_textEventOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_textEventOut[port].setObjName(portName); + this->m_from_textEventOut[port].setObjName(portName.toChar()); #endif } #endif @@ -291,21 +227,13 @@ void QueuedTestTesterBase :: this->m_from_timeGetOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_timeGetOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_timeGetOut[port].setObjName(portName); + this->m_from_timeGetOut[port].setObjName(portName.toChar()); #endif } @@ -323,21 +251,13 @@ void QueuedTestTesterBase :: this->m_from_tlmOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_tlmOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_tlmOut[port].setObjName(portName); + this->m_from_tlmOut[port].setObjName(portName.toChar()); #endif } @@ -355,21 +275,13 @@ void QueuedTestTesterBase :: this->m_from_noArgsOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsOut[port].setObjName(portName); + this->m_from_noArgsOut[port].setObjName(portName.toChar()); #endif } @@ -387,21 +299,13 @@ void QueuedTestTesterBase :: this->m_from_noArgsReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_noArgsReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_noArgsReturnOut[port].setObjName(portName); + this->m_from_noArgsReturnOut[port].setObjName(portName.toChar()); #endif } @@ -419,21 +323,13 @@ void QueuedTestTesterBase :: this->m_from_typedOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedOut[port].setObjName(portName); + this->m_from_typedOut[port].setObjName(portName.toChar()); #endif } @@ -451,21 +347,13 @@ void QueuedTestTesterBase :: this->m_from_typedReturnOut[port].setPortNum(port); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_from_typedReturnOut[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_from_typedReturnOut[port].setObjName(portName); + this->m_from_typedReturnOut[port].setObjName(portName.toChar()); #endif } @@ -478,21 +366,13 @@ void QueuedTestTesterBase :: this->m_to_cmdIn[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_cmdIn[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_cmdIn[port].setObjName(portName); + this->m_to_cmdIn[port].setObjName(portName.toChar()); #endif } @@ -505,21 +385,13 @@ void QueuedTestTesterBase :: this->m_to_productRecvIn[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_productRecvIn[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_productRecvIn[port].setObjName(portName); + this->m_to_productRecvIn[port].setObjName(portName.toChar()); #endif } @@ -532,21 +404,13 @@ void QueuedTestTesterBase :: this->m_to_noArgsAsync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsAsync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsAsync[port].setObjName(portName); + this->m_to_noArgsAsync[port].setObjName(portName.toChar()); #endif } @@ -559,21 +423,13 @@ void QueuedTestTesterBase :: this->m_to_noArgsGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsGuarded[port].setObjName(portName); + this->m_to_noArgsGuarded[port].setObjName(portName.toChar()); #endif } @@ -586,21 +442,13 @@ void QueuedTestTesterBase :: this->m_to_noArgsReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnGuarded[port].setObjName(portName); + this->m_to_noArgsReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -613,21 +461,13 @@ void QueuedTestTesterBase :: this->m_to_noArgsReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsReturnSync[port].setObjName(portName); + this->m_to_noArgsReturnSync[port].setObjName(portName.toChar()); #endif } @@ -640,21 +480,13 @@ void QueuedTestTesterBase :: this->m_to_noArgsSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_noArgsSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_noArgsSync[port].setObjName(portName); + this->m_to_noArgsSync[port].setObjName(portName.toChar()); #endif } @@ -667,21 +499,13 @@ void QueuedTestTesterBase :: this->m_to_typedAsync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsync[port].setObjName(portName); + this->m_to_typedAsync[port].setObjName(portName.toChar()); #endif } @@ -694,21 +518,13 @@ void QueuedTestTesterBase :: this->m_to_typedAsyncAssert[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncAssert[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncAssert[port].setObjName(portName); + this->m_to_typedAsyncAssert[port].setObjName(portName.toChar()); #endif } @@ -721,21 +537,13 @@ void QueuedTestTesterBase :: this->m_to_typedAsyncBlockPriority[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncBlockPriority[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncBlockPriority[port].setObjName(portName); + this->m_to_typedAsyncBlockPriority[port].setObjName(portName.toChar()); #endif } @@ -748,21 +556,13 @@ void QueuedTestTesterBase :: this->m_to_typedAsyncDropPriority[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedAsyncDropPriority[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedAsyncDropPriority[port].setObjName(portName); + this->m_to_typedAsyncDropPriority[port].setObjName(portName.toChar()); #endif } @@ -775,21 +575,13 @@ void QueuedTestTesterBase :: this->m_to_typedGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedGuarded[port].setObjName(portName); + this->m_to_typedGuarded[port].setObjName(portName.toChar()); #endif } @@ -802,21 +594,13 @@ void QueuedTestTesterBase :: this->m_to_typedReturnGuarded[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnGuarded[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnGuarded[port].setObjName(portName); + this->m_to_typedReturnGuarded[port].setObjName(portName.toChar()); #endif } @@ -829,21 +613,13 @@ void QueuedTestTesterBase :: this->m_to_typedReturnSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedReturnSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedReturnSync[port].setObjName(portName); + this->m_to_typedReturnSync[port].setObjName(portName.toChar()); #endif } @@ -856,21 +632,13 @@ void QueuedTestTesterBase :: this->m_to_typedSync[port].init(); #if FW_OBJECT_NAMES == 1 - // The port name consists of this->m_objName and some extra info. - // We expect all of this to fit in FW_OBJ_NAME_MAX_SIZE bytes. - // However, the compiler may assume that this->m_objName fills - // the entire array, whose size is FW_OBJ_NAME_MAX_SIZE. So to - // avoid a compiler warning, we provide an extra FW_OBJ_NAME_MAX_SIZE - // bytes to cover the extra info. - char portName[2*FW_OBJ_NAME_MAX_SIZE]; - (void) snprintf( - portName, - sizeof(portName), + Fw::ObjectName portName; + portName.format( "%s_to_typedSync[%" PRI_PlatformIntType "]", - this->m_objName, + this->m_objName.toChar(), port ); - this->m_to_typedSync[port].setObjName(portName); + this->m_to_typedSync[port].setObjName(portName.toChar()); #endif } }