Commit 200ee6f1 authored by Rosen Penev's avatar Rosen Penev Committed by Victor Zverovich

Fix minor clang-tidy warnings

using instead of typedef.

climits instead of limits.h

Added missing cast to size_t.
parent bcd9b933
...@@ -698,7 +698,7 @@ FMT_API bool grisu_format(Double value, buffer<char>& buf, int precision, ...@@ -698,7 +698,7 @@ FMT_API bool grisu_format(Double value, buffer<char>& buf, int precision,
buf.push_back('0'); buf.push_back('0');
} else { } else {
exp = -precision; exp = -precision;
buf.resize(precision); buf.resize(to_unsigned(precision));
std::uninitialized_fill_n(buf.data(), precision, '0'); std::uninitialized_fill_n(buf.data(), precision, '0');
} }
return true; return true;
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include "fmt/posix.h" #include "fmt/posix.h"
#include <limits.h> #include <climits>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/types.h> #include <sys/types.h>
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
namespace { namespace {
#ifdef _WIN32 #ifdef _WIN32
// Return type of read and write functions. // 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 // On Windows the count argument to read and write is unsigned, so convert
// it from size_t preventing integer overflow. // it from size_t preventing integer overflow.
...@@ -58,7 +58,7 @@ inline unsigned convert_rwcount(std::size_t count) { ...@@ -58,7 +58,7 @@ inline unsigned convert_rwcount(std::size_t count) {
} }
#else #else
// Return type of read and write functions. // 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; } inline std::size_t convert_rwcount(std::size_t count) { return count; }
#endif #endif
...@@ -138,7 +138,7 @@ long long file::size() const { ...@@ -138,7 +138,7 @@ long long file::size() const {
unsigned long long long_size = size_upper; unsigned long long long_size = size_upper;
return (long_size << sizeof(DWORD) * CHAR_BIT) | size_lower; return (long_size << sizeof(DWORD) * CHAR_BIT) | size_lower;
#else #else
typedef struct stat Stat; using Stat = struct stat;
Stat file_stat = Stat(); Stat file_stat = Stat();
if (FMT_POSIX_CALL(fstat(fd_, &file_stat)) == -1) if (FMT_POSIX_CALL(fstat(fd_, &file_stat)) == -1)
FMT_THROW(system_error(errno, "cannot get file attributes")); FMT_THROW(system_error(errno, "cannot get file attributes"));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment