diff options
| author | hathach <[email protected]> | 2021-10-15 15:54:32 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2021-10-15 15:54:32 +0700 |
| commit | 7596cb30797c625a0523e0f68ef65296740538e0 (patch) | |
| tree | b84a5e9ab74caf759a69b95d7f963f518be1a571 /src | |
| parent | 9da234cd7c73786624970206d7b7b7361275a6b7 (diff) | |
update some sense warning from -Wconversion
Diffstat (limited to 'src')
| -rw-r--r-- | src/class/cdc/cdc_device.c | 2 | ||||
| -rw-r--r-- | src/class/msc/msc_device.c | 2 | ||||
| -rw-r--r-- | src/tusb.c | 5 |
3 files changed, 4 insertions, 5 deletions
diff --git a/src/class/cdc/cdc_device.c b/src/class/cdc/cdc_device.c index e622bd616..74c116192 100644 --- a/src/class/cdc/cdc_device.c +++ b/src/class/cdc/cdc_device.c @@ -229,7 +229,7 @@ void cdcd_init(void) { cdcd_interface_t* p_cdc = &_cdcd_itf[i]; - p_cdc->wanted_char = -1; + p_cdc->wanted_char = (char) -1; // default line coding is : stop bit = 1, parity = none, data bits = 8 p_cdc->line_coding.bit_rate = 115200; diff --git a/src/class/msc/msc_device.c b/src/class/msc/msc_device.c index c54c4c189..81522be46 100644 --- a/src/class/msc/msc_device.c +++ b/src/class/msc/msc_device.c @@ -152,7 +152,7 @@ static inline uint16_t rdwr10_get_blocksize(msc_cbw_t const* cbw) // invalid block count if (block_count == 0) return 0; - return cbw->total_bytes / block_count; + return (uint16_t) (cbw->total_bytes / block_count); } uint8_t rdwr10_validate_cmd(msc_cbw_t const* cbw) diff --git a/src/tusb.c b/src/tusb.c index 5c6adad24..fc1936c3d 100644 --- a/src/tusb.c +++ b/src/tusb.c @@ -109,9 +109,9 @@ bool tu_edpt_validate(tusb_desc_endpoint_t const * desc_ep, tusb_speed_t speed) void tu_edpt_bind_driver(uint8_t ep2drv[][2], tusb_desc_interface_t const* desc_itf, uint16_t desc_len, uint8_t driver_id) { uint8_t const* p_desc = (uint8_t const*) desc_itf; - uint16_t len = 0; + uint8_t const* desc_end = p_desc + desc_len; - while( len < desc_len ) + while( p_desc < desc_end ) { if ( TUSB_DESC_ENDPOINT == tu_desc_type(p_desc) ) { @@ -121,7 +121,6 @@ void tu_edpt_bind_driver(uint8_t ep2drv[][2], tusb_desc_interface_t const* desc_ ep2drv[tu_edpt_number(ep_addr)][tu_edpt_dir(ep_addr)] = driver_id; } - len += (uint16_t) tu_desc_len(p_desc); p_desc = tu_desc_next(p_desc); } } |
