I was given a big chunk of uncommented code (around 3k lines) that I need to port to another platform. After quite some time going trough this mess I have an idea of what it does.
During this time I was thinking there must be a tool to help on process like this since many things could be automatized.
Do you know any tool that can do some of these things?
- Open a folder, go trough all the .c and .h files and point out what functions are unused (I found out at least 20% of the functions were never used, perhaps copy paste from other project).
- Find and make possible to change every function and variable only used on its own .c file as static. Don't know why everything was made public.
- Clean up the code so all the variables are up in the code, followed by function definitions and make the .h file order be the same as the .c one. This could be useful for any project really.
- I could think of many more. Something must really exist!