mirror of
https://github.com/fmtlib/fmt.git
synced 2025-07-30 18:57:34 +02:00
Fix warnings.
This commit is contained in:
@ -1698,7 +1698,7 @@ TEST(FormatterTest, FileSinkWriteError) {
|
|||||||
File::pipe(read_end, write_end);
|
File::pipe(read_end, write_end);
|
||||||
BufferedFile f = read_end.fdopen("r");
|
BufferedFile f = read_end.fdopen("r");
|
||||||
fmt::FileSink fs(f.get());
|
fmt::FileSink fs(f.get());
|
||||||
int result = std::fwrite(" ", 1, 1, f.get());
|
std::size_t result = std::fwrite(" ", 1, 1, f.get());
|
||||||
int error_code = errno;
|
int error_code = errno;
|
||||||
EXPECT_EQ(0, result);
|
EXPECT_EQ(0, result);
|
||||||
EXPECT_SYSTEM_ERROR(
|
EXPECT_SYSTEM_ERROR(
|
||||||
@ -1859,7 +1859,6 @@ TEST(FormatTest, PrintColored) {
|
|||||||
TEST(FormatTest, Variadic) {
|
TEST(FormatTest, Variadic) {
|
||||||
EXPECT_EQ("abc1", str(Format("{}c{}", "ab", 1)));
|
EXPECT_EQ("abc1", str(Format("{}c{}", "ab", 1)));
|
||||||
EXPECT_EQ(L"abc1", str(Format(L"{}c{}", L"ab", 1)));
|
EXPECT_EQ(L"abc1", str(Format(L"{}c{}", L"ab", 1)));
|
||||||
EXPECT_WRITE(stdout, fmt::Print("So {}!", "variadic"), "So variadic!");
|
|
||||||
}
|
}
|
||||||
#endif // FMT_USE_VARIADIC_TEMPLATES
|
#endif // FMT_USE_VARIADIC_TEMPLATES
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ namespace {
|
|||||||
// 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.
|
||||||
inline unsigned ConvertRWCount(std::size_t count) {
|
inline unsigned ConvertRWCount(std::size_t count) {
|
||||||
return count <= UINT_MAX ? count : UINT_MAX;
|
return count <= UINT_MAX ? static_cast<unsigned>(count) : UINT_MAX;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
inline std::size_t ConvertRWCount(std::size_t count) { return count; }
|
inline std::size_t ConvertRWCount(std::size_t count) { return count; }
|
||||||
|
Reference in New Issue
Block a user