move declaration to top of function for old style c