Commit 71117e2c by Peter Kasting Committed by Jamie Madill

Fix some MSVC warnings about possible truncation of int -> char.

BUG=81439 TEST=none Change-Id: Iedf02bf374e4992fc4c8ee050eff76f4f05708ac Reviewed-on: https://chromium-review.googlesource.com/214065Reviewed-by: 's avatarKenneth Russell <kbr@chromium.org> Tested-by: 's avatarPeter Kasting <pkasting@chromium.org>
parent db8ae16b
...@@ -41,7 +41,7 @@ bool isWhitespace(char c) ...@@ -41,7 +41,7 @@ bool isWhitespace(char c)
TEST_P(CharTest, Identified) TEST_P(CharTest, Identified)
{ {
std::string str(1, GetParam()); std::string str(1, static_cast<char>(GetParam()));
const char* cstr = str.c_str(); const char* cstr = str.c_str();
int length = 1; int length = 1;
......
...@@ -145,17 +145,17 @@ INSTANTIATE_TEST_CASE_P(A_Z_0_9, ...@@ -145,17 +145,17 @@ INSTANTIATE_TEST_CASE_P(A_Z_0_9,
TEST_F(IdentifierTest, AllLetters) TEST_F(IdentifierTest, AllLetters)
{ {
std::string str; std::string str;
for (int c = 'a'; c <= 'z'; ++c) for (char c = 'a'; c <= 'z'; ++c)
str.push_back(c); str.push_back(c);
str.push_back('_'); str.push_back('_');
for (int c = 'A'; c <= 'Z'; ++c) for (char c = 'A'; c <= 'Z'; ++c)
str.push_back(c); str.push_back(c);
str.push_back('_'); str.push_back('_');
for (int c = '0'; c <= '9'; ++c) for (char c = '0'; c <= '9'; ++c)
str.push_back(c); str.push_back(c);
expectIdentifier(str); expectIdentifier(str);
......
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