Skip to content

Commit 21d4fcc

Browse files
committed
altera,libusb_ll,mcsParser: fix some compiler's warnings
1 parent 803bdfe commit 21d4fcc

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/altera.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,7 @@ bool Altera::sectors_mask_start_end_addr(const Altera::max10_mem_t *mem,
978978
}
979979

980980
/* decrement eaddr until last bit == 1 found */
981-
for (uint8_t i = 3; i >= 0; i--) {
981+
for (int8_t i = 3; i >= 0; i--) {
982982
if (update_sectors & (1 << i)) {
983983
end_bit = i + 1;
984984
break;

src/libusb_ll.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ int libusb_ll::get_devices_list(const cable_t *cable)
5757
bus_addr = cable->bus_addr;
5858
device_addr = cable->device_addr;
5959
vid_pid_filter = (vid != 0) && (pid != 0);
60-
bus_dev_filter = ~(bus_addr == 0 && device_addr == 0);
60+
bus_dev_filter = !(bus_addr == 0 && device_addr == 0);
6161
}
6262

6363
int i = 0;

src/mcsParser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ int McsParser::parse()
9494
_base_addr = (loc_addr << 16);
9595
if (_base_addr * 8 > _bit_length)
9696
_bit_length = _base_addr * 8;
97-
if (_bit_length > _bit_data.size() * 8)
97+
if ((size_t)_bit_length > _bit_data.size() * 8)
9898
_bit_data.resize(_bit_length / 8);
9999
sum += (loc_addr & 0xff) + ((loc_addr >> 8) & 0xff);
100100
break;

0 commit comments

Comments
 (0)