Build with GNU89 standard for greater compatibility.
authorChristopher Peplin <chris.peplin@rhubarbtech.com>
Sat, 4 Jan 2014 16:32:15 +0000 (11:32 -0500)
committerChristopher Peplin <chris.peplin@rhubarbtech.com>
Sat, 4 Jan 2014 16:32:15 +0000 (11:32 -0500)
Makefile
src/bitfield/8byte.c

index 89fbf25..d831b5a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -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
 
index 5f31042..72f7e32 100644 (file)
@@ -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];
         }