remove ssize_t and replace with size_t or int where appropriate