Skip to content

Conversation

@nberlette
Copy link
Owner

No description provided.

Signed-off-by: Tobias Lorenz <tobias.lorenz@gmx.net>
@Copilot Copilot AI review requested due to automatic review settings June 20, 2025 01:27
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes the CanFdMessage64 implementation by updating tests, improving type safety in examples, and modifying data storage.

  • Updated expected validDataBytes value in tests
  • Modified Parser.cpp to use explicit type casting for channel
  • Changed CanFdMessage64 data storage from a fixed array to a vector and updated associated I/O operations

Reviewed Changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/Vector/BLF/tests/unittests/test_CanFdMessage64.cpp Updated test expected value for validDataBytes
src/Vector/BLF/docs/examples/Parser.cpp Added explicit static cast and a default branch in the channel printout example
src/Vector/BLF/CanFdMessage64.h Changed data storage from std::array to std::vector
src/Vector/BLF/CanFdMessage64.cpp Added resize of data based on validDataBytes and updated write() pre-processing
CHANGELOG.md Documented the fix in the changelog
Comments suppressed due to low confidence (1)

src/Vector/BLF/tests/unittests/test_CanFdMessage64.cpp:38

  • Verify that the updated expected validDataBytes value (0x40) fully aligns with the new specifications for CanFdMessage64.
    BOOST_CHECK_EQUAL(obj->validDataBytes, 0x40);

* dlc).
*/
std::array<BYTE, 64> data;
std::vector<uint8_t> data;
Copy link

Copilot AI Jun 20, 2025

Choose a reason for hiding this comment

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

Switching from a fixed-size std::array to a dynamic std::vector alters memory allocation. Consider documenting the rationale for this change and evaluating potential performance impacts if data is always 64 bytes.

Copilot uses AI. Check for mistakes.

void CanFdMessage64::write(AbstractFile & os)
{
/* pre processing */
validDataBytes = static_cast<WORD>(data.size());
Copy link

Copilot AI Jun 20, 2025

Choose a reason for hiding this comment

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

Casting data.size() to WORD may lead to overflow if data.size() ever exceeds WORD's maximum value. Consider adding a check or enforcing an upper bound.

Copilot uses AI. Check for mistakes.

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