From c68d6050fd37737cf6429d8ff9a4b6e8aba958b1 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 16 Apr 2014 01:23:06 +0200 Subject: fix warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/fake_quartz.c | 17 ++++++++++------- src/fake_quartz.h | 2 +- 2 files changed, 11 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/fake_quartz.c b/src/fake_quartz.c index 6508860..3fe821c 100644 --- a/src/fake_quartz.c +++ b/src/fake_quartz.c @@ -19,6 +19,7 @@ #include #include +#include #include #include @@ -123,17 +124,18 @@ CGError CGSetDisplayTransferByTable(CGDirectDisplayID display, uint32_t gamma_si for (i = 0; i < 256; i++) { - v = red[i] * UINT16_MAX; - r_int[i] = v < 0 ? 0 : v > UINT16_MAX ? UINT16_MAX : v; + v = (int32_t)(red[i] * UINT16_MAX); + r_int[i] = (uint16_t)(v < 0 ? 0 : v > UINT16_MAX ? UINT16_MAX : v); - v = green[i] * UINT16_MAX; - g_int[i] = v < 0 ? 0 : v > UINT16_MAX ? UINT16_MAX : v; + v = (int32_t)(green[i] * UINT16_MAX); + g_int[i] = (uint16_t)(v < 0 ? 0 : v > UINT16_MAX ? UINT16_MAX : v); - v = blue[i] * UINT16_MAX; - b_int[i] = v < 0 ? 0 : v > UINT16_MAX ? UINT16_MAX : v; + v = (int32_t)(blue[i] * UINT16_MAX); + b_int[i] = (uint16_t)(v < 0 ? 0 : v > UINT16_MAX ? UINT16_MAX : v); } - gamma_cookie = xcb_randr_set_crtc_gamma_checked(conn, crtcs[display], gamma_size, r_int, g_int, b_int); + gamma_cookie = xcb_randr_set_crtc_gamma_checked(conn, crtcs[display], + (uint16_t)gamma_size, r_int, g_int, b_int); return xcb_request_check(conn, gamma_cookie) == NULL ? kCGErrorSuccess : ~kCGErrorSuccess; } @@ -196,6 +198,7 @@ void CGDisplayRestoreColorSyncSettings(void) uint32_t CGDisplayGammaTableCapacity(CGDirectDisplayID display) { + (void) display; return 256; } diff --git a/src/fake_quartz.h b/src/fake_quartz.h index ee6d065..d6603dc 100644 --- a/src/fake_quartz.h +++ b/src/fake_quartz.h @@ -51,7 +51,7 @@ CGError CGGetDisplayTransferByTable(CGDirectDisplayID display, uint32_t gamma_si void CGDisplayRestoreColorSyncSettings(void); -uint32_t CGDisplayGammaTableCapacity(CGDirectDisplayID display); +uint32_t CGDisplayGammaTableCapacity(CGDirectDisplayID display) __attribute__((const)); /* The follow part most only be used when this module is used, -- cgit v1.2.3-70-g09d2