From 9b1807a8a278b92c43e6ba3ebf08219caf43f4b8 Mon Sep 17 00:00:00 2001 From: Acretock <56088192+Acretock@users.noreply.github.com> Date: Wed, 1 Dec 2021 19:40:17 +0500 Subject: [PATCH] fix int -> uint warning (#2611) * fix int -> uint warning * change unsigned int to mode_t * undef + warn uint -> ushort loss presision * fix mode_t * mode_t in detail Co-authored-by: Acretock --- src/os.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/os.cc b/src/os.cc index 4d0d0a71..c682625a 100644 --- a/src/os.cc +++ b/src/os.cc @@ -107,6 +107,8 @@ int detail::utf16_to_utf8::convert(basic_string_view s) { namespace detail { +using mode_t = int; + class system_message { system_message(const system_message&) = delete; void operator=(const system_message&) = delete; @@ -218,7 +220,8 @@ int buffered_file::fileno() const { #if FMT_USE_FCNTL file::file(cstring_view path, int oflag) { - int mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH; + using namespace detail; + mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH; # if defined(_WIN32) && !defined(__MINGW32__) fd_ = -1; FMT_POSIX_CALL(sopen_s(&fd_, path.c_str(), oflag, _SH_DENYNO, mode));