fix warning ISO C90 forbids mixed declarations and code
fix warnings control reaches end of non-void function