summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-04-16 01:23:06 +0200
committerMattias Andrée <maandree@operamail.com>2014-04-16 01:23:06 +0200
commitc68d6050fd37737cf6429d8ff9a4b6e8aba958b1 (patch)
tree36adcdb72f06d8ad84a9266e6bf18c9f3831131b /src
parentupdate makefile and gitignore (diff)
downloadblueshift-c68d6050fd37737cf6429d8ff9a4b6e8aba958b1.tar.gz
blueshift-c68d6050fd37737cf6429d8ff9a4b6e8aba958b1.tar.bz2
blueshift-c68d6050fd37737cf6429d8ff9a4b6e8aba958b1.tar.xz
fix warnings
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r--src/fake_quartz.c17
-rw-r--r--src/fake_quartz.h2
2 files changed, 11 insertions, 8 deletions
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 <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <xcb/xcb.h>
#include <xcb/randr.h>
@@ -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,