Commit b657698da96f395294245f63afda6664cb56c904
1 parent
55c276e8
Avoid to shadow 'boolean' on weird platform (Windows)
Showing
3 changed files
with
8 additions
and
7 deletions
doc/modbus_set_debug.txt
| ... | ... | @@ -8,15 +8,16 @@ modbus_set_debug - set debug flag of the context |
| 8 | 8 | |
| 9 | 9 | SYNOPSIS |
| 10 | 10 | -------- |
| 11 | -*int modbus_set_debug(modbus_t *'ctx', int 'boolean');* | |
| 11 | +*int modbus_set_debug(modbus_t *'ctx', int 'flag');* | |
| 12 | 12 | |
| 13 | 13 | |
| 14 | 14 | DESCRIPTION |
| 15 | 15 | ----------- |
| 16 | 16 | The _modbus_set_debug()_ function shall set the debug flag of the *modbus_t* |
| 17 | -context by using the argument 'boolean'. When the 'boolean' value is set to | |
| 18 | -'TRUE', many verbose messages are displayed on stdout and stderr. For example, | |
| 19 | -this flag is useful to display the bytes of the Modbus messages. | |
| 17 | +context by using the argument 'flag'. By default, the boolean flag is set to | |
| 18 | +'FALSE'. When the 'flag' value is set to 'TRUE', many verbose messages are | |
| 19 | +displayed on stdout and stderr. For example, this flag is useful to display the | |
| 20 | +bytes of the Modbus messages. | |
| 20 | 21 | |
| 21 | 22 | [verse] |
| 22 | 23 | ___________________ | ... | ... |
src/modbus.c
| ... | ... | @@ -1667,14 +1667,14 @@ void modbus_free(modbus_t *ctx) |
| 1667 | 1667 | ctx->backend->free(ctx); |
| 1668 | 1668 | } |
| 1669 | 1669 | |
| 1670 | -int modbus_set_debug(modbus_t *ctx, int boolean) | |
| 1670 | +int modbus_set_debug(modbus_t *ctx, int flag) | |
| 1671 | 1671 | { |
| 1672 | 1672 | if (ctx == NULL) { |
| 1673 | 1673 | errno = EINVAL; |
| 1674 | 1674 | return -1; |
| 1675 | 1675 | } |
| 1676 | 1676 | |
| 1677 | - ctx->debug = boolean; | |
| 1677 | + ctx->debug = flag; | |
| 1678 | 1678 | return 0; |
| 1679 | 1679 | } |
| 1680 | 1680 | ... | ... |
src/modbus.h
| ... | ... | @@ -173,7 +173,7 @@ EXPORT void modbus_close(modbus_t *ctx); |
| 173 | 173 | EXPORT void modbus_free(modbus_t *ctx); |
| 174 | 174 | |
| 175 | 175 | EXPORT int modbus_flush(modbus_t *ctx); |
| 176 | -EXPORT int modbus_set_debug(modbus_t *ctx, int boolean); | |
| 176 | +EXPORT int modbus_set_debug(modbus_t *ctx, int flag); | |
| 177 | 177 | |
| 178 | 178 | EXPORT const char *modbus_strerror(int errnum); |
| 179 | 179 | ... | ... |