Clean up internal Unicode code point handling

Call code points by their name and store them as uint32_t.
This commit is contained in:
Camilla Löwy
2021-12-30 19:09:53 +01:00
parent 17a9e34fbc
commit fe7be39793
9 changed files with 43 additions and 42 deletions
+3 -3
View File
@@ -1226,15 +1226,15 @@ const char* _glfwGetScancodeNameWayland(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,