Permalink
Browse files

Fix compilation warnings with Microsoft compiler (closes #64)

  • Loading branch information...
1 parent 2dca042 commit a98392f06fb65cb1ec8b600d8a94f10e95eece1b @stephane committed Jun 6, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/modbus-data.c
View
@@ -31,7 +31,7 @@ void modbus_set_bits_from_byte(uint8_t *dest, int index, const uint8_t value)
{
int i;
- for (i=0; i<8; i++) {
+ for (i=0; i < 8; i++) {
dest[index+i] = (value & (1 << i)) ? 1 : 0;
}
}
@@ -41,7 +41,7 @@ void modbus_set_bits_from_byte(uint8_t *dest, int index, const uint8_t value)
void modbus_set_bits_from_bytes(uint8_t *dest, int index, unsigned int nb_bits,
const uint8_t *tab_byte)
{
- int i;
+ unsigned int i;
int shift = 0;
for (i = index; i < index + nb_bits; i++) {
@@ -57,7 +57,7 @@ void modbus_set_bits_from_bytes(uint8_t *dest, int index, unsigned int nb_bits,
uint8_t modbus_get_byte_from_bits(const uint8_t *src, int index,
unsigned int nb_bits)
{
- int i;
+ unsigned int i;
uint8_t value = 0;
if (nb_bits > 8) {

0 comments on commit a98392f

Please sign in to comment.