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

Unified Diff: ui/base/keycodes/keyboard_code_conversion.cc

Issue 8590010: Valgrind: Fix the gcc 4.2 mac build. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/keycodes/keyboard_code_conversion.cc
diff --git a/ui/base/keycodes/keyboard_code_conversion.cc b/ui/base/keycodes/keyboard_code_conversion.cc
index eaaf1fae041c8cec4b466afb81d5d1913e3f52f4..0016f6d78cbecdf5b95225c90ce70c323d4df796 100644
--- a/ui/base/keycodes/keyboard_code_conversion.cc
+++ b/ui/base/keycodes/keyboard_code_conversion.cc
@@ -57,10 +57,12 @@ uint16 GetCharacterFromKeyCode(KeyboardCode key_code, int flags) {
}
// Normal characters
- if (key_code >= VKEY_0 && key_code <= VKEY_9)
- return shift ? ")!@#$%^&*("[key_code - VKEY_0] : key_code;
- else if (key_code >= VKEY_NUMPAD0 && key_code <= VKEY_NUMPAD9)
+ if (key_code >= VKEY_0 && key_code <= VKEY_9) {
+ return shift ? ")!@#$%^&*("[key_code - VKEY_0] :
+ static_cast<uint16>(key_code);
+ } else if (key_code >= VKEY_NUMPAD0 && key_code <= VKEY_NUMPAD9) {
return key_code - VKEY_NUMPAD0 + '0';
+ }
switch (key_code) {
case VKEY_TAB:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698