fixed some uint64_t (touint) cast to size_t on Windows