Force unsigned compare on advance_pointer.
This commit is contained in:
parent
2b2549b573
commit
7321972380
|
@ -325,7 +325,7 @@ static uint16_t advance_pointer(tu_fifo_t* f, uint16_t p, uint16_t offset)
|
||||||
// We are exploiting the wrap around to the correct index
|
// We are exploiting the wrap around to the correct index
|
||||||
|
|
||||||
// TODO warning: assuming signed overflow does not occur when assuming that (X + c) < X is always false [-Wstrict-overflow]
|
// TODO warning: assuming signed overflow does not occur when assuming that (X + c) < X is always false [-Wstrict-overflow]
|
||||||
if ((p > p + offset) || (p + offset > f->max_pointer_idx))
|
if ((p > (uint16_t)(p + offset)) || ((uint16_t)(p + offset) > f->max_pointer_idx))
|
||||||
{
|
{
|
||||||
p = (p + offset) + f->non_used_index_space;
|
p = (p + offset) + f->non_used_index_space;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue