fix violation of c99 syntax, declare int i in for
fix violation of c99 syntax, declare int i in for