diff options
author | Victor Rocco <victor_rocco@hotmail.com> | 2012-10-27 13:36:29 -0300 |
---|---|---|
committer | Sebastian Kuzminsky <seb@highlab.com> | 2012-10-27 13:16:33 -0600 |
commit | 9d40326c7ff1bfa65dd952e506b98112506044a2 (patch) | |
tree | 2c00221c5c50319b88633f57c638750423b57b2b | |
parent | 51824c8d8a29e1190fda43972da83e922da0d34a (diff) | |
download | linuxcnc-9d40326c7ff1bfa65dd952e506b98112506044a2.tar.gz linuxcnc-9d40326c7ff1bfa65dd952e506b98112506044a2.zip |
mb2hal: fix two non fatal bugs caught by Clang
Nothing big, two instances of dead initialization (so, a variable is
explicitly set at define-time, but then written to again before being read).
Signed-off-by: Sebastian Kuzminsky <seb@highlab.com>
-rw-r--r-- | src/hal/user_comps/mb2hal/mb2hal_modbus.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/hal/user_comps/mb2hal/mb2hal_modbus.c b/src/hal/user_comps/mb2hal/mb2hal_modbus.c index 88c0d08df..ffee99df7 100644 --- a/src/hal/user_comps/mb2hal/mb2hal_modbus.c +++ b/src/hal/user_comps/mb2hal/mb2hal_modbus.c @@ -126,8 +126,7 @@ retCode fnct_04_read_input_registers(mb_tx_t *mb_tx) retCode fnct_15_write_multiple_coils(mb_tx_t *mb_tx) { char *fnct_name = "fnct_15_write_multiple_coils"; - int start = mb_tx->mb_nelements - 1; - int end = 0; + int start, end; int counter; int ret; int bits[MAX_WRITE_COILS]; @@ -168,8 +167,7 @@ retCode fnct_15_write_multiple_coils(mb_tx_t *mb_tx) retCode fnct_16_write_multiple_registers(mb_tx_t *mb_tx) { char *fnct_name = "scan_write_holding"; - int start = mb_tx->mb_nelements - 1; - int end = 0; + int start, end; int counter; int data[MAX_WRITE_REGS]; int ret; |