Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix int -> uint warning #2611

Merged
merged 5 commits into from
Dec 1, 2021
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/os.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,11 @@
# define S_IROTH 0
# endif


Acretock marked this conversation as resolved.
Show resolved Hide resolved
# ifdef __MINGW32__
# define _SH_DENYNO 0x40
# else
using mode_t = int;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's put mode_t in the fmt::detail namespace and in the file constructor add using namespace fmt::detail. Then it will pick up our fmt::detail::mode_t if available and the global one otherwise. Also no need to check for __MINGW32__.

# endif
# endif // _WIN32
#endif // FMT_USE_FCNTL
Expand Down Expand Up @@ -218,7 +221,7 @@ 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;
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));
Expand Down