Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove NATIVE_INT_TYPE, NATIVE_UINT_TYPE, and POINTER_CAST from Svc #3374

Open
wants to merge 34 commits into
base: devel
Choose a base branch
from

Conversation

LeStarch
Copy link
Collaborator

@LeStarch LeStarch commented Mar 13, 2025

Related Issue(s)
Has Unit Tests (y/n)
Documentation Included (y/n)

Change Description

This removes old NATIVE_INT_TYPE, NATIVE_UINT_TYPE, and POINTER_CAST types from the Svc directory.

Decisions: @LeStarch

  • RG context is now a U32 to match other system context variables
  • TlmPacketizer packet sizes are limited to FwSignedSizeType as -1 is used as a flag value

Decisions: @timcanham

  • RG context is now a U32 to match other system context variables
  • TlmPacketizer packet sizes are limited to FwSignedSizeType as -1 is used as a flag value

Decisions: @bocchino

  • RG context is now a U32 to match other system context variables
  • TlmPacketizer packet sizes are limited to FwSignedSizeType as -1 is used as a flag value

Decisions: @thomas-bc

  • RG context is now a U32 to match other system context variables
  • TlmPacketizer packet sizes are limited to FwSignedSizeType as -1 is used as a flag value

@LeStarch LeStarch requested review from bocchino and thomas-bc March 13, 2025 17:46
Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@@ -30,7 +30,7 @@
m_cycleSlips(0) {
}

