diff --git a/README.md b/README.md index 280ab91..943b0f9 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Compact Cyphal/CAN v1 in C +# Compact Cyphal/CAN in C [![Main Workflow](https://github.com/OpenCyphal/libcanard/actions/workflows/main.yml/badge.svg)](https://github.com/OpenCyphal/libcanard/actions/workflows/main.yml) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=libcanard&metric=alert_status)](https://sonarcloud.io/dashboard?id=libcanard) @@ -124,7 +124,7 @@ Use [Nunavut](https://github.com/OpenCyphal/nunavut) to automatically generate The CAN frames generated from the message transfer are now stored in the `queue`. We need to pick them out one by one and have them transmitted. Normally, the following fragment should be invoked periodically to unload the CAN frames from the -prioritized transmission queue into the CAN driver (or several, if redundant interfaces are used): +prioritized transmission queue (or several, if redundant interfaces are used) into the CAN driver: ```c for (const CanardTxQueueItem* ti = NULL; (ti = canardTxPeek(&queue)) != NULL;) // Peek at the top of the queue. diff --git a/libcanard/canard.c b/libcanard/canard.c index ba7e517..e3095f8 100644 --- a/libcanard/canard.c +++ b/libcanard/canard.c @@ -299,7 +299,7 @@ CANARD_PRIVATE TxItem* txAllocateQueueItem(CanardInstance* const ins, { CANARD_ASSERT(ins != NULL); CANARD_ASSERT(payload_size > 0U); - TxItem* const out = (TxItem*) ins->memory_allocate(ins, sizeof(TxItem) - CANARD_MTU_MAX + payload_size); + TxItem* const out = (TxItem*) ins->memory_allocate(ins, (sizeof(TxItem) - CANARD_MTU_MAX) + payload_size); if (out != NULL) { out->base.base.up = NULL; @@ -324,7 +324,7 @@ CANARD_PRIVATE int8_t txAVLPredicate(void* const user_reference, // NOSONAR Cav const CanardTreeNode* const node) { const CanardTxQueueItem* const target = (const CanardTxQueueItem*) user_reference; - const CanardTxQueueItem* const other = (const CanardTxQueueItem*) (void*) node; + const CanardTxQueueItem* const other = (const CanardTxQueueItem*) (const void*) node; CANARD_ASSERT((target != NULL) && (other != NULL)); return (target->frame.extended_can_id >= other->frame.extended_can_id) ? +1 : -1; } @@ -945,7 +945,7 @@ rxSubscriptionPredicateOnPortID(void* const user_reference, // NOSONAR Cavl API const CanardTreeNode* const node) { const CanardPortID sought = *((const CanardPortID*) user_reference); - const CanardPortID other = ((const CanardRxSubscription*) (void*) node)->port_id; + const CanardPortID other = ((const CanardRxSubscription*) (const void*) node)->port_id; static const int8_t NegPos[2] = {-1, +1}; // Clang-Tidy mistakenly identifies a narrowing cast to int8_t here, which is incorrect. return (sought == other) ? 0 : NegPos[sought > other]; // NOLINT no narrowing conversion is taking place here