Fixing signed/unsigned mismatch warnings.

This commit is contained in:
Marco Lizza 2024-02-29 01:50:49 +01:00
parent 7c2e8c7c5a
commit a02b287b1d
3 changed files with 9 additions and 9 deletions

View File

@ -366,7 +366,7 @@ static void createKeyTables(void)
// keyboard layout. Because function keys aren't mapped correctly // keyboard layout. Because function keys aren't mapped correctly
// when using traditional KeySym translations, they are mapped // when using traditional KeySym translations, they are mapped
// here instead. // here instead.
for (int i = 0; i < sizeof(keymap) / sizeof(keymap[0]); i++) for (size_t i = 0; i < sizeof(keymap) / sizeof(keymap[0]); i++)
{ {
if (strncmp(desc->names->keys[scancode].name, if (strncmp(desc->names->keys[scancode].name,
keymap[i].name, keymap[i].name,
@ -390,7 +390,7 @@ static void createKeyTables(void)
continue; continue;
} }
for (int j = 0; j < sizeof(keymap) / sizeof(keymap[0]); j++) for (size_t j = 0; j < sizeof(keymap) / sizeof(keymap[0]); j++)
{ {
if (strncmp(desc->names->key_aliases[i].alias, if (strncmp(desc->names->key_aliases[i].alias,
keymap[j].name, keymap[j].name,

View File

@ -179,8 +179,8 @@ void _glfwPollMonitorsX11(void)
{ {
if (screens[j].x_org == ci->x && if (screens[j].x_org == ci->x &&
screens[j].y_org == ci->y && screens[j].y_org == ci->y &&
screens[j].width == ci->width && screens[j].width == (int)ci->width &&
screens[j].height == ci->height) screens[j].height == (int)ci->height)
{ {
monitor->x11.index = j; monitor->x11.index = j;
break; break;
@ -572,7 +572,7 @@ void _glfwSetGammaRampX11(_GLFWmonitor* monitor, const GLFWgammaramp* ramp)
{ {
if (_glfw.x11.randr.available && !_glfw.x11.randr.gammaBroken) if (_glfw.x11.randr.available && !_glfw.x11.randr.gammaBroken)
{ {
if (XRRGetCrtcGammaSize(_glfw.x11.display, monitor->x11.crtc) != ramp->size) if (XRRGetCrtcGammaSize(_glfw.x11.display, monitor->x11.crtc) != (int)ramp->size)
{ {
_glfwInputError(GLFW_PLATFORM_ERROR, _glfwInputError(GLFW_PLATFORM_ERROR,
"X11: Gamma ramp size must match current ramp size"); "X11: Gamma ramp size must match current ramp size");

View File

@ -97,7 +97,7 @@ static GLFWbool waitForAnyEvent(double* timeout)
if (!_glfwPollPOSIX(fds, sizeof(fds) / sizeof(fds[0]), timeout)) if (!_glfwPollPOSIX(fds, sizeof(fds) / sizeof(fds[0]), timeout))
return GLFW_FALSE; return GLFW_FALSE;
for (int i = 1; i < sizeof(fds) / sizeof(fds[0]); i++) for (size_t i = 1; i < sizeof(fds) / sizeof(fds[0]); i++)
{ {
if (fds[i].revents & POLLIN) if (fds[i].revents & POLLIN)
return GLFW_TRUE; return GLFW_TRUE;
@ -235,10 +235,10 @@ static int translateState(int state)
// Translates an X11 key code to a GLFW key token // Translates an X11 key code to a GLFW key token
// //
static int translateKey(int scancode) static int translateKey(unsigned int scancode)
{ {
// Use the pre-filled LUT (see createKeyTables() in x11_init.c) // Use the pre-filled LUT (see createKeyTables() in x11_init.c)
if (scancode < 0 || scancode > 255) if (scancode > 255)
return GLFW_KEY_UNKNOWN; return GLFW_KEY_UNKNOWN;
return _glfw.x11.keycodes[scancode]; return _glfw.x11.keycodes[scancode];
@ -1145,7 +1145,7 @@ static void releaseMonitor(_GLFWwindow* window)
// //
static void processEvent(XEvent *event) static void processEvent(XEvent *event)
{ {
int keycode = 0; unsigned int keycode = 0;
Bool filtered = False; Bool filtered = False;
// HACK: Save scancode as some IMs clear the field in XFilterEvent // HACK: Save scancode as some IMs clear the field in XFilterEvent