I wonder if there exist some free software that let me pass a C file and it outputs a more structured C-file.
I'm dealing with a short piece of C-Code that has been written long ago. I'd like to extract a clever algorithm from it, but working with the code itself is hard because it lacks everything that makes C-code readable.
Just a short example:
node *first(node *p)
{
node *aux=p;
if (aux)
do aux=aux->next;
while(aux!=p && (!aux->intersect || aux->intersect && aux->visited));
return aux;
}
What I'd like to get as an output would be something like this:
node *first(node *p)
{
node *aux=p;
if (aux)
{
do
{
aux=aux->next;
}
while( (aux!=p) && (!aux->intersect || (aux->intersect && aux->visited)));
}
return aux;
}
Does such an automatic code cleanup tool exist?