Skip to content

Commit 0ffc5a7

Browse files
committed
modbus.c -> modbus.cpp
1 parent e0c9b6c commit 0ffc5a7

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

Diff for: src/libmodbus/modbus.c renamed to src/libmodbus/modbus.cpp

+9-9
Original file line numberDiff line numberDiff line change
@@ -723,16 +723,16 @@ static int response_io_status(uint8_t *tab_io_status,
723723
static int response_exception(modbus_t *ctx, sft_t *sft,
724724
int exception_code, uint8_t *rsp,
725725
unsigned int to_flush,
726-
const char* template, ...)
726+
const char* format, ...)
727727
{
728728
int rsp_length;
729729

730730
/* Print debug message */
731731
if (ctx->debug) {
732732
va_list ap;
733733

734-
va_start(ap, template);
735-
vfprintf(stderr, template, ap);
734+
va_start(ap, format);
735+
vfprintf(stderr, format, ap);
736736
va_end(ap);
737737
}
738738

@@ -992,10 +992,10 @@ int modbus_reply(modbus_t *ctx, const uint8_t *req,
992992
address);
993993
} else {
994994
uint16_t data = mb_mapping->tab_registers[mapping_address];
995-
uint16_t and = (req[offset + 3] << 8) + req[offset + 4];
996-
uint16_t or = (req[offset + 5] << 8) + req[offset + 6];
995+
uint16_t _and = (req[offset + 3] << 8) + req[offset + 4];
996+
uint16_t _or = (req[offset + 5] << 8) + req[offset + 6];
997997

998-
data = (data & and) | (or & (~and));
998+
data = (data & _and) | (_or & (~_and));
999999
mb_mapping->tab_registers[mapping_address] = data;
10001000
memcpy(rsp, req, req_length);
10011001
rsp_length = req_length;
@@ -1904,9 +1904,9 @@ void modbus_mapping_free(modbus_mapping_t *mb_mapping)
19041904
*/
19051905
size_t strlcpy(char *dest, const char *src, size_t dest_size)
19061906
{
1907-
register char *d = dest;
1908-
register const char *s = src;
1909-
register size_t n = dest_size;
1907+
char *d = dest;
1908+
const char *s = src;
1909+
size_t n = dest_size;
19101910

19111911
/* Copy as many bytes as will fit */
19121912
if (n != 0 && --n != 0) {

0 commit comments

Comments
 (0)