Clean up internal Unicode code point handling

Call code points by their name and store them as uint32_t.

(cherry picked from commit fe7be39793)
This commit is contained in:
Camilla Löwy
2021-12-30 19:09:53 +01:00
parent 1f7ce12cbc
commit 5066f57371
9 changed files with 43 additions and 42 deletions
+3 -3
View File
@@ -1387,15 +1387,15 @@ const char* _glfwPlatformGetScancodeName(int scancode)
return NULL;
}
const long codepoint = _glfwKeySym2Unicode(keysyms[0]);
if (codepoint == -1)
const uint32_t codepoint = _glfwKeySym2Unicode(keysyms[0]);
if (codepoint == GLFW_INVALID_CODEPOINT)
{
_glfwInputError(GLFW_PLATFORM_ERROR,
"Wayland: Failed to retrieve codepoint for key name");
return NULL;
}
const size_t count = _glfwEncodeUTF8(_glfw.wl.keynames[key], (unsigned int) codepoint);
const size_t count = _glfwEncodeUTF8(_glfw.wl.keynames[key], codepoint);
if (count == 0)
{
_glfwInputError(GLFW_PLATFORM_ERROR,