C89 compat

no inline
declare variables at start of scope
no INFINITY