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 <George.Goncharov@finch-xr.com>
This commit is contained in:
Acretock 2021-12-01 19:40:17 +05:00 committed by GitHub
parent ec3b097cb9
commit 9b1807a8a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -107,6 +107,8 @@ int detail::utf16_to_utf8::convert(basic_string_view<wchar_t> s) {
namespace detail { namespace detail {
using mode_t = int;
class system_message { class system_message {
system_message(const system_message&) = delete; system_message(const system_message&) = delete;
void operator=(const system_message&) = delete; void operator=(const system_message&) = delete;
@ -218,7 +220,8 @@ int buffered_file::fileno() const {
#if FMT_USE_FCNTL #if FMT_USE_FCNTL
file::file(cstring_view path, int oflag) { 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__) # if defined(_WIN32) && !defined(__MINGW32__)
fd_ = -1; fd_ = -1;
FMT_POSIX_CALL(sopen_s(&fd_, path.c_str(), oflag, _SH_DENYNO, mode)); FMT_POSIX_CALL(sopen_s(&fd_, path.c_str(), oflag, _SH_DENYNO, mode));