Started by removing two or three unused variables, ended up cleaning up a lot of formatting (tabs, trailing spaces, indentation, a few wide lines, 'if (test) return' on same line). Marked some static functions as static in their definitions instead of leaving it hidden in their prototypes. Moved a pair of short-circuit checks to skip several initializations.