Skip to content

Commit

Permalink
Fix sign-compare warning
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelmartins committed Jun 6, 2023
1 parent 9168e2a commit 9d41668
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/usbd_stm32f103_devfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/usbd_stm32l052_devfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/usbd_stm32l100_devfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/usbd_stm32l433_devfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/usbd_stm32wb55_devfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 9d41668

Please sign in to comment.