fixed c99 issues