Mcu32
Well-known member
int AudioConnection::connect(void):
1:
Incomplete loop (while (p->next_dest)):
The while condition terminates as soon as p->next_dest == NULL. As a result, the last element in the list is never checked for a duplicate.
2:
Incorrect pointer comparison (&p->src == &this->src):
&p->src takes the address of the pointer member src within object p (AudioStream**). Since p and this are two distinct AudioConnection objects in memory, &p->src == &this->src is always false. The pointer values themselves must be compared (p->src == src or p->src == this->src).
receiveWritable()
needs - following the ususal pattern - a __disable_irq();
No examples here; I don't think it's necessary, and it would be unnecessary work.
1:
Incomplete loop (while (p->next_dest)):
The while condition terminates as soon as p->next_dest == NULL. As a result, the last element in the list is never checked for a duplicate.
2:
Incorrect pointer comparison (&p->src == &this->src):
Code:
while (p->next_dest) // scan source Stream's connection list for duplicates{ if (&p->src == &this->src && &p->dst == &this->dst && p->src_index == this->src_index && p->dest_index == this->dest_index) {
receiveWritable()
needs - following the ususal pattern - a __disable_irq();
No examples here; I don't think it's necessary, and it would be unnecessary work.
Last edited: