Move declaration out of for loop, make non-C99 happy