From caff5f2e1a1c23f70ecf529a84d4d75d2445a44a Mon Sep 17 00:00:00 2001 From: Ben Cheng Date: Mon, 19 May 2014 14:27:31 -0700 Subject: [PATCH] Address additional warnings found by GCC 4.9. Change-Id: If668a6eb98a6ce7b2872f528b8e3527638814f68 --- tests/wchar_test.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/wchar_test.cpp b/tests/wchar_test.cpp index c8aec2d8c..50b860893 100644 --- a/tests/wchar_test.cpp +++ b/tests/wchar_test.cpp @@ -306,19 +306,19 @@ void test_mbrtowc_incomplete(mbstate_t* ps) { // 2-byte UTF-8. ASSERT_EQ(static_cast(-2), mbrtowc(&out, "\xc2", 1, ps)); ASSERT_EQ(1U, mbrtowc(&out, "\xa2" "cdef", 5, ps)); - ASSERT_EQ(0x00a2, out); + ASSERT_EQ(static_cast(0x00a2), out); ASSERT_TRUE(mbsinit(ps)); // 3-byte UTF-8. ASSERT_EQ(static_cast(-2), mbrtowc(&out, "\xe2", 1, ps)); ASSERT_EQ(static_cast(-2), mbrtowc(&out, "\x82", 1, ps)); ASSERT_EQ(1U, mbrtowc(&out, "\xac" "def", 4, ps)); - ASSERT_EQ(0x20ac, out); + ASSERT_EQ(static_cast(0x20ac), out); ASSERT_TRUE(mbsinit(ps)); // 4-byte UTF-8. ASSERT_EQ(static_cast(-2), mbrtowc(&out, "\xf0", 1, ps)); ASSERT_EQ(static_cast(-2), mbrtowc(&out, "\xa4\xad", 2, ps)); ASSERT_EQ(1U, mbrtowc(&out, "\xa2" "ef", 3, ps)); - ASSERT_EQ(0x24b62, out); + ASSERT_EQ(static_cast(0x24b62), out); ASSERT_TRUE(mbsinit(ps)); // Invalid 2-byte @@ -341,9 +341,9 @@ void test_mbsrtowcs(mbstate_t* ps) { const char* valid = "A" "\xc2\xa2" "\xe2\x82\xac" "\xf0\xa4\xad\xa2" "ef"; ASSERT_EQ(4U, mbsrtowcs(out, &valid, 4, ps)); ASSERT_EQ(L'A', out[0]); - ASSERT_EQ(0x00a2, out[1]); - ASSERT_EQ(0x20ac, out[2]); - ASSERT_EQ(0x24b62, out[3]); + ASSERT_EQ(static_cast(0x00a2), out[1]); + ASSERT_EQ(static_cast(0x20ac), out[2]); + ASSERT_EQ(static_cast(0x24b62), out[3]); ASSERT_EQ('e', *valid); const char* invalid = "A" "\xc2\x20" "ef";