#176806 - blessingta@hotmail.co.uk - Fri Oct 14, 2011 5:22 pm
hi
I'm trying to create a for loop in order to create some programmer font art but it wont work. because devkit pro has some "C99" mode issue. Bellow is my programmer art fonts (in the for loop) and after that is the error.
Whats the meaning of this error?
[/code]
I'm trying to create a for loop in order to create some programmer font art but it wont work. because devkit pro has some "C99" mode issue. Bellow is my programmer art fonts (in the for loop) and after that is the error.
Code: |
//Where our characters are located
unsigned int *CharPtr = CHAR_BASE_ADR(0); int Random_Colour = 0; int Random_Colour2 = 0; void btafonts_init() { //90 is the amount of ascii characters I'm creating for ( int i = 0; i < 90; i++) { //Create Place holders for my characters (programmer art) //the combination of 4 abitary colours are used to differentiate what will be differnt fonts. //these fonts will be a random combination of four, of the 16 colours in any pallete //Random colour chooses any 1 of the 16 colours //(this if statement stops it from writing a number greater than 15) if ((Random_Colour = i % 16) > 12) Random_Colour -= 12;//thus cycling back to 0 Random_Colour2 = i % 10;// other random colours being added CharPtr[(65*8+0)] = ((Random_Colour<<28)|(Random_Colour<<24)|(Random_Colour<<20)| (Random_Colour<<06) | (Random_Colour<<02) | (Random_Colour<<8) | (Random_Colour<<4)| (Random_Colour<<0)); CharPtr[(65*8+1)] = ((Random_Colour<<28)|(Random_Colour<<24)|(Random_Colour<<20)| (Random_Colour<<06) | (Random_Colour<<02) | (Random_Colour<<8) | (Random_Colour<<4)| (Random_Colour<<0)); CharPtr[(65*8+2)] = (((Random_Colour+1)<<28)|((Random_Colour+1)<<24)|((Random_Colour+1)<<20)| ((Random_Colour+1)<<06) | ((Random_Colour+1)<<02) | ((Random_Colour+1)<<8) | ((Random_Colour+1)<<4)| ((Random_Colour+1)<<0)); CharPtr[(65*8+3)] = (((Random_Colour+1)<<28)|((Random_Colour+1)<<24)|((Random_Colour+1)<<20)| ((Random_Colour+1)<<06) | ((Random_Colour+1)<<02) | ((Random_Colour+1)<<8) | ((Random_Colour+1)<<4)| ((Random_Colour+1)<<0)); CharPtr[(65*8+4)] = (((Random_Colour+2)<<28)|((Random_Colour+2)<<24)|((Random_Colour+2)<<20)| ((Random_Colour+2)<<06) | ((Random_Colour+2)<<02) | ((Random_Colour+2)<<8) | ((Random_Colour+2)<<4)| ((Random_Colour+2)<<0)); |
Whats the meaning of this error?
Quote: |
> "make"
main.c arm-eabi-gcc -MMD -MP -MF /c/users/portsmouthuni/my_gba/build/main.d -g -Wall -O3 -mcpu=arm7tdmi -mtune=arm7tdmi -fomit-frame-pointer -ffast-math -mthumb -mthumb-interwork -I/c/users/portsmouthuni/my_gba/include -I/c/devkitPro/libgba/include -I/c/users/portsmouthuni/my_gba/build -c /c/users/portsmouthuni/my_gba/source/main.c -o main.o In file included from c:/users/portsmouthuni/my_gba/source/main.c:10:0: c:/users/portsmouthuni/my_gba/include/btafonts.h: In function 'btafonts_init': c:/users/portsmouthuni/my_gba/include/btafonts.h:33:2: error: 'for' loop initial declarations are only allowed in C99 mode c:/users/portsmouthuni/my_gba/include/btafonts.h:33:2: note: use option -std=c99 or -std=gnu99 to compile your code c:/users/portsmouthuni/my_gba/source/main.c: In function 'main': c:/users/portsmouthuni/my_gba/source/main.c:82:2: error: 'for' loop initial declarations are only allowed in C99 mode make[1]: *** [main.o] Error 1 "make": *** [build] Error 2 > Process Exit Code: 2 > Time Taken: 00:01 |