How do I reformat the 'for' statement separated into three lines into one, in a automatically generated c++ code? I tried uncrustify, but I could not make it format the parts within parenthesis. sed seems not suitable for this. Could any one suggest me other formatter or some linux command that can take care of it?
Code to be formatted:
void func(double* s, Quaternion& a, int n)
{
int size((n<4)?n:4);
for (int i=0;
i<size;
i++)
{
a[i] = s[i];
}
}
I want the 'for' statement above to be formatted into one line, like:
for (int i=0; i<size; i++)