From: Silver Zachara Date: Mon, 27 May 2024 19:48:05 +0000 (+0200) Subject: chore: Improve cast and avoid repeating types (#1459) X-Git-Tag: v4.10~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b414f69c8036583bab36f7d1df492258ee8052b8;p=thirdparty%2Fccache.git chore: Improve cast and avoid repeating types (#1459) --- diff --git a/src/ccache/InodeCache.cpp b/src/ccache/InodeCache.cpp index d4ce3838..cb3952ac 100644 --- a/src/ccache/InodeCache.cpp +++ b/src/ccache/InodeCache.cpp @@ -155,7 +155,7 @@ fd_is_on_known_to_work_file_system(int fd) } return known_to_work; #else - HANDLE file = (HANDLE)_get_osfhandle(fd); + HANDLE file = reinterpret_cast(_get_osfhandle(fd)); if (file == INVALID_HANDLE_VALUE) { return false; } diff --git a/src/ccache/util/wincompat.hpp b/src/ccache/util/wincompat.hpp index f2f2a798..f8d84060 100644 --- a/src/ccache/util/wincompat.hpp +++ b/src/ccache/util/wincompat.hpp @@ -29,8 +29,8 @@ // From: // http://mesos.apache.org/api/latest/c++/3rdparty_2stout_2include_2stout_2windows_8hpp_source.html # ifdef _MSC_VER -const mode_t S_IRUSR = mode_t{_S_IREAD}; -const mode_t S_IWUSR = mode_t{_S_IWRITE}; +constexpr auto S_IRUSR = mode_t{_S_IREAD}; +constexpr auto S_IWUSR = mode_t{_S_IWRITE}; # endif # ifndef S_IFIFO