Skip to content

Commit e6063af

Browse files
committed
fixes signed-unsigned comparison warning
1 parent 8e1679d commit e6063af

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Modbus.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ void Modbus::writeMultipleRegisters (byte * frame, word startreg, word numoutput
313313
}
314314

315315
//Check Address (startreg...startreg + numregs)
316-
for (int k = 0; k < numoutputs; k++) {
316+
for (word k = 0; k < numoutputs; k++) {
317317
if (!this->searchRegister (startreg + 40001 + k)) {
318318
this->exceptionResponse (MB_FC_WRITE_REGS, MB_EX_ILLEGAL_ADDRESS);
319319
return;
@@ -544,7 +544,7 @@ void Modbus::writeMultipleCoils (byte * frame, word startreg, word numoutputs, b
544544
}
545545

546546
//Check Address (startreg...startreg + numregs)
547-
for (int k = 0; k < numoutputs; k++) {
547+
for (word k = 0; k < numoutputs; k++) {
548548
if (!this->searchRegister (startreg + 1 + k)) {
549549
this->exceptionResponse (MB_FC_WRITE_COILS, MB_EX_ILLEGAL_ADDRESS);
550550
return;

0 commit comments

Comments
 (0)