Skip to content

Commit 1ece5ff

Browse files
author
Deepika
committed
Using size_t instead of integer type to resolve warning: comparison between signed and unsigned integer expressions
1 parent 9b5f5a5 commit 1ece5ff

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/CAN.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ static void donothing() {}
2626
CAN::CAN(PinName rd, PinName td) : _can(), _irq() {
2727
// No lock needed in constructor
2828

29-
for (int i = 0; i < sizeof _irq / sizeof _irq[0]; i++) {
29+
for (size_t i = 0; i < sizeof _irq / sizeof _irq[0]; i++) {
3030
_irq[i] = callback(donothing);
3131
}
3232

@@ -37,7 +37,7 @@ CAN::CAN(PinName rd, PinName td) : _can(), _irq() {
3737
CAN::CAN(PinName rd, PinName td, int hz) : _can(), _irq() {
3838
// No lock needed in constructor
3939

40-
for (int i = 0; i < sizeof _irq / sizeof _irq[0]; i++) {
40+
for (size_t i = 0; i < sizeof _irq / sizeof _irq[0]; i++) {
4141
_irq[i].attach(donothing);
4242
}
4343

0 commit comments

Comments
 (0)