diff options
author | Rosen Penev <rosenp@gmail.com> | 2019-08-29 11:23:14 -0700 |
---|---|---|
committer | Victor Zverovich <victor.zverovich@gmail.com> | 2019-08-31 07:02:21 -0700 |
commit | 200ee6f108cedb49c89a7194fbe6f9826f1bb537 (patch) | |
tree | 06c7728b0a49fe98d8de1dd08e13ff0b9325b0f6 /src/posix.cc | |
parent | bcd9b9331a4d657152c9618819626c7d777cef83 (diff) | |
download | fmtlib-200ee6f108cedb49c89a7194fbe6f9826f1bb537.tar.gz |
Fix minor clang-tidy warnings
using instead of typedef.
climits instead of limits.h
Added missing cast to size_t.
Diffstat (limited to 'src/posix.cc')
-rw-r--r-- | src/posix.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/posix.cc b/src/posix.cc index 69c27819..79b8ecbe 100644 --- a/src/posix.cc +++ b/src/posix.cc @@ -12,7 +12,7 @@ #include "fmt/posix.h" -#include <limits.h> +#include <climits> #include <sys/stat.h> #include <sys/types.h> @@ -49,7 +49,7 @@ namespace { #ifdef _WIN32 // Return type of read and write functions. -typedef int RWResult; +using RWResult = int; // On Windows the count argument to read and write is unsigned, so convert // it from size_t preventing integer overflow. @@ -58,7 +58,7 @@ inline unsigned convert_rwcount(std::size_t count) { } #else // Return type of read and write functions. -typedef ssize_t RWResult; +using RWResult = ssize_t; inline std::size_t convert_rwcount(std::size_t count) { return count; } #endif @@ -138,7 +138,7 @@ long long file::size() const { unsigned long long long_size = size_upper; return (long_size << sizeof(DWORD) * CHAR_BIT) | size_lower; #else - typedef struct stat Stat; + using Stat = struct stat; Stat file_stat = Stat(); if (FMT_POSIX_CALL(fstat(fd_, &file_stat)) == -1) FMT_THROW(system_error(errno, "cannot get file attributes")); |