fixed some declarations and added the missing ones

so there is no need to turn off warnings for implicit-function-declaration