Fix more MSVC warnings.

This commit is contained in:
Victor Zverovich 2012-12-21 15:55:11 -08:00
parent 516137657e
commit a52ae287f1

View File

@ -549,7 +549,7 @@ TEST(FormatterTest, FormatDec) {
EXPECT_EQ(buffer, str(Format("{0}") << INT_MAX)); EXPECT_EQ(buffer, str(Format("{0}") << INT_MAX));
sprintf(buffer, "%u", UINT_MAX); sprintf(buffer, "%u", UINT_MAX);
EXPECT_EQ(buffer, str(Format("{0}") << UINT_MAX)); EXPECT_EQ(buffer, str(Format("{0}") << UINT_MAX));
sprintf(buffer, "%ld", 0ul - LONG_MIN); sprintf(buffer, "%ld", 0 - static_cast<unsigned long>(LONG_MIN));
EXPECT_EQ(buffer, str(Format("{0}") << LONG_MIN)); EXPECT_EQ(buffer, str(Format("{0}") << LONG_MIN));
sprintf(buffer, "%ld", LONG_MAX); sprintf(buffer, "%ld", LONG_MAX);
EXPECT_EQ(buffer, str(Format("{0}") << 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("12345678", str(Format("{0:X}") << 0x12345678));
EXPECT_EQ("90ABCDEF", str(Format("{0:X}") << 0x90ABCDEF)); EXPECT_EQ("90ABCDEF", str(Format("{0:X}") << 0x90ABCDEF));
char buffer[256]; char buffer[256];
sprintf(buffer, "-%x", 0u - INT_MIN); sprintf(buffer, "-%x", 0 - static_cast<unsigned>(INT_MIN));
EXPECT_EQ(buffer, str(Format("{0:x}") << INT_MIN)); EXPECT_EQ(buffer, str(Format("{0:x}") << INT_MIN));
sprintf(buffer, "%x", INT_MAX); sprintf(buffer, "%x", INT_MAX);
EXPECT_EQ(buffer, str(Format("{0:x}") << INT_MAX)); EXPECT_EQ(buffer, str(Format("{0:x}") << INT_MAX));
sprintf(buffer, "%x", UINT_MAX); sprintf(buffer, "%x", UINT_MAX);
EXPECT_EQ(buffer, str(Format("{0:x}") << UINT_MAX)); EXPECT_EQ(buffer, str(Format("{0:x}") << UINT_MAX));
sprintf(buffer, "-%lx", 0ul - LONG_MIN); sprintf(buffer, "-%lx", 0 - static_cast<unsigned long>(LONG_MIN));
EXPECT_EQ(buffer, str(Format("{0:x}") << LONG_MIN)); EXPECT_EQ(buffer, str(Format("{0:x}") << LONG_MIN));
sprintf(buffer, "%lx", LONG_MAX); sprintf(buffer, "%lx", LONG_MAX);
EXPECT_EQ(buffer, str(Format("{0:x}") << 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("-42", str(Format("{0:o}") << -042));
EXPECT_EQ("12345670", str(Format("{0:o}") << 012345670)); EXPECT_EQ("12345670", str(Format("{0:o}") << 012345670));
char buffer[256]; char buffer[256];
sprintf(buffer, "-%o", 0u - INT_MIN); sprintf(buffer, "-%o", 0 - static_cast<unsigned>(INT_MIN));
EXPECT_EQ(buffer, str(Format("{0:o}") << INT_MIN)); EXPECT_EQ(buffer, str(Format("{0:o}") << INT_MIN));
sprintf(buffer, "%o", INT_MAX); sprintf(buffer, "%o", INT_MAX);
EXPECT_EQ(buffer, str(Format("{0:o}") << INT_MAX)); EXPECT_EQ(buffer, str(Format("{0:o}") << INT_MAX));
sprintf(buffer, "%o", UINT_MAX); sprintf(buffer, "%o", UINT_MAX);
EXPECT_EQ(buffer, str(Format("{0:o}") << UINT_MAX)); EXPECT_EQ(buffer, str(Format("{0:o}") << UINT_MAX));
sprintf(buffer, "-%lo", 0ul - LONG_MIN); sprintf(buffer, "-%lo", 0 - static_cast<unsigned long>(LONG_MIN));
EXPECT_EQ(buffer, str(Format("{0:o}") << LONG_MIN)); EXPECT_EQ(buffer, str(Format("{0:o}") << LONG_MIN));
sprintf(buffer, "%lo", LONG_MAX); sprintf(buffer, "%lo", LONG_MAX);
EXPECT_EQ(buffer, str(Format("{0:o}") << LONG_MAX)); EXPECT_EQ(buffer, str(Format("{0:o}") << LONG_MAX));