diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-02-23 17:49:30 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-02-23 17:49:30 +0100 |
commit | 71f64125e8f66cf0e504c8b35f7ab89f22765ae4 (patch) | |
tree | d524163236bd911b9113843a0eabafbbc17801d2 /src/blueshift_randr_c.c | |
parent | typo (diff) | |
download | blueshift-71f64125e8f66cf0e504c8b35f7ab89f22765ae4.tar.gz blueshift-71f64125e8f66cf0e504c8b35f7ab89f22765ae4.tar.bz2 blueshift-71f64125e8f66cf0e504c8b35f7ab89f22765ae4.tar.xz |
fix errors in getting current curves + add getting curent curves to tests + fix multimonitor mistakes in examples
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/blueshift_randr_c.c')
-rw-r--r-- | src/blueshift_randr_c.c | 11 |
1 files changed, 5 insertions, 6 deletions
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; } |