From 28e30830755758d13458c05ebe2a8db5dc9f43a0 Mon Sep 17 00:00:00 2001 From: Christopher Peplin Date: Sat, 4 Jan 2014 11:32:15 -0500 Subject: [PATCH] Build with GNU89 standard for greater compatibility. --- Makefile | 2 +- src/bitfield/8byte.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 89fbf25..d831b5a 100644 --- 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 diff --git a/src/bitfield/8byte.c b/src/bitfield/8byte.c index 5f31042..72f7e32 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]; } -- 2.16.6