From 4522cb1df9f51b55c9795956adb801cb5177c99b Mon Sep 17 00:00:00 2001 From: Kyle Schaefer Date: Tue, 25 May 2021 03:17:03 -0700 Subject: [PATCH] Changing variable from float to int, this way we can check it's value without having to do an unnecessary conversion. Then do explicit conversions later on if we need. --- src/video/x11/SDL_x11modes.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/video/x11/SDL_x11modes.c b/src/video/x11/SDL_x11modes.c index 3e1d45639..e14c90e83 100644 --- a/src/video/x11/SDL_x11modes.c +++ b/src/video/x11/SDL_x11modes.c @@ -440,7 +440,7 @@ X11_InitModes_XRandR(_THIS) RRMode modeID; RRCrtc output_crtc; XRRCrtcInfo *crtc; - float xft_dpi; + int xft_dpi = 0; /* The primary output _should_ always be sorted first, but just in case... */ if ((looking_for_primary && (res->outputs[output] != primary)) || @@ -497,10 +497,10 @@ X11_InitModes_XRandR(_THIS) displaydata->ddpi = SDL_ComputeDiagonalDPI(mode.w, mode.h, ((float) display_mm_width) / 25.4f,((float) display_mm_height) / 25.4f); /* if xft dpi is available we will use this over xrandr */ - xft_dpi = (float)GetXftDPI(dpy); + xft_dpi = GetXftDPI(dpy); if(xft_dpi > 0) { - displaydata->hdpi = xft_dpi; - displaydata->vdpi = xft_dpi; + displaydata->hdpi = (float)xft_dpi; + displaydata->vdpi = (float)xft_dpi; } displaydata->scanline_pad = scanline_pad;