void ActiveRateGroup::configure( NATIVE_INT_TYPE contexts[], NATIVE_INT_TYPE numContexts) {
void ActiveRateGroup::configure(U32 contexts[], FwIndexType numContexts) {

Check notice

Code scanning / CodeQL

Long function without assertion Note

All functions of more than 10 lines should have at least one assertion.
HealthComponentBase::init(queueDepth, instance);
this->queue_depth = queueDepth;

}

void HealthImpl::setPingEntries(PingEntry* pingEntries, NATIVE_INT_TYPE numPingEntries, U32 watchDogCode) {
void HealthImpl::setPingEntries(PingEntry* pingEntries, FwIndexType numPingEntries, U32 watchDogCode) {

Check notice

Code scanning / CodeQL

Long function without assertion Note

All functions of more than 10 lines should have at least one assertion.
@@ -203,12 +204,12 @@
this->cmdResponse_out(opCode,cmdSeq,Fw::CmdResponse::OK);
}

NATIVE_INT_TYPE HealthImpl::findEntry(const Fw::CmdStringArg& entry) {

FwIndexType HealthImpl::findEntry(const Fw::CmdStringArg& entry) {

Check notice

Code scanning / CodeQL

Long function without assertion Note

All functions of more than 10 lines should have at least one assertion.
@@ -20,17 +20,17 @@

namespace Svc {

void LinuxTimerComponentImpl::startTimer(NATIVE_INT_TYPE interval) {
void LinuxTimerComponentImpl::startTimer(FwSizeType interval) {

Check notice

Code scanning / CodeQL

Long function without assertion Note

All functions of more than 10 lines should have at least one assertion.
@@ -23,7 +23,7 @@

PassiveRateGroup::~PassiveRateGroup() {}

void PassiveRateGroup::configure(NATIVE_INT_TYPE contexts[], NATIVE_INT_TYPE numContexts) {
void PassiveRateGroup::configure(U32 contexts[], FwIndexType numContexts) {

Check notice

Code scanning / CodeQL

Long function without assertion Note

All functions of more than 10 lines should have at least one assertion.
@@ -161,7 +162,7 @@

void HealthImpl::HLTH_PING_ENABLE_cmdHandler(const FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg& entry, Fw::Enabled enable) {
// check to see if entry is in range
NATIVE_INT_TYPE entryIndex = this->findEntry(entry);
FwIndexType entryIndex = this->findEntry(entry);

Check warning

Code scanning / CodeQL

Unchecked function argument Warning

This use of parameter entry has not been checked.
@@ -181,7 +182,7 @@

void HealthImpl::HLTH_CHNG_PING_cmdHandler(const FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdStringArg& entry, U32 warningValue, U32 fatalValue) {
// check to see if entry is in range
NATIVE_INT_TYPE entryIndex = this->findEntry(entry);
FwIndexType entryIndex = this->findEntry(entry);

Check warning

Code scanning / CodeQL

Unchecked function argument Warning

This use of parameter entry has not been checked.
itval.it_interval.tv_nsec = (interval*1000000)%1000000000;
itval.it_value.tv_sec = interval/1000;
itval.it_value.tv_nsec = (interval*1000000)%1000000000;
const FwSizeType interval_secs = interval/1000;

Check warning

Code scanning / CodeQL

Unchecked function argument Warning

This use of parameter interval has not been checked.
@@ -54,11 +59,11 @@
void TlmChan::TlmGet_handler(FwIndexType portNum, FwChanIdType id, Fw::Time& timeTag, Fw::TlmBuffer& val) {
// Compute index for entry

NATIVE_UINT_TYPE index = this->doHash(id);
FwChanIdType index = this->doHash(id);

Check warning

Code scanning / CodeQL

Unchecked function argument Warning

This use of parameter id has not been checked.
@@ -81,14 +86,14 @@
void TlmChan::TlmRecv_handler(FwIndexType portNum, FwChanIdType id, Fw::Time& timeTag, Fw::TlmBuffer& val) {
// Compute index for entry

NATIVE_UINT_TYPE index = this->doHash(id);
FwChanIdType index = this->doHash(id);

Check warning

Code scanning / CodeQL

Unchecked function argument Warning

This use of parameter id has not been checked.

packetLen += packetList.list[pktEntry]->list[tlmEntry].size;

} // end channel in packet
FW_ASSERT(packetLen <= FW_COM_BUFFER_MAX_SIZE, static_cast<FwAssertArgType>(packetLen), static_cast<FwAssertArgType>(pktEntry));
// clear contents
memset(this->m_fillBuffers[pktEntry].buffer.getBuffAddr(), 0, packetLen);
memset(this->m_fillBuffers[pktEntry].buffer.getBuffAddr(), 0, static_cast<size_t>(packetLen));

Check warning

Code scanning / CodeQL

Unchecked return value Warning

The return value of non-void function
memset
is not checked.
@@ -127,15 +130,15 @@
}

TlmPacketizer::TlmEntry* TlmPacketizer::findBucket(FwChanIdType id) {
NATIVE_UINT_TYPE index = this->doHash(id);
FwChanIdType index = this->doHash(id);

Check warning

Code scanning / CodeQL

Unchecked function argument Warning

This use of parameter id has not been checked.
@@ -186,7 +189,7 @@
Fw::TlmBuffer& val) {
FW_ASSERT(this->m_configured);
// get hash value for id
NATIVE_UINT_TYPE index = this->doHash(id);
FwChanIdType index = this->doHash(id);

Check warning

Code scanning / CodeQL

Unchecked function argument Warning

This use of parameter id has not been checked.
@@ -30,7 +30,7 @@
m_cycleSlips(0) {
}

void ActiveRateGroup::configure( NATIVE_INT_TYPE contexts[], NATIVE_INT_TYPE numContexts) {
void ActiveRateGroup::configure(U32 contexts[], FwIndexType numContexts) {

Check notice

Code scanning / CodeQL

No raw arrays in interfaces Note

Raw arrays should not be used in interfaces. A container class should be used instead.
@@ -23,7 +23,7 @@

PassiveRateGroup::~PassiveRateGroup() {}

void PassiveRateGroup::configure(NATIVE_INT_TYPE contexts[], NATIVE_INT_TYPE numContexts) {
void PassiveRateGroup::configure(U32 contexts[], FwIndexType numContexts) {

Check notice

Code scanning / CodeQL

No raw arrays in interfaces Note

Raw arrays should not be used in interfaces. A container class should be used instead.
Copy link
Collaborator

@thomas-bc thomas-bc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It all looks good to me, just checking on one TODO

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants