In plenty of places a non-static function was defined but didn't have the corresponding declaration. Fix this by adding them, or alternatively making them static.