mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-20 23:44:59 +02:00
Check for float conversion issues on build
Useful to catch any errors left over from the migration of times from double to int64_t
This commit is contained in:
4
glfw/wl_init.c
vendored
4
glfw/wl_init.c
vendored
@@ -285,8 +285,8 @@ static void pointerHandleButton(void* data UNUSED,
|
||||
{
|
||||
xdg_toplevel_show_window_menu(window->wl.xdg.toplevel,
|
||||
_glfw.wl.seat, serial,
|
||||
window->wl.cursorPosX,
|
||||
window->wl.cursorPosY);
|
||||
(int32_t)window->wl.cursorPosX,
|
||||
(int32_t)window->wl.cursorPosY);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
4
glfw/wl_window.c
vendored
4
glfw/wl_window.c
vendored
@@ -546,9 +546,9 @@ static void xdgToplevelHandleConfigure(void* data,
|
||||
aspectRatio = (float)width / (float)height;
|
||||
targetRatio = (float)window->numer / (float)window->denom;
|
||||
if (aspectRatio < targetRatio)
|
||||
height = width / targetRatio;
|
||||
height = (int32_t)((float)width / targetRatio);
|
||||
else if (aspectRatio > targetRatio)
|
||||
width = height * targetRatio;
|
||||
width = (int32_t)((float)height * targetRatio);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
2
glfw/x11_init.c
vendored
2
glfw/x11_init.c
vendored
@@ -468,7 +468,7 @@ void _glfwGetSystemContentScaleX11(float* xscale, float* yscale, bool bypass_cac
|
||||
if (XrmGetResource(db, "Xft.dpi", "Xft.Dpi", &type, &value))
|
||||
{
|
||||
if (type && strcmp(type, "String") == 0)
|
||||
xdpi = ydpi = atof(value.addr);
|
||||
xdpi = ydpi = (float)atof(value.addr);
|
||||
}
|
||||
|
||||
XrmDestroyDatabase(db);
|
||||
|
||||
4
glfw/x11_window.c
vendored
4
glfw/x11_window.c
vendored
@@ -509,8 +509,8 @@ static bool createNativeWindow(_GLFWwindow* window,
|
||||
|
||||
if (wndconfig->scaleToMonitor)
|
||||
{
|
||||
width *= _glfw.x11.contentScaleX;
|
||||
height *= _glfw.x11.contentScaleY;
|
||||
width *= (int)_glfw.x11.contentScaleX;
|
||||
height *= (int)_glfw.x11.contentScaleY;
|
||||
}
|
||||
|
||||
// Create a colormap based on the visual used by the current context
|
||||
|
||||
Reference in New Issue
Block a user