From 5879cf0c50cecded79224b5207be9a83c204ccad Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 5 Mar 2021 19:18:09 +0100 Subject: Fix support for fake methods MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- fake-w32-gdi.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) (limited to 'fake-w32-gdi.c') diff --git a/fake-w32-gdi.c b/fake-w32-gdi.c index 68847ca..bee0e93 100644 --- a/fake-w32-gdi.c +++ b/fake-w32-gdi.c @@ -1,7 +1,6 @@ /* See LICENSE file for copyright and license details. */ -#ifndef HAVE_LIBGAMMA_METHOD_W32_GDI -# error Compiling fake-w32-gdi.c without FAKE_LIBGAMMA_METHOD_W32_GDI -#endif +#define IN_LIBGAMMA_W32_GDI +#include "common.h" /* This file very sloppily translates Windows GDI calls to X RandR calls. * It should by no means be used, without additional modification, as a @@ -10,18 +9,11 @@ * a GNU/Linux system under X. */ -#include "fake-w32-gdi.h" - -#include -#include -#include - #ifndef HAVE_LIBGAMMA_METHOD_X_RANDR /* Use dummy translation */ - /** * Get the device context for a window or the entire screen * @@ -56,7 +48,6 @@ ReleaseDC(HWND hWnd, HDC hDC) } - /** * Get information (capabilities) for a device context * @@ -113,7 +104,6 @@ GetDeviceGammaRamp(HDC hDC, LPVOID restrict lpRamp) } - /** * Get the context for a device * @@ -262,7 +252,6 @@ ReleaseDC(HWND hWnd, HDC hDC) } - /** * Get information (capabilities) for a device context * @@ -306,7 +295,7 @@ SetDeviceGammaRamp(HDC hDC, LPVOID restrict lpRamp) xcb_randr_set_crtc_gamma_checked(connection, *(xcb_randr_crtc_t *)hDC, GAMMA_RAMP_SIZE, &((uint16_t *)lpRamp)[0 * GAMMA_RAMP_SIZE], &((uint16_t *)lpRamp)[1 * GAMMA_RAMP_SIZE], - &((uint16_t *)lpRamp)[2 * GAMMA_RAMP_SIZE)]; + &((uint16_t *)lpRamp)[2 * GAMMA_RAMP_SIZE]); xcb_generic_error_t *error = xcb_request_check(connection, gamma_cookie); return !error ? TRUE : FALSE; } @@ -350,7 +339,6 @@ GetDeviceGammaRamp(HDC hDC, LPVOID restrict lpRamp) } - /** * Get the context for a device * @@ -469,7 +457,7 @@ EnumDisplayDevices(LPCTSTR restrict lpDevice, DWORD iDevNum, PDISPLAY_DEVICE res return FALSE; } /* Store name for the CRTC */ - sprintf(lpDisplayDevice->DeviceName, "%i", iDevNum); + sprintf(lpDisplayDevice->DeviceName, "%lu", (unsigned long int)iDevNum); /* The connector that the CRTC belongs to is enabled */ lpDisplayDevice->StateFlags = DISPLAY_DEVICE_ACTIVE; return TRUE; -- cgit v1.2.3-70-g09d2