diff options
author | Mattias Andrée <maandree@kth.se> | 2021-03-05 19:18:09 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2021-03-05 19:18:09 +0100 |
commit | 5879cf0c50cecded79224b5207be9a83c204ccad (patch) | |
tree | 248c8b03d86b1679cfdb42b4f274839a8f981272 /fake-w32-gdi.c | |
parent | Update todo (diff) | |
download | libgamma-5879cf0c50cecded79224b5207be9a83c204ccad.tar.gz libgamma-5879cf0c50cecded79224b5207be9a83c204ccad.tar.bz2 libgamma-5879cf0c50cecded79224b5207be9a83c204ccad.tar.xz |
Fix support for fake methods
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r-- | fake-w32-gdi.c | 20 |
1 files changed, 4 insertions, 16 deletions
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 <stdio.h> -#include <stdlib.h> -#include <string.h> - #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; |