altera,libusb_ll,mcsParser: fix some compiler's warnings

This commit is contained in:
Gwenhael Goavec-Merou 2025-06-19 08:30:35 +02:00
parent 803bdfecce
commit 21d4fccf28
3 changed files with 3 additions and 3 deletions

View File

@ -978,7 +978,7 @@ bool Altera::sectors_mask_start_end_addr(const Altera::max10_mem_t *mem,
}
/* decrement eaddr until last bit == 1 found */
for (uint8_t i = 3; i >= 0; i--) {
for (int8_t i = 3; i >= 0; i--) {
if (update_sectors & (1 << i)) {
end_bit = i + 1;
break;

View File

@ -57,7 +57,7 @@ int libusb_ll::get_devices_list(const cable_t *cable)
bus_addr = cable->bus_addr;
device_addr = cable->device_addr;
vid_pid_filter = (vid != 0) && (pid != 0);
bus_dev_filter = ~(bus_addr == 0 && device_addr == 0);
bus_dev_filter = !(bus_addr == 0 && device_addr == 0);
}
int i = 0;

View File

@ -94,7 +94,7 @@ int McsParser::parse()
_base_addr = (loc_addr << 16);
if (_base_addr * 8 > _bit_length)
_bit_length = _base_addr * 8;
if (_bit_length > _bit_data.size() * 8)
if ((size_t)_bit_length > _bit_data.size() * 8)
_bit_data.resize(_bit_length / 8);
sum += (loc_addr & 0xff) + ((loc_addr >> 8) & 0xff);
break;