Skip to content

Commit

Permalink
Fix compilation warnings with Microsoft compiler (closes #64)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephane committed Jun 6, 2012
1 parent 2dca042 commit a98392f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/modbus-data.c
Expand Up @@ -31,7 +31,7 @@ void modbus_set_bits_from_byte(uint8_t *dest, int index, const uint8_t value)
{ {
int i; int i;


for (i=0; i<8; i++) { for (i=0; i < 8; i++) {
dest[index+i] = (value & (1 << i)) ? 1 : 0; dest[index+i] = (value & (1 << i)) ? 1 : 0;
} }
} }
Expand All @@ -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, void modbus_set_bits_from_bytes(uint8_t *dest, int index, unsigned int nb_bits,
const uint8_t *tab_byte) const uint8_t *tab_byte)
{ {
int i; unsigned int i;
int shift = 0; int shift = 0;


for (i = index; i < index + nb_bits; i++) { for (i = index; i < index + nb_bits; i++) {
Expand All @@ -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, uint8_t modbus_get_byte_from_bits(const uint8_t *src, int index,
unsigned int nb_bits) unsigned int nb_bits)
{ {
int i; unsigned int i;
uint8_t value = 0; uint8_t value = 0;


if (nb_bits > 8) { if (nb_bits > 8) {
Expand Down

0 comments on commit a98392f

Please sign in to comment.