Skip to content

Commit 1d85ec3

Browse files
authored
Merge pull request #50 from nightlark/fix-conversion-warning-32bit-target
Static cast to fix conversion error on 32-bit processors
2 parents 21b1fb9 + 94738c9 commit 1d85ec3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/ghc/filesystem.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3961,8 +3961,8 @@ GHC_INLINE void last_write_time(const path& p, file_time_type new_time, std::err
39613961
struct ::timespec times[2];
39623962
times[0].tv_sec = 0;
39633963
times[0].tv_nsec = UTIME_OMIT;
3964-
times[1].tv_sec = std::chrono::duration_cast<std::chrono::seconds>(d).count();
3965-
times[1].tv_nsec = std::chrono::duration_cast<std::chrono::nanoseconds>(d).count() % 1000000000;
3964+
times[1].tv_sec = static_cast<decltype(times[1].tv_sec)>(std::chrono::duration_cast<std::chrono::seconds>(d).count());
3965+
times[1].tv_nsec = static_cast<decltype(times[1].tv_nsec)>(std::chrono::duration_cast<std::chrono::nanoseconds>(d).count() % 1000000000);
39663966
if (::utimensat(AT_FDCWD, p.c_str(), times, AT_SYMLINK_NOFOLLOW) != 0) {
39673967
ec = detail::make_system_error();
39683968
}

0 commit comments

Comments
 (0)