From 9d41668800e99155c097eae03f17fd78aee436ea Mon Sep 17 00:00:00 2001 From: "Rafael G. Martins" Date: Tue, 6 Jun 2023 19:20:05 +0200 Subject: [PATCH] Fix sign-compare warning --- src/usbd_stm32f103_devfs.c | 2 +- src/usbd_stm32l052_devfs.c | 2 +- src/usbd_stm32l100_devfs.c | 2 +- src/usbd_stm32l433_devfs.c | 2 +- src/usbd_stm32wb55_devfs.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/usbd_stm32f103_devfs.c b/src/usbd_stm32f103_devfs.c index 2e81435..575d6b0 100644 --- a/src/usbd_stm32f103_devfs.c +++ b/src/usbd_stm32f103_devfs.c @@ -153,7 +153,7 @@ static uint16_t get_next_pma(uint16_t sz) { if ((tbl->tx.addr) && (tbl->tx.addr < _result)) _result = tbl->tx.addr; if ((tbl->rx.addr) && (tbl->rx.addr < _result)) _result = tbl->rx.addr; } - return (_result < (0x020 + sz)) ? 0 : (_result - sz); + return (_result < (0x020U + sz)) ? 0 : (_result - sz); } static uint32_t getinfo(void) { diff --git a/src/usbd_stm32l052_devfs.c b/src/usbd_stm32l052_devfs.c index e2ba11e..6bc65ad 100644 --- a/src/usbd_stm32l052_devfs.c +++ b/src/usbd_stm32l052_devfs.c @@ -101,7 +101,7 @@ static uint16_t get_next_pma(uint16_t sz) { if ((tbl->rx.addr) && (tbl->rx.addr < _result)) _result = tbl->rx.addr; if ((tbl->tx.addr) && (tbl->tx.addr < _result)) _result = tbl->tx.addr; } - return (_result < (0x020 + sz)) ? 0 : (_result - sz); + return (_result < (0x020U + sz)) ? 0 : (_result - sz); } static uint32_t getinfo(void) { diff --git a/src/usbd_stm32l100_devfs.c b/src/usbd_stm32l100_devfs.c index 77488ed..9da29fe 100644 --- a/src/usbd_stm32l100_devfs.c +++ b/src/usbd_stm32l100_devfs.c @@ -90,7 +90,7 @@ static uint16_t get_next_pma(uint16_t sz) { if ((tbl->tx.addr) && (tbl->tx.addr < _result)) _result = tbl->tx.addr; if ((tbl->rx.addr) && (tbl->rx.addr < _result)) _result = tbl->rx.addr; } - return (_result < (0x020 + sz)) ? 0 : (_result - sz); + return (_result < (0x020U + sz)) ? 0 : (_result - sz); } static uint32_t getinfo(void) { diff --git a/src/usbd_stm32l433_devfs.c b/src/usbd_stm32l433_devfs.c index 133624c..5b3f953 100644 --- a/src/usbd_stm32l433_devfs.c +++ b/src/usbd_stm32l433_devfs.c @@ -94,7 +94,7 @@ static uint16_t get_next_pma(uint16_t sz) { if ((tbl->rx.addr) && (tbl->rx.addr < _result)) _result = tbl->rx.addr; if ((tbl->tx.addr) && (tbl->tx.addr < _result)) _result = tbl->tx.addr; } - return (_result < (0x020 + sz)) ? 0 : (_result - sz); + return (_result < (0x020U + sz)) ? 0 : (_result - sz); } static uint32_t getinfo(void) { diff --git a/src/usbd_stm32wb55_devfs.c b/src/usbd_stm32wb55_devfs.c index 07a50b0..1e23453 100644 --- a/src/usbd_stm32wb55_devfs.c +++ b/src/usbd_stm32wb55_devfs.c @@ -94,7 +94,7 @@ static uint16_t get_next_pma(uint16_t sz) { if ((tbl->rx.addr) && (tbl->rx.addr < _result)) _result = tbl->rx.addr; if ((tbl->tx.addr) && (tbl->tx.addr < _result)) _result = tbl->tx.addr; } - return (_result < (unsigned)(0x020 + sz)) ? 0 : (_result - sz); + return (_result < (0x020U + sz)) ? 0 : (_result - sz); } static uint32_t getinfo(void) {