Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1505)

Unified Diff: base/strings/string_util.h

Issue 596103002: Fix more disabled MSVC warnings, base/ edition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't assume char (un)signedness Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: base/strings/string_util.h
diff --git a/base/strings/string_util.h b/base/strings/string_util.h
index e20bbf0a40c59f9440a23812ca7e8723dd2c9dec..32493aaaf252048380e690b7c543e65cd4f5d8f3 100644
--- a/base/strings/string_util.h
+++ b/base/strings/string_util.h
@@ -352,14 +352,14 @@ inline bool IsHexDigit(Char c) {
}
template <typename Char>
-inline Char HexDigitToInt(Char c) {
+inline char HexDigitToInt(Char c) {
DCHECK(IsHexDigit(c));
if (c >= '0' && c <= '9')
- return c - '0';
+ return static_cast<char>(c - '0');
if (c >= 'A' && c <= 'F')
- return c - 'A' + 10;
+ return static_cast<char>(c - 'A' + 10);
if (c >= 'a' && c <= 'f')
- return c - 'a' + 10;
+ return static_cast<char>(c - 'a' + 10);
return 0;
}

Powered by Google App Engine
This is Rietveld 408576698