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

Removed a_ prefix on arguments #2513

Merged
merged 3 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Fw/FilePacket/CancelPacket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
void FilePacket::CancelPacket ::
initialize(const U32 sequenceIndex)
{
this->header.initialize(FilePacket::T_CANCEL, sequenceIndex);
this->m_header.initialize(FilePacket::T_CANCEL, sequenceIndex);

Check warning

Code scanning / CodeQL

Unchecked function argument Warning

This use of parameter sequenceIndex has not been checked.
}

U32 FilePacket::CancelPacket ::
bufferSize() const
{
return this->header.bufferSize();
return this->m_header.bufferSize();
}

SerializeStatus FilePacket::CancelPacket ::
Expand All @@ -34,14 +34,14 @@
buffer.getData(),
buffer.getSize()
);
return this->header.toSerialBuffer(serialBuffer);
return this->m_header.toSerialBuffer(serialBuffer);
}

SerializeStatus FilePacket::CancelPacket ::
fromSerialBuffer(SerialBuffer& serialBuffer)
{

FW_ASSERT(this->header.type == T_CANCEL);
FW_ASSERT(this->m_header.m_type == T_CANCEL);

if (serialBuffer.getBuffLeft() != 0)
return FW_DESERIALIZE_SIZE_MISMATCH;
Expand Down
48 changes: 24 additions & 24 deletions Fw/FilePacket/DataPacket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,25 @@
void FilePacket::DataPacket ::
initialize(
const U32 sequenceIndex,
const U32 a_byteOffset,
const U16 a_dataSize,
const U8 *const a_data
const U32 byteOffset,
const U16 dataSize,
const U8 *const data
)
{
this->header.initialize(FilePacket::T_DATA, sequenceIndex);
this->byteOffset = a_byteOffset;
this->dataSize = a_dataSize;
this->data = a_data;
this->m_header.initialize(FilePacket::T_DATA, sequenceIndex);

Check warning

Code scanning / CodeQL

Unchecked function argument Warning

This use of parameter sequenceIndex has not been checked.
this->m_byteOffset = byteOffset;

Check warning

Code scanning / CodeQL

Unchecked function argument Warning

This use of parameter byteOffset has not been checked.
this->m_dataSize = dataSize;

Check warning

Code scanning / CodeQL

Unchecked function argument Warning

This use of parameter dataSize has not been checked.
this->m_data = data;

Check warning

Code scanning / CodeQL

Unchecked function argument Warning

This use of parameter data has not been checked.
}

U32 FilePacket::DataPacket ::
bufferSize() const
{
return
this->header.bufferSize() +
sizeof(this->byteOffset) +
sizeof(this->dataSize) +
this->dataSize;
this->m_header.bufferSize() +
sizeof(this->m_byteOffset) +
sizeof(this->m_dataSize) +
this->m_dataSize;
}

SerializeStatus FilePacket::DataPacket ::
Expand All @@ -53,21 +53,21 @@
fromSerialBuffer(SerialBuffer& serialBuffer)
{

FW_ASSERT(this->header.type == T_DATA);
FW_ASSERT(this->m_header.m_type == T_DATA);

SerializeStatus status = serialBuffer.deserialize(this->byteOffset);
SerializeStatus status = serialBuffer.deserialize(this->m_byteOffset);

Check warning

Code scanning / CodeQL

Unchecked function argument Warning

This use of parameter serialBuffer has not been checked.
if (status != FW_SERIALIZE_OK)
return status;

status = serialBuffer.deserialize(this->dataSize);
status = serialBuffer.deserialize(this->m_dataSize);
if (status != FW_SERIALIZE_OK)
return status;

if (serialBuffer.getBuffLeft() != this->dataSize)
if (serialBuffer.getBuffLeft() != this->m_dataSize)
return FW_DESERIALIZE_SIZE_MISMATCH;

U8 *const addr = serialBuffer.getBuffAddr();
this->data = &addr[this->fixedLengthSize()];
this->m_data = &addr[this->fixedLengthSize()];

return FW_SERIALIZE_OK;

Expand All @@ -77,32 +77,32 @@
fixedLengthSize() const
{
return
this->header.bufferSize() +
sizeof(this->byteOffset) +
sizeof(this->dataSize);
this->m_header.bufferSize() +
sizeof(this->m_byteOffset) +
sizeof(this->m_dataSize);
}

SerializeStatus FilePacket::DataPacket ::
toSerialBuffer(SerialBuffer& serialBuffer) const
{

FW_ASSERT(this->header.type == T_DATA);
FW_ASSERT(this->m_header.m_type == T_DATA);

SerializeStatus status;

status = this->header.toSerialBuffer(serialBuffer);
status = this->m_header.toSerialBuffer(serialBuffer);

Check warning

Code scanning / CodeQL

Unchecked function argument Warning

This use of parameter serialBuffer has not been checked.
if (status != FW_SERIALIZE_OK)
return status;

status = serialBuffer.serialize(this->byteOffset);
status = serialBuffer.serialize(this->m_byteOffset);
if (status != FW_SERIALIZE_OK)
return status;

status = serialBuffer.serialize(this->dataSize);
status = serialBuffer.serialize(this->m_dataSize);
if (status != FW_SERIALIZE_OK)
return status;

status = serialBuffer.pushBytes(this->data, dataSize);
status = serialBuffer.pushBytes(this->m_data, this->m_dataSize);

return status;

Expand Down
10 changes: 5 additions & 5 deletions Fw/FilePacket/EndPacket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@
const CFDP::Checksum& checksum
)
{
this->header.initialize(FilePacket::T_END, sequenceIndex);
this->m_header.initialize(FilePacket::T_END, sequenceIndex);

Check warning

Code scanning / CodeQL

Unchecked function argument Warning

This use of parameter sequenceIndex has not been checked.
this->setChecksum(checksum);
}

U32 FilePacket::EndPacket ::
bufferSize() const
{
return this->header.bufferSize() + sizeof(this->m_checksumValue);
return this->m_header.bufferSize() + sizeof(this->m_checksumValue);
}

SerializeStatus FilePacket::EndPacket ::
Expand Down Expand Up @@ -61,7 +61,7 @@
fromSerialBuffer(SerialBuffer& serialBuffer)
{

FW_ASSERT(this->header.type == T_END);
FW_ASSERT(this->m_header.m_type == T_END);

const SerializeStatus status =
serialBuffer.deserialize(this->m_checksumValue);
Expand All @@ -74,11 +74,11 @@
toSerialBuffer(SerialBuffer& serialBuffer) const
{

FW_ASSERT(this->header.type == T_END);
FW_ASSERT(this->m_header.m_type == T_END);

SerializeStatus status;

status = this->header.toSerialBuffer(serialBuffer);
status = this->m_header.toSerialBuffer(serialBuffer);

Check warning

Code scanning / CodeQL

Unchecked function argument Warning

This use of parameter serialBuffer has not been checked.
if (status != FW_SERIALIZE_OK)
return status;

Expand Down
22 changes: 11 additions & 11 deletions Fw/FilePacket/FilePacket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,63 +40,63 @@ namespace Fw {
const FilePacket::StartPacket& FilePacket ::
asStartPacket() const
{
FW_ASSERT(this->m_header.type == T_START);
FW_ASSERT(this->m_header.m_type == T_START);
return this->m_startPacket;
}

const FilePacket::DataPacket& FilePacket ::
asDataPacket() const
{
FW_ASSERT(this->m_header.type == T_DATA);
FW_ASSERT(this->m_header.m_type == T_DATA);
return this->m_dataPacket;
}

const FilePacket::EndPacket& FilePacket ::
asEndPacket() const
{
FW_ASSERT(this->m_header.type == T_END);
FW_ASSERT(this->m_header.m_type == T_END);
return this->m_endPacket;
}

const FilePacket::CancelPacket& FilePacket ::
asCancelPacket() const
{
FW_ASSERT(this->m_header.type == T_CANCEL);
FW_ASSERT(this->m_header.m_type == T_CANCEL);
return this->m_cancelPacket;
}

void FilePacket ::
fromStartPacket(const StartPacket& startPacket)
{
this->m_startPacket = startPacket;
this->m_header.type = T_START;
this->m_header.m_type = T_START;
}

void FilePacket ::
fromDataPacket(const DataPacket& dataPacket)
{
this->m_dataPacket = dataPacket;
this->m_header.type = T_DATA;
this->m_header.m_type = T_DATA;
}

void FilePacket ::
fromEndPacket(const EndPacket& endPacket)
{
this->m_endPacket = endPacket;
this->m_header.type = T_END;
this->m_header.m_type = T_END;
}

void FilePacket ::
fromCancelPacket(const CancelPacket& cancelPacket)
{
this->m_cancelPacket = cancelPacket;
this->m_header.type = T_CANCEL;
this->m_header.m_type = T_CANCEL;
}

U32 FilePacket ::
bufferSize() const
{
switch (this->m_header.type) {
switch (this->m_header.m_type) {
case T_START:
return this->m_startPacket.bufferSize();
case T_DATA:
Expand All @@ -116,7 +116,7 @@ namespace Fw {
SerializeStatus FilePacket ::
toBuffer(Buffer& buffer) const
{
switch (this->m_header.type) {
switch (this->m_header.m_type) {
case T_START:
return this->m_startPacket.toBuffer(buffer);
case T_DATA:
Expand All @@ -142,7 +142,7 @@ namespace Fw {
status = this->m_header.fromSerialBuffer(serialBuffer);
if (status != FW_SERIALIZE_OK)
return status;
switch (this->m_header.type) {
switch (this->m_header.m_type) {
case T_START:
status = this->m_startPacket.fromSerialBuffer(serialBuffer);
break;
Expand Down
Loading
Loading