From 71f64125e8f66cf0e504c8b35f7ab89f22765ae4 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 23 Feb 2014 17:49:30 +0100 Subject: fix errors in getting current curves + add getting curent curves to tests + fix multimonitor mistakes in examples MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/blueshift_randr_c.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/blueshift_randr_c.c') diff --git a/src/blueshift_randr_c.c b/src/blueshift_randr_c.c index 856d4f0..d7be886 100644 --- a/src/blueshift_randr_c.c +++ b/src/blueshift_randr_c.c @@ -243,7 +243,7 @@ uint16_t* blueshift_randr_read(int use_crtc) G_gamma = xcb_randr_get_crtc_gamma_green(gamma_get_reply); B_gamma = xcb_randr_get_crtc_gamma_blue(gamma_get_reply); - r_gamma = ((uint16_t*)malloc((3 + R_size + G_size + B_size) * sizeof(uint16_t))) + 1; + r_gamma = malloc((3 + R_size + G_size + B_size) * sizeof(uint16_t)); g_gamma = r_gamma + R_size + 1; b_gamma = g_gamma + G_size + 1; if (r_gamma == NULL) @@ -254,17 +254,16 @@ uint16_t* blueshift_randr_read(int use_crtc) return NULL; } - *(r_gamma - 1) = R_size; - *(g_gamma - 1) = G_size; - *(b_gamma - 1) = B_size; + *r_gamma++ = R_size; + *g_gamma++ = G_size; + *b_gamma++ = B_size; for (i = 0; i < R_size; i++) *(r_gamma + i) = *(R_gamma + i); for (i = 0; i < G_size; i++) *(g_gamma + i) = *(G_gamma + i); for (i = 0; i < B_size; i++) *(b_gamma + i) = *(B_gamma + i); free(gamma_get_reply); - - return r_gamma; + return r_gamma - 1; } -- cgit v1.2.3-70-g09d2