From ca928d5002b8834635705f5ae9b482040966010e Mon Sep 17 00:00:00 2001 From: Stéphane Raimbault Date: Wed, 22 May 2013 23:31:39 +0200 Subject: [PATCH] Don't use reserved word 'byte' on Windows! --- src/modbus.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/modbus.c b/src/modbus.c index 7dcc50e..7c01940 100644 --- a/src/modbus.c +++ b/src/modbus.c @@ -640,22 +640,23 @@ static int response_io_status(int address, int nb, uint8_t *rsp, int offset) { int shift = 0; - int byte = 0; + /* Instead of byte (not allowed in Win32) */ + int one_byte = 0; int i; for (i = address; i < address+nb; i++) { - byte |= tab_io_status[i] << shift; + one_byte |= tab_io_status[i] << shift; if (shift == 7) { /* Byte is full */ - rsp[offset++] = byte; - byte = shift = 0; + rsp[offset++] = one_byte; + one_byte = shift = 0; } else { shift++; } } if (shift != 0) - rsp[offset++] = byte; + rsp[offset++] = one_byte; return offset; } -- libgit2 0.21.4