ptrdiff_t and size_t refactoring

As according to https://github.com/irungentoo/ProjectTox-Core/issues/625