move variable declaration outside for loop to make older compilers happy

This patch fixes an issue introduced in 8f349e84 (2013-12-22 @ 1:28:46 PM EST) where the "for" loop variable was declared inside the for loop itself instead of external to the loop as is required for compatibility with some older compilers (e.g., Apple's GCC 4.2 using on Mac OS X 10.5 and 10.6 latest Xcode). The fix just declares the loop variable external to the loop. - MLD