summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMasterPhi <[email protected]>2021-06-30 20:26:27 +0200
committerMasterPhi <[email protected]>2021-06-30 20:26:27 +0200
commit7321972380b7bf74557293ba975e912f2941ae02 (patch)
treed3d14ba061f943782657b4cfa7583009457a1e60 /src
parent2b2549b57316033e544e3261334e3e20224563ce (diff)
Force unsigned compare on advance_pointer.
Diffstat (limited to 'src')
-rw-r--r--src/common/tusb_fifo.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common/tusb_fifo.c b/src/common/tusb_fifo.c
index 1229201b8..73217cf75 100644
--- a/src/common/tusb_fifo.c
+++ b/src/common/tusb_fifo.c
@@ -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
// 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;
}