From 09b5dfbd5391429d2eb217855125b06b2226f32f Mon Sep 17 00:00:00 2001 From: Soren Jorvang Date: Thu, 22 Jul 2010 07:55:35 +0000 Subject: Prevent Python from stripping off the final newline of the main(){} autoconfiguration tests. Some versions of gcc care enough about ANSI C to complain about this. Use the Linux install hierarchy conventions on other Unices as well. XKeysymToString returns NULL on unknown keysyms, which is not a valid std::string initializer. There appears to be some disagreement regarding the second parameter to iconv(). Some versions/installations have it as const, others don't. Unfortunately, due to wonderful C++ brain damage, implicit conversion from const to non-const doesn't work here. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5945 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/InputCommon/Src/ControllerInterface/Xlib/Xlib.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Source/Core/InputCommon/Src/ControllerInterface') diff --git a/Source/Core/InputCommon/Src/ControllerInterface/Xlib/Xlib.cpp b/Source/Core/InputCommon/Src/ControllerInterface/Xlib/Xlib.cpp index 68294ebfc2..f1dcbaa79a 100644 --- a/Source/Core/InputCommon/Src/ControllerInterface/Xlib/Xlib.cpp +++ b/Source/Core/InputCommon/Src/ControllerInterface/Xlib/Xlib.cpp @@ -113,9 +113,10 @@ KeyboardMouse::Key::Key(Display* const display, KeyCode keycode) if (keysym >= 97 && keysym <= 122) keysym -= 32; - // 0x0110ffff is the top of the unicode character range according to keysymdef.h - // although it is probably more than we need. - if (keysym == NoSymbol || keysym > 0x0110ffff) + // 0x0110ffff is the top of the unicode character range according + // to keysymdef.h although it is probably more than we need. + if (keysym == NoSymbol || keysym > 0x0110ffff || + XKeysymToString(keysym) == NULL) m_keyname = std::string(); else m_keyname = std::string(XKeysymToString(keysym)); -- cgit v1.2.3