fix error: 'for' loop initial declarations are only allowed in C99 mode

got compile error on ubuntu 12.04.2