diff options
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | src/bitfield/8byte.c | 3 |
2 files changed, 3 insertions, 2 deletions
@@ -1,6 +1,6 @@ CC = gcc INCLUDES = -Isrc -CFLAGS = $(INCLUDES) -c -w -Wall -Werror -g -ggdb -std=gnu99 -coverage +CFLAGS = $(INCLUDES) -c -w -Wall -Werror -g -ggdb -coverage LDFLAGS = -coverage -lm LDLIBS = -lcheck diff --git a/src/bitfield/8byte.c b/src/bitfield/8byte.c index 5f310425..72f7e32b 100644 --- a/src/bitfield/8byte.c +++ b/src/bitfield/8byte.c @@ -36,7 +36,8 @@ uint64_t eightbyte_get_bitfield(uint64_t source, const uint16_t offset, uint64_t ret = bytes[startByte]; if(startByte != endByte) { // The lowest byte address contains the most significant bit. - for(uint8_t i = startByte + 1; i <= endByte; i++) { + uint8_t i; + for(i = startByte + 1; i <= endByte; i++) { ret = ret << 8; ret = ret | bytes[i]; } |