From a52ae287f11a3ec630bd3500abdcd847c4ce2020 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Fri, 21 Dec 2012 15:55:11 -0800 Subject: [PATCH] Fix more MSVC warnings. --- format_test.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/format_test.cc b/format_test.cc index b3d7ff65..fc042cea 100644 --- a/format_test.cc +++ b/format_test.cc @@ -549,7 +549,7 @@ TEST(FormatterTest, FormatDec) { EXPECT_EQ(buffer, str(Format("{0}") << INT_MAX)); sprintf(buffer, "%u", UINT_MAX); EXPECT_EQ(buffer, str(Format("{0}") << UINT_MAX)); - sprintf(buffer, "%ld", 0ul - LONG_MIN); + sprintf(buffer, "%ld", 0 - static_cast(LONG_MIN)); EXPECT_EQ(buffer, str(Format("{0}") << LONG_MIN)); sprintf(buffer, "%ld", LONG_MAX); EXPECT_EQ(buffer, str(Format("{0}") << LONG_MAX)); @@ -567,13 +567,13 @@ TEST(FormatterTest, FormatHex) { EXPECT_EQ("12345678", str(Format("{0:X}") << 0x12345678)); EXPECT_EQ("90ABCDEF", str(Format("{0:X}") << 0x90ABCDEF)); char buffer[256]; - sprintf(buffer, "-%x", 0u - INT_MIN); + sprintf(buffer, "-%x", 0 - static_cast(INT_MIN)); EXPECT_EQ(buffer, str(Format("{0:x}") << INT_MIN)); sprintf(buffer, "%x", INT_MAX); EXPECT_EQ(buffer, str(Format("{0:x}") << INT_MAX)); sprintf(buffer, "%x", UINT_MAX); EXPECT_EQ(buffer, str(Format("{0:x}") << UINT_MAX)); - sprintf(buffer, "-%lx", 0ul - LONG_MIN); + sprintf(buffer, "-%lx", 0 - static_cast(LONG_MIN)); EXPECT_EQ(buffer, str(Format("{0:x}") << LONG_MIN)); sprintf(buffer, "%lx", LONG_MAX); EXPECT_EQ(buffer, str(Format("{0:x}") << LONG_MAX)); @@ -588,13 +588,13 @@ TEST(FormatterTest, FormatOct) { EXPECT_EQ("-42", str(Format("{0:o}") << -042)); EXPECT_EQ("12345670", str(Format("{0:o}") << 012345670)); char buffer[256]; - sprintf(buffer, "-%o", 0u - INT_MIN); + sprintf(buffer, "-%o", 0 - static_cast(INT_MIN)); EXPECT_EQ(buffer, str(Format("{0:o}") << INT_MIN)); sprintf(buffer, "%o", INT_MAX); EXPECT_EQ(buffer, str(Format("{0:o}") << INT_MAX)); sprintf(buffer, "%o", UINT_MAX); EXPECT_EQ(buffer, str(Format("{0:o}") << UINT_MAX)); - sprintf(buffer, "-%lo", 0ul - LONG_MIN); + sprintf(buffer, "-%lo", 0 - static_cast(LONG_MIN)); EXPECT_EQ(buffer, str(Format("{0:o}") << LONG_MIN)); sprintf(buffer, "%lo", LONG_MAX); EXPECT_EQ(buffer, str(Format("{0:o}") << LONG_MAX));