Convert more files to C99

Mechanically moved local variable declarations to the locations where they are actually needed. No functionality change. This change should improve readability the scopes of the variables are now narrower than they before.