Towrads C90 compatibility

converted some of the code to be C90 compatible