cast to a std::size_t rather than assume, fixes cygwin