I am new to the preprocessor, I rarely use it, so this question might seem silly. In my C program I discovered that a for loop which had a fixed start and end known at compile time was causing some performance issues. I temporarily solved this by manually rolling it out, however that seems to be a bit dirty. Is there a way to tell the preprocessor to turn this:
for(int i = 0; i < 8; i++)
{
doSomeThingWithI(i, [...]);
doSomeMoreStuffWithIt(i, [...]);
foo();
[...]
}
into this:
doSomeThingWithI(0, [...]);
doSomeMoreStuffWithIt(0, [...]);
foo();
[...]
doSomeThingWithI(1, [...]);
doSomeMoreStuffWithIt(1, [...]);
foo();
[...]
[...]
The important thing is that I have to use "i" inside the loop.