From b5d75be31f2da83f699fdadb9e597df681317d10 Mon Sep 17 00:00:00 2001 From: Stéphane Raimbault Date: Mon, 21 Apr 2008 08:46:32 +0200 Subject: [PATCH] It's faster to use int data than uint16_t (alignment). --- modbus/modbus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modbus/modbus.c b/modbus/modbus.c index cc1eb16..29a53ca 100644 --- a/modbus/modbus.c +++ b/modbus/modbus.c @@ -844,7 +844,7 @@ void manage_query(modbus_param_t *mb_param, uint8_t *query, } break; case FC_FORCE_MULTIPLE_COILS: { - uint16_t count = (query[offset+4] << 8) + query[offset+5]; + int count = (query[offset+4] << 8) + query[offset+5]; if ((address + count) > mb_mapping->nb_coil_status) { printf("Illegal data address %0X in force_multiple_coils\n", @@ -860,7 +860,7 @@ void manage_query(modbus_param_t *mb_param, uint8_t *query, } break; case FC_PRESET_MULTIPLE_REGISTERS: { - uint16_t count = (query[offset+4] << 8) + query[offset+5]; + int count = (query[offset+4] << 8) + query[offset+5]; if ((address + count) > mb_mapping->nb_holding_registers) { printf("Illegal data address %0X in preset_multiple_registers\n", -- libgit2 0.21.4