mirror of
https://github.com/hathach/tinyusb.git
synced 2025-12-01 12:24:17 +00:00
Fixed more alert found by PVS-Studio
This commit is contained in:
@ -51,8 +51,7 @@ int sys_read(int fhdl, char *buf, size_t count) TU_ATTR_USED;
|
||||
|
||||
int sys_write(int fhdl, const char *buf, size_t count) {
|
||||
(void) fhdl;
|
||||
SEGGER_RTT_Write(0, buf, (int) count);
|
||||
return (int) count;
|
||||
return (int) SEGGER_RTT_Write(0, buf, (int) count);
|
||||
}
|
||||
|
||||
int sys_read(int fhdl, char *buf, size_t count) {
|
||||
@ -159,7 +158,7 @@ int board_getchar(void) {
|
||||
}
|
||||
|
||||
void board_putchar(int c) {
|
||||
sys_write(0, (const char*)&c, 1);
|
||||
(void) sys_write(0, (const char*)&c, 1);
|
||||
}
|
||||
|
||||
uint32_t tusb_time_millis_api(void) {
|
||||
|
||||
@ -165,7 +165,7 @@ static inline size_t board_usb_get_serial(uint16_t desc_str1[], size_t max_chars
|
||||
'0', '1', '2', '3', '4', '5', '6', '7',
|
||||
'8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
|
||||
};
|
||||
const uint8_t nibble = (uint8_t) ((uid[i] >> (j * 4)) & 0xf);
|
||||
const uint8_t nibble = (uint8_t) ((uid[i] >> (j * 4u)) & 0xfu);
|
||||
desc_str1[i * 2 + (1 - j)] = nibble_to_hex[nibble]; // UTF-16-LE
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